Ask Your Question
0

Graph with partial edge labelling

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

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 09:24:58 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

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

tmonteil gravatar image

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

@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 09:04:43 +0200

Seen: 236 times

Last updated: Oct 10 '18