NetworkX

Previous topic

networkx.random_lobster

Next topic

networkx.random_powerlaw_tree

Quick search

networkx.random_shell_graph

random_shell_graph(constructor, seed=None)

Return a random shell graph for the constructor given.

  • constructor: a list of three-tuples [(n1,m1,d1),(n2,m2,d2),..] one for each shell, starting at the center shell.

  • n : the number of nodes in the shell

  • m : the number or edges in the shell

  • d : the ratio of inter (next) shell edges to intra shell edges.

    d=0 means no intra shell edges. d=1 for the last shell

  • seed: seed for random number generator (default=None)

>>> constructor=[(10,20,0.8),(20,40,0.8)]
>>> G=nx.random_shell_graph(constructor)