test_asteroidal.py 502 B

1234567891011121314151617181920212223
  1. import networkx as nx
  2. def test_is_at_free():
  3. is_at_free = nx.asteroidal.is_at_free
  4. cycle = nx.cycle_graph(6)
  5. assert not is_at_free(cycle)
  6. path = nx.path_graph(6)
  7. assert is_at_free(path)
  8. small_graph = nx.complete_graph(2)
  9. assert is_at_free(small_graph)
  10. petersen = nx.petersen_graph()
  11. assert not is_at_free(petersen)
  12. clique = nx.complete_graph(6)
  13. assert is_at_free(clique)
  14. line_clique = nx.line_graph(clique)
  15. assert not is_at_free(line_clique)