def testDfsComponentsWeighted(self):
     self.assertEqual([{0, 1, 2, 3, 4, 5}], dfs_components(self.graph_weighed))
Exemple #2
0
def main():
    with open('input.txt', 'r') as f:
        data = f.read()
    graph = parse_graph_from_input(data)
    print dfs_components(graph)
 def testDfsComponentsBasic(self):
     self.assertEqual([{0, 1, 2, 3}, {4}, {5, 6}], dfs_components(self.graph_basic))