Ask Your Question

Labeling in graphs

asked 2013-07-06 16:02:35 +0200

sanjith gravatar image

updated 2016-06-06 21:23:27 +0200

FrédéricC gravatar image

I am new to SAGE and am trying to experiment with it. What I am trying to do is something like this -

k = 1

G.add_edge((1,2), label= 'k')

Then it should label the edge as '1', not as 'k'. How would I do this?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2013-07-06 16:53:54 +0200

calc314 gravatar image

Try label=str(k).

edit flag offensive delete link more


Thank you, it works.

sanjith gravatar imagesanjith ( 2013-07-06 16:55:18 +0200 )edit

@sanjith - if the answer works, please do click the acceptance check mark :)

kcrisman gravatar imagekcrisman ( 2013-07-06 22:13:28 +0200 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2013-07-06 16:02:35 +0200

Seen: 496 times

Last updated: Jul 06 '13