Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

edge label in graph doesn't print

I'm creating triplets from a string to avoid typing all those {}, to create a graph. Although the vertexes label properly, each third element should label an edge, but nothing happens. Otherwise it works. What is missing? Thanks.image description

grafadds = []
triplet = "alpha beta ab beta cappa bc cappa delta cd delta gamma dg alpha beta ab gamma alpha ga gamma beta gb beta alpha ba gamma gamma gg".split()
triplet = iter(triplet)

while True:
        grafadds.append((next(triplet), next(triplet),next(triplet)))
    except StopIteration:

G = Graph(multiedges=True,loops=True)