So I'm trying to generate a random directed graph such that each vertex has 3 in-nodes and 1 outnode. But graph tool seems to be getting stuck in the deg_sampler() function.
from graph_tool.all import *
def deg_sampler():
return 1,2
g = random_graph(1000,deg_sampler,verbose=True)
I get this error after running the code
adding vertices: 1000 of 1000 (100%)
fixing average degrees. Total degree difference: 1000^CTraceback (most recent call last):
File "code.py", line 6, in <module>
g = random_graph(1000,deg_sampler,verbose=True)
File "/usr/lib/python2.7/dist-packages/graph_tool/generation/__init__.py", line 384, in random_graph
_get_rng(), verbose, True)
File "/usr/lib/python2.7/dist-packages/graph_tool/generation/__init__.py", line 379, in <lambda>
sampler = lambda i: deg_sampler()
KeyboardInterrupt