igraph / python-igraph

Python interface for igraph
GNU General Public License v2.0
1.31k stars 249 forks source link

Generating Barabasi graphs with predefined initial graph #132

Closed ntamas closed 4 years ago

ntamas commented 7 years ago

From @harshays on July 13, 2017 1:1

Suppose I have a graph G and I want to add N nodes to it using preferential attachment. Is it possible to use ig.Graph.Barabasi to do this (example: ig.Graph.Barabasi(N, M, initial_graph=G))?

Copied from original issue: igraph/igraph#1013

ntamas commented 7 years ago

Yes, but 1) you need to specify N plus the vertex count of the original graph and 2) you need start_from and not initial_graph.