generate_gnc#
- graph_tool.generation.generate_gnc(N)[git][source]#
Generate a directed acyclic graph with the growing network with copying (GNC) model.
- Parameters:
- N
int Number of vertices.
- N
- Returns:
- g
Graph The generated directed acyclic graph.
- g
See also
generate_gnGrowing network
generate_gnrGrowing network with redirection
generate_forest_fireForest fire model
Notes
In the model of Krapivsky and Redner [krapivsky-network-2005], every new vertex chooses an existing vertex uniformly at random, and links to it and to all its targets. The algorithm runs in time \(O(N + E)\).
References
[krapivsky-network-2005]P. L. Krapivsky and S. Redner, “Network growth by copying”, Physical Review E 71, 036118 (2005), DOI: 10.1103/PhysRevE.71.036118 [sci-hub, @tor]
Examples
>>> g = gt.generate_gnc(10000) >>> print(g.num_edges()) 82812
A smaller instance is drawn as follows:
>>> g = gt.generate_gnc(60) >>> gt.graph_draw(g, pos=gt.sfdp_layout(g), ... output="generate_gnc-small.pdf") <...>
Growing network with copying (GNC) with \(N=60\), with the edges pointing from the newer to the older vertices.#