def testDfsComponentsWeighted(self): self.assertEqual([{0, 1, 2, 3, 4, 5}], dfs_components(self.graph_weighed))
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))