Ask Your Question
0

Graph with partial edge labelling

asked 2018-10-10 02:04:43 -0600

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

Comments

1

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

rburing gravatar imagerburing ( 2018-10-10 02:24:58 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-10-10 09:32:08 -0600

tmonteil gravatar image

updated 2018-10-10 09:33:35 -0600

@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

Stats

Asked: 2018-10-10 02:04:43 -0600

Seen: 40 times

Last updated: Oct 10