Ask Your Question

Graph with partial edge labelling

asked 2018-10-10 09:04:43 +0100

GA316 gravatar image

Hello all,

I need to draw a graph in which some edges are labelled and some edges are not. I know how to make all the edges labelled. But I need mixed edges (some are labelled and some are not).

Kindly help me with this.

Thank you

edit retag flag offensive close merge delete



Maybe label the "unlabeled" by '' (the empty string) instead of None?

rburing gravatar imagerburing ( 2018-10-10 09:24:58 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-10-10 16:32:08 +0100

tmonteil gravatar image

updated 2018-10-10 16:33:35 +0100

@rburing is right, replacing the None label with '' (the empty string) does the job. If you have a partially labelled graph G, and want to replace the None labels with '', you can do the following:

sage: for u,v,l in G.edges():
....:     if l is None:
....:         G.set_edge_label(u,v,'')
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-10-10 09:04:43 +0100

Seen: 231 times

Last updated: Oct 10 '18