Graph-generating functions
Graph-generating functions
(gen-barabasi-albert g num-nodes m)(gen-barabasi-albert g num-nodes m seed)Generates a scale-free graph by preferential attachment (Barabasi & Albert, 1999): starting from a connected core of m+1 nodes, each new node attaches to m existing nodes chosen with probability proportional to their degree. A seed makes the result reproducible.
Generates a scale-free graph by preferential attachment (Barabasi & Albert, 1999): starting from a connected core of m+1 nodes, each new node attaches to m existing nodes chosen with probability proportional to their degree. A seed makes the result reproducible.
(gen-circle g num-nodes out-degree)Adds num-nodes nodes to graph g and connects each one to out-degree nearest neighbors on a ring.
Adds num-nodes nodes to graph g and connects each one to out-degree nearest neighbors on a ring.
(gen-newman-watts g num-nodes out-degree phi)(gen-newman-watts g num-nodes out-degree phi seed)Generates a small-world graph as described in Newman & Watts (1999): a ring of num-nodes nodes each joined to out-degree neighbors, plus random shortcuts added with probability phi. A seed makes the result reproducible.
Generates a small-world graph as described in Newman & Watts (1999): a ring of num-nodes nodes each joined to out-degree neighbors, plus random shortcuts added with probability phi. A seed makes the result reproducible.
(gen-rand g
num-nodes
num-edges
&
{:keys [min-weight max-weight loops seed]
:or {min-weight 1 max-weight 1 loops false seed (System/nanoTime)}})Adds num-nodes nodes and approximately num-edges edges to graph g. Nodes used for each edge are chosen at random and may be chosen more than once.
Adds num-nodes nodes and approximately num-edges edges to graph g. Nodes used for each edge are chosen at random and may be chosen more than once.
(gen-rand-p g
num-nodes
p
&
{:keys [min-weight max-weight loops seed]
:or
{min-weight 1 max-weight 1 loops false seed (System/nanoTime)}})Adds num-nodes nodes to graph g with the probably p of an edge between each node.
Adds num-nodes nodes to graph g with the probably p of an edge between each node.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |