def test_cycle_graph(self):
        """Tests that the cycle graph on five vertices is strongly
        regular.

        """
        G = nx.cycle_graph(5)
        assert_true(is_strongly_regular(G))
Exemple #2
0
    def test_cycle_graph(self):
        """TestData that the cycle graph on five vertices is strongly
        regular.

        """
        G = nx.cycle_graph(5)
        assert is_strongly_regular(G)
Exemple #3
0
def print_is_of_type_attrs(graph):
	print("\n====== is of type X? ======")
	print("Directed? ->", "Yes" if nx.is_directed(graph) else "No")
	print("Directed acyclic? ->", "Yes" if nx.is_directed_acyclic_graph(graph) else "No")
	print("Weighted? ->", "Yes" if nx.is_weighted(graph) else "No")

	if nx.is_directed(graph):
		print("Aperiodic? ->", "Yes" if nx.is_aperiodic(graph) else "No")
		print("Arborescence? ->", "Yes" if nx.is_arborescence(graph) else "No")
		print("Weakly Connected? ->", "Yes" if nx.is_weakly_connected(graph) else "No")
		print("Semi Connected? ->", "Yes" if nx.is_semiconnected(graph) else "No")
		print("Strongly Connected? ->", "Yes" if nx.is_strongly_connected(graph) else "No")

	else:
		print("Connected? ->", "Yes" if nx.is_connected(graph) else "No")		
		print("Bi-connected? ->", "Yes" if nx.is_biconnected(graph) else "No")
		if not graph.is_multigraph():
			print("Chordal? -> ", "Yes" if nx.is_chordal(graph) else "No")
			print("Forest? -> ", "Yes" if nx.is_chordal(graph) else "No")

	print("Distance regular? -> ", "Yes" if nx.is_distance_regular(graph) else "No")
	print("Eulerian? -> ", "Yes" if nx.is_eulerian(graph) else "No")
	print("Strongly regular? -> ", "Yes" if nx.is_strongly_regular(graph) else "No")
	print("Tree? -> ", "Yes" if nx.is_tree(graph) else "No")
 def test_path_graph(self):
     """Tests that the path graph is not strongly regular."""
     G = nx.path_graph(4)
     assert_false(is_strongly_regular(G))
 def test_petersen_graph(self):
     """Tests that the Petersen graph is strongly regular."""
     G = nx.petersen_graph()
     assert_true(is_strongly_regular(G))
Exemple #6
0
 def test_path_graph(self):
     """TestData that the path graph is not strongly regular."""
     G = nx.path_graph(4)
     assert not is_strongly_regular(G)
Exemple #7
0
 def test_petersen_graph(self):
     """TestData that the Petersen graph is strongly regular."""
     G = nx.petersen_graph()
     assert is_strongly_regular(G)