Example #1
0
 def cyclic_graphs(self, max_nodes):
     graph_list = []
     for n in range(8, max_nodes + 1):
         g = cycle_graph(n)
         g.name = 'C{}'.format(n)
         graph_list.append(g)
     return graph_list
Example #2
0
 def test_k_factor_trivial(self):
     g = gen.cycle_graph(4)
     f = reg.k_factor(g, 2)
     assert g.edges == f.edges
Example #3
0
 def test_is_k_regular1(self):
     g = gen.cycle_graph(4)
     assert reg.is_k_regular(g, 2)
     assert not reg.is_k_regular(g, 3)
Example #4
0
 def test_is_regular1(self):
     g = gen.cycle_graph(4)
     assert reg.is_regular(g)
Example #5
0
 def test_pentamer(self):
     pent = cycle_graph(5)
     self.assertEqual(isomorphism_checker(pent), "G38")
Example #6
0
 def test_octomer(self):
     octamer = cycle_graph(8)
     self.assertEqual(
         isomorphism_checker(octamer, graph_list=self.graph_list), "C8")