[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] returning a graph object
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] returning a graph object |
Date: |
Fri, 13 Feb 2009 12:00:25 +0000 |
Hi Marco,
Since I don't know what's in your evolve() function, I came up with a
very simple sketch and it works for me:
#!/usr/bin/env python
from igraph import *
import random
def evolve(graph):
graph.delete_edges(random.randint(0, g.ecount()-1))
return graph
g = Graph.Full(100)
while g.ecount():
g = evolve(g)
print g.ecount()
So whatever is causing problems for you, it must be something that's
in your evolve() function. Either please send me the full source code
of evolve() or try to eliminate some parts of evolve() iteratively
until you no longer experience the problem - the statements that you
erased for the last time is most likely the cause of the problem.
--
T.