Guest User

Untitled

a guest
May 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. all(len(G.longest_path(v)) == len(G) for v in G.vertices())
  2.  
  3. def homtrac_orbits(g):
  4. orbits = g.automorphism_group(return_group=False, orbits=True)
  5. n = len(g)
  6. return all(len(g.longest_path(o[0])) == n for o in orbits)
  7.  
  8. def ptfnh(G):
  9. """Graph property: planar, triangle-free, non-hamiltonian.
  10.  
  11. If G has the property, then any subgraph obtained by deleting one edge also has it,
  12. so this may be used with the Sage graphs generator.
  13. """
  14. return G.is_planar() and G.is_triangle_free() and not G.is_hamiltonian()
  15.  
  16. for n in range(5, 12):
  17. totct = 0
  18. for G in graphs(n, ptfnh):
  19. if not G.is_connected():
  20. continue
  21. totct += 1
  22. if homtrac_orbits(G):
  23. print G.to_dictionary()
  24. print n, ':', totct, 'planar connected triangle-free non-hamiltonian graphs'
  25.  
  26. 5 : 5 planar connected triangle-free non-hamiltonian graphs
  27. 6 : 15 planar connected triangle-free non-hamiltonian graphs
  28. 7 : 51 planar connected triangle-free non-hamiltonian graphs
  29. 8 : 210 planar connected triangle-free non-hamiltonian graphs
  30. 9 : 1006 planar connected triangle-free non-hamiltonian graphs
  31. 10 : 5831 planar connected triangle-free non-hamiltonian graphs
  32. 11 : 39210 planar connected triangle-free non-hamiltonian graphs
Add Comment
Please, Sign In to add comment