Ask Your Question
-1

Write a code for a tree on 9 vertices given in the set {0,1,2,3,4,5,6,7,8} and the edge set of that tree is {(6,1),(1,5),(5,0),(5,3),(3,2),(3,8),(8,4),(8,7)}.

asked 7 years ago

rewi gravatar image

Write a code for a tree on 9 vertices given in the set {0,1,2,3,4,5,6,7,8} and the edge set of that tree is {(6,1),(1,5),(5,0),(5,3),(3,2),(3,8),(8,4),(8,7)}.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 7 years ago

rewi gravatar image

G = graphs.EmptyGraph()

G.add_edges([(6,1),(1,5),(5,0),(5,3),(3,2),(3,8),(8,4),(8,7)])

G.show()

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

Seen: 334 times

Last updated: Aug 28 '17