Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. G = Graph({
  2. 1 : [2,5],
  3. 2 : [3,6],
  4. 3 : [4],
  5. 4 : [5],
  6. 5 : [1,6],
  7. 6 : [2,7],
  8. 8 : [1]
  9. })
  10. G.is_planar()
  11. G.complement().is_planar()
  12.  
  13. D = Graph({
  14. 1 : [10,6],
  15. 2 : [9,11,5],
  16. 3 : [8,10,12],
  17. 4 : [7,11],
  18. 5 : [2,10,14],
  19. 6 : [1,9,15,13],
  20. 7 : [4,12,14,16],
  21. 8 : [3,11,15],
  22. 9 : [2,6,14],
  23. 10 : [1,3,5,13],
  24. 11 : [4,2,8,16],
  25. 12 : [3,7,15],
  26. 13 : [6,10],
  27. 14 : [5,7,9],
  28. 15 : [8,6,12],
  29. 16 : [7,11]
  30. })
  31.  
  32. for v in range(1,16+1):
  33. DD = D.copy()
  34. DD.delete_vertex(v)
  35. print(DD.is_connected())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement