コード例 #1
0
ファイル: test_cliques.py プロジェクト: ynasser/rosemary
    def setUp(self):
        self.petersen_graph = petersen_graph()
        self.random_graph10_5 = random_graph(10, 0.5)
        self.random_graph100_3 = random_graph(100, 0.3)

        self.petersen_cliques = [
            [0, 1], [0, 4], [0, 5], [1, 2], [1, 6],
            [2, 3], [2, 7], [3, 4], [3, 8], [4, 9],
            [5, 7], [5, 8], [6, 8], [6, 9], [7, 9],
        ]

        self.random_graph_edges = [
            (0, 2), (0, 3), (0, 5), (0, 7),
            (0, 9), (1, 2), (1, 3), (1, 5),
            (1, 6), (1, 7), (1, 9), (2, 3),
            (2, 5), (2, 6), (2, 7), (2, 8),
            (3, 5), (3, 7), (4, 6), (4, 7),
            (5, 6), (5, 7), (5, 9), (6, 7),
            (6, 8), (6, 9), (7, 9),
        ]

        self.random_graph = Graph()
        self.random_graph.add_edges(self.random_graph_edges)
        self.random_graph_clique = [0, 2, 3, 5, 7]

        self.coprime_graph10 = coprime_pairs_graph(10)
        self.coprime_graph10_weight = 30
        self.coprime_graph10_clique = [1, 5, 7, 8, 9]

        self.coprime_graph100 = coprime_pairs_graph(100)
        self.coprime_graph100_weight = 1356
        self.coprime_graph100_clique = [
            1, 17, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61,
            67, 71, 73, 79, 81, 83, 88, 89, 91, 95, 97,
        ]
コード例 #2
0
    def setUp(self):
        self.petersen_graph = petersen_graph()
        self.petersen_colors = 3

        self.coprime_graph30 = coprime_pairs_graph(30)
        self.coprime_graph30_colors = 11

        graph = Graph()
        graph.add_edges([(0, 2), (0, 4), (0, 5), (0, 8), (1, 3), (1, 4), (2, 6), (2, 8), (3, 4), (3, 7), (4, 6), (4, 7),
                         (4, 9), (5, 8)])
        self.small_random = graph
        self.small_colors = 3
        self.small_classes = [[4, 8], [0, 3, 6, 9], [1, 2, 5, 7]]

        graph = Graph()
        graph.add_edges([(0, 4), (0, 6), (1, 2), (1, 4), (1, 8), (1, 9), (2, 3), (2, 4), (3, 5), (3, 7), (4, 6), (4, 8),
                         (4, 9), (5, 7), (5, 9), (6, 8), (7, 8)])
        self.small_random2 = graph
        self.small_colors2 = 4
        self.small_classes2 = [[4, 7], [0, 2, 8, 9], [1, 5, 6], [3]]

        graph = Graph()
        graph.add_edges([(0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 7), (0, 8), (0, 9), (0, 10), (0, 11), (0, 12),
                         (0, 13), (0, 14), (0, 15), (0, 16), (0, 17), (0, 18), (0, 19), (1, 2), (1, 3), (1, 4), (1, 5),
                         (1, 6), (1, 7), (1, 8), (1, 9), (1, 10), (1, 12), (1, 14), (1, 15), (1, 17), (1, 18), (1, 19),
                         (2, 4), (2, 5), (2, 6), (2, 7), (2, 8), (2, 9), (2, 11), (2, 12), (2, 13), (2, 14), (2, 15),
                         (2, 17), (2, 18), (2, 19), (3, 4), (3, 5), (3, 6), (3, 7), (3, 8), (3, 9), (3, 10), (3, 11),
                         (3, 12), (3, 14), (3, 15), (3, 16), (3, 17), (3, 18), (4, 5), (4, 6), (4, 7), (4, 9), (4, 10),
                         (4, 11), (4, 13), (4, 14), (4, 15), (4, 16), (4, 17), (4, 18), (4, 19), (5, 6), (5, 7), (5, 9),
                         (5, 10), (5, 13), (5, 14), (5, 15), (5, 17), (5, 19), (6, 8), (6, 9), (6, 10), (6, 11),
                         (6, 12), (6, 13), (6, 14), (6, 15), (6, 16), (6, 17), (6, 19), (7, 8), (7, 9), (7, 12),
                         (7, 15), (7, 16), (7, 17), (7, 19), (8, 9), (8, 10), (8, 11), (8, 12), (8, 13), (8, 14),
                         (8, 16), (8, 17), (8, 18), (8, 19), (9, 10), (9, 11), (9, 14), (9, 17), (9, 18), (9, 19),
                         (10, 11), (10, 12), (10, 13), (10, 15), (10, 16), (10, 17), (10, 18), (10, 19), (11, 12),
                         (11, 13), (11, 14), (11, 15), (11, 16), (11, 17), (11, 18), (11, 19), (12, 13), (12, 14),
                         (12, 15), (12, 16), (12, 17), (12, 18), (12, 19), (13, 14), (13, 15), (13, 16), (13, 17),
                         (13, 18), (13, 19), (14, 16), (14, 17), (14, 18), (15, 17), (15, 19), (16, 18), (16, 19),
                         (17, 18), (18, 19)])
        self.big_random = graph
        self.big_colors = 10
        self.big_classes = [[0, 6], [17, 19], [4, 8], [5, 11], [7, 10, 14], [2, 3], [15, 18], [9, 12], [1, 16], [13]]
コード例 #3
0
ファイル: test_cliques.py プロジェクト: fagan2888/rosemary
    def setUp(self):
        self.petersen_graph = petersen_graph()
        self.random_graph10_5 = random_graph(10, 0.5)
        self.random_graph100_3 = random_graph(100, 0.3)

        self.petersen_cliques = [
            [0, 1],
            [0, 4],
            [0, 5],
            [1, 2],
            [1, 6],
            [2, 3],
            [2, 7],
            [3, 4],
            [3, 8],
            [4, 9],
            [5, 7],
            [5, 8],
            [6, 8],
            [6, 9],
            [7, 9],
        ]

        self.random_graph_edges = [
            (0, 2),
            (0, 3),
            (0, 5),
            (0, 7),
            (0, 9),
            (1, 2),
            (1, 3),
            (1, 5),
            (1, 6),
            (1, 7),
            (1, 9),
            (2, 3),
            (2, 5),
            (2, 6),
            (2, 7),
            (2, 8),
            (3, 5),
            (3, 7),
            (4, 6),
            (4, 7),
            (5, 6),
            (5, 7),
            (5, 9),
            (6, 7),
            (6, 8),
            (6, 9),
            (7, 9),
        ]

        self.random_graph = Graph()
        self.random_graph.add_edges(self.random_graph_edges)
        self.random_graph_clique = [0, 2, 3, 5, 7]
        self.random_graph_clique2 = [1, 5, 6, 7, 9]

        self.coprime_graph10 = coprime_pairs_graph(10)
        self.coprime_graph10_weight = 30
        self.coprime_graph10_clique = [1, 5, 7, 8, 9]

        self.coprime_graph100 = coprime_pairs_graph(100)
        self.coprime_graph100_weight = 1356
        self.coprime_graph100_clique = [
            1,
            17,
            23,
            29,
            31,
            37,
            41,
            43,
            47,
            53,
            59,
            61,
            67,
            71,
            73,
            79,
            81,
            83,
            88,
            89,
            91,
            95,
            97,
        ]