Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- G = Graph({
- 1 : [2,5],
- 2 : [3,6],
- 3 : [4],
- 4 : [5],
- 5 : [1,6],
- 6 : [2,7],
- 8 : [1]
- })
- G.is_planar()
- G.complement().is_planar()
- D = Graph({
- 1 : [10,6],
- 2 : [9,11,5],
- 3 : [8,10,12],
- 4 : [7,11],
- 5 : [2,10,14],
- 6 : [1,9,15,13],
- 7 : [4,12,14,16],
- 8 : [3,11,15],
- 9 : [2,6,14],
- 10 : [1,3,5,13],
- 11 : [4,2,8,16],
- 12 : [3,7,15],
- 13 : [6,10],
- 14 : [5,7,9],
- 15 : [8,6,12],
- 16 : [7,11]
- })
- for v in range(1,16+1):
- DD = D.copy()
- DD.delete_vertex(v)
- print(DD.is_connected())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement