def setUp(self) -> None: graph_file_path1 = 'src/ds/graph_subject/data/g3.txt' graph_file_path2 = 'src/ds/graph_subject/data/g4.txt' self.test_adj_matrix1 = bipartition_detection.BiPartitionDetection( adj_matrix.AdjMatrix(graph_file_path1)) self.test_adj_matrix2 = bipartition_detection.BiPartitionDetection( adj_matrix.AdjMatrix(graph_file_path2)) self.test_adj_set1 = bipartition_detection.BiPartitionDetection( my_adj_set.MyAdjSet(graph_file_path1)) self.test_adj_set2 = bipartition_detection.BiPartitionDetection( my_adj_set.MyAdjSet(graph_file_path2))
def setUp(self) -> None: graph_file_path1 = 'src/ds/graph_subject/data/g2.txt' graph_file_path2 = 'src/ds/graph_subject/data/g3.txt' self.test_adj_matrix1 = cycle_detection.CycleDetection( adj_matrix.AdjMatrix(graph_file_path1)) self.test_adj_matrix2 = cycle_detection.CycleDetection( adj_matrix.AdjMatrix(graph_file_path2)) self.test_adj_set1 = cycle_detection.CycleDetection( my_adj_set.MyAdjSet(graph_file_path1)) self.test_adj_set2 = cycle_detection.CycleDetection( my_adj_set.MyAdjSet(graph_file_path2))
def setUp(self) -> None: self.test_adj_matrix1 = is_tree.IsTree( adj_matrix.AdjMatrix('src/ds/graph_subject/data/g2.txt') ) self.test_adj_matrix2 = is_tree.IsTree( adj_matrix.AdjMatrix('src/ds/graph_subject/data/g3.txt') ) self.test_adj_set1 = is_tree.IsTree( my_adj_set.MyAdjSet('src/ds/graph_subject/data/g2.txt') ) self.test_adj_set2 = is_tree.IsTree( my_adj_set.MyAdjSet('src/ds/graph_subject/data/g3.txt') )
def setUp(self) -> None: self.source = 0 # 源设为0 self.test_adj_matrix = all_pairs_path.AllPairPath( adj_matrix.AdjMatrix('src/ds/graph_subject/data/g2.txt'), ) # 由于接口统一,直接用就完事了,但是注意此时时间复杂度为O(V^2),而不是O(V+E) self.test_adj_set = all_pairs_path.AllPairPath( my_adj_set.MyAdjSet('src/ds/graph_subject/data/g2.txt'), )
def setUp(self) -> None: source = 0 # 源设为0 self.test_adj_matrix = single_source_path.SingleSourcePath( adj_matrix.AdjMatrix('src/ds/graph_subject/data/g2.txt'), source ) self.test_adj_set = single_source_path.SingleSourcePath( my_adj_set.MyAdjSet('src/ds/graph_subject/data/g2.txt'), source )
def setUp(self) -> None: graph_file_path = 'src/ds/graph_subject/data/g5.txt' self.test_adj_matrix = graph_bfs.GraphBfs( adj_matrix.AdjMatrix(graph_file_path) ) self.test_adj_set = graph_bfs.GraphBfs( my_adj_set.MyAdjSet(graph_file_path) )
def setUp(self) -> None: graph_file_path = 'src/ds/graph_subject/data/g5.txt' source = 0 # 源设为0 self.test_adj_matrix = usss_path.USSSPath( adj_matrix.AdjMatrix(graph_file_path), source ) self.test_adj_set = usss_path.USSSPath( my_adj_set.MyAdjSet(graph_file_path), source )
def setUp(self) -> None: graph_file_path = 'src/ds/graph_subject/data/g2.txt' self.s_t = [(0, 6), (0, 1), (0, 5)] self.adj_matrix_processers = [] self.adj_set_processers = [] for st_item in self.s_t: self.adj_matrix_processers.append( path.Path(adj_matrix.AdjMatrix(graph_file_path), *st_item), ) self.adj_set_processers.append( path.Path(my_adj_set.MyAdjSet(graph_file_path), *st_item))
def setUp(self) -> None: self.test_adj_matrix = graph_dfs.GraphDfs( adj_matrix.AdjMatrix('src/ds/graph_subject/data/g2.txt') ) # 由于接口统一,直接用就完事了,但是注意此时时间复杂度为O(V^2),而不是O(V+E) self.test_adj_set = graph_dfs.GraphDfs( my_adj_set.MyAdjSet('src/ds/graph_subject/data/g2.txt'))
def setUp(self) -> None: graph_file_Path = 'src/ds/graph_subject/data/g2.txt' self.test_adj_matrix = cc.CC(adj_matrix.AdjMatrix(graph_file_Path)) self.test_adj_set = cc.CC(my_adj_set.MyAdjSet(graph_file_Path))