Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version


flatten = [<0,1,2> <0,2,3> <0,1,4> <1,2,4> <0,3,4> <2,3,4>]
planar = {}
for key in flatten:
    planar[key] = {}
G = Graph(planar)

The output

Traceback (most recent call last):
next_edge = next(g_edge_iter(v))

A dict where the keys are faces and the values that are just empty dicts and not edges raises a stop iteration error when the eulerian_circuit function is called. This is due to the planar representation function. I can rewrite the code or just put an if statement to catch this case.