예제 #1
0
def main():
    with open('input.txt', 'r') as f:
        data = f.read()
    graph = parse_graph_from_input(data)
    print dfs_components(graph)
예제 #2
0
 def testParseGraphFromInput(self):
     self.assertEqual(self.graph_basic, parse_graph_from_input(self.graph_basic_data))
     self.assertEqual(self.graph_weighed, parse_graph_from_input(self.graph_weighed_data))