Ask Your Question
0

Graph with partial edge labelling

asked 6 years ago

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

Preview: (hide)

Comments

1

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

rburing gravatar imagerburing ( 6 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 6 years ago

tmonteil gravatar image

updated 6 years ago

@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,'')
Preview: (hide)
link

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: 6 years ago

Seen: 306 times

Last updated: Oct 10 '18