discrete

143 days ago by mihilranathunga

G = Graph({"a":["b","e"],"b":["a","c","e"],"c":["b","d"],"d":["c","e"],"e":["a","b","d"]}) 
       
       
Graph on 5 vertices
Graph on 5 vertices
G.vertices() 
       
['a', 'b', 'c', 'd', 'e']
['a', 'b', 'c', 'd', 'e']
G.edges(labels=false) 
       
[('a', 'b'), ('a', 'e'), ('b', 'c'), ('b', 'e'), ('c', 'd'), ('d', 'e')]
[('a', 'b'), ('a', 'e'), ('b', 'c'), ('b', 'e'), ('c', 'd'), ('d', 'e')]
G.neighbors("a") 
       
['b', 'e']
['b', 'e']