Ask Your Question

aleph_two's profile - activity

2021-07-27 10:16:23 +0200 received badge  Popular Question (source)
2019-01-27 18:01:23 +0200 received badge  Student (source)
2019-01-27 17:54:59 +0200 received badge  Editor (source)
2019-01-27 17:54:52 +0200 asked a question Why does Sage 'stall' in this graph calculation?

I was doing a demonstration for an intro graph theory course when it suddenly took a very long time to even look through 10,000 graphs. At home I isolated the troublesome code, which is this:

 sage: for g in graphs(10):
 ....:     x=g.edges();

Removing the x=, I found something surprising, the output stalls for >3min once it gets to the following graph:

[(0, 1, None), (0, 2, None), (0, 3, None), (0, 4, None), (0, 5, None), (0, 6, None), (0, 7, None), (0, 8, None), (1, 3, None), (2, 3, None), (3, 4, None), (3, 5, None), (3, 6, None), (3, 7, None), (3, 8, None), (3, 9, None)]

Moreover on CoCalc [with a free server] this issue doesn't come up; it happily works through all of the graphs on 10 vertices with no discernable pauses. (Of course it takes a while to get through all 12 million, but I can see with debug statements that it is chugging along.)

The calculation pauses at other points but for much more reasonable lengths of time (<5sec).

Any idea what is going on here?