Commit 7f10e926 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix seeding in random_graph()

The seed option is now correctly interpreted.
parent be9b2596
......@@ -20,15 +20,15 @@ from .. dl_import import dl_import
dl_import("import libgraph_tool_generation")
from .. core import Graph
import sys, random
import sys, numpy
__all__ = ["random_graph"]
def random_graph(N, deg_sampler, deg_corr=None, directed=True,
parallel=False, self_loops=False,
seed=0, verbose=False):
if seed != 0:
seed = random.randint(0, sys.maxint)
if seed == 0:
seed = numpy.random.randint(0, sys.maxint)
g = Graph()
if deg_corr == None:
uncorrelated = True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment