Exemplo n.º 1
0
 def runTest(self):
     mg = MyGraph(dart_partitions=[[[1, 2, 3], [4, 5, 6], [
         7, 8, 9
     ], [10, 11, 12]], [[1, 4], [2, 7], [3, 10], [5, 8], [6, 11], [9, 12]]])
     mg = MyGraph(graphs.CompleteGraph(4).edges())
     res = OrientedRotationSystem.from_mygraph(mg)
     self.assertEqual(len(res), 1)
Exemplo n.º 2
0
    def runTest(self):
        g = graphs.CompleteGraph(5)
        g.delete_edge(0, 1)
        g.delete_edge(0, 2)
        mg = MyGraph(g.edges())

        g_coll = GraphCollection('../graphs4.json')
        ors_coll = ORSCollection('../ors4.json')

        res = OrientedRotationSystem.inductive_from_mygraph(
            mg, g_coll, ors_coll)
        nonind = OrientedRotationSystem.from_mygraph(mg)

        self.assertEqual(len(res), len(nonind))
Exemplo n.º 3
0
            not_in_inertia.update([(curr_y, i)
                                   for i in range(new_x + 1, curr_x)])
        curr_x, curr_y = new_x, new_y
    return not_in_inertia


def Zplus(G):
    return Z_pythonBitset(G, q=0)


from sage.all import Graph, graphs
G = Graph()
G.add_edges([[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 1], [1, 4], [2, 5],
             [3, 6], [7, 1], [7, 2], [7, 3]])

G2 = graphs.CompleteGraph(4)
G2.subdivide_edges(G2.edges(), 1)

from sage.all import points


def plot_inertia_lower_bound(g):
    return points(list(Zq_inertia_lower_bound(g)),
                  pointsize=40,
                  gridlines=True,
                  ticks=[range(g.order()), range(g.order())],
                  aspect_ratio=1)


"""
import cProfile as cp
Exemplo n.º 4
0
 def runTest(self):
     tri = MyGraph(**self.data["3-gon"])
     k4 = MyGraph(graphs.CompleteGraph(4))
     self.assertEqual(len(k4.subgraph_find(tri, first_match_only=False)),
                      24)
Exemplo n.º 5
0
 def XXXrunTest(self):
     g = graphs.CompleteGraph(4)
     l = OrientedRotationSystem.from_graph(g)
     for r in l:
         self.assertTrue(g.is_isomorphic(r.undirected_graph()))
Exemplo n.º 6
0
 def runTest(self):
     g = graphs.CompleteGraph(4)
     mg = MyGraph(g)
     mg = MyGraph(graphs.CompleteGraph(4).edges())
     res = OrientedRotationSystem.from_mygraph(mg)
     self.assertEqual(len(res), 1)
Exemplo n.º 7
0
 def XXXrunTest(self):
     g = graphs.CompleteGraph(4)
     l = OrientedRotationSystem.from_graph(g)
     self.assertEqual(len(l), 3)