partial_duplication_graph(N, n, p, q, seed=None)
A graph of nodes is grown by creating a fully connected graph of size n
. The following procedure is then repeated until a total of N
nodes have been reached.
A random node, u, is picked and a new node, v, is created.
For each neighbor of u an edge from the neighbor to v is created with probability p
.
An edge from u to v is created with probability q
.
This algorithm appears in [1].
This implementation allows the possibility of generating disconnected graphs.
The total number of nodes in the final graph.
The number of nodes in the initial clique.
The probability of joining each neighbor of a node to the duplicate node. Must be a number in the between zero and one, inclusive.
The probability of joining the source node to the duplicate node. Must be a number in the between zero and one, inclusive.
Indicator of random number generation state. See Randomness<randomness>
.
Returns a random graph using the partial duplication model.
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them