Ask Your Question

Revision history [back]

how do I set label of multiedges graph

Hello,

Let me consider a graph that I often need to use: the graph with one vertex and three loops.

sage: G = DiGraph({(0,0,'a'), (0,0,'b'), (0,0,'c')})

Is there a way to change the labels after the creation? Because

sage: G.set_edge_label(0,0,'d')
Traceback (most recent call last):
...
RuntimeError: Cannot set edge label, since there are multiple edges from 0 to 0.

Vincent

how do I set label of multiedges graph

Hello,

Let me consider a graph that I often need to use: the graph with one vertex and three loops.

sage: G = DiGraph({(0,0,'a'), DiGraph([(0,0,'a'), (0,0,'b'), (0,0,'c')})
(0,0,'c')])

Is there a way to change the labels after the creation? Because

sage: G.set_edge_label(0,0,'d')
Traceback (most recent call last):
...
RuntimeError: Cannot set edge label, since there are multiple edges from 0 to 0.

Vincent