Liking cljdoc? Tell your friends :D

loom.gen

Graph-generating functions

Graph-generating functions
raw docstring

gen-barabasi-albertclj

(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.
sourceraw docstring

gen-circleclj

(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.
sourceraw docstring

gen-newman-wattsclj

(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.
sourceraw docstring

gen-randclj

(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.
sourceraw docstring

gen-rand-pclj

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close