コード例 #1
0
 def test_dfs_4(self):
     for g in self.graph_2s:
         self.assertEqual([
             graph.Edge(graph.Node(0), graph.Node(1), 4),
             graph.Edge(graph.Node(1), graph.Node(2), 7),
             graph.Edge(graph.Node(2), graph.Node(5), 2)
         ], searches.dfs(g, graph.Node(0), graph.Node(5)))
コード例 #2
0
 def test_dfs_3(self):
     for g in self.graph_1s:
         self.assertEqual([
             graph.Edge(graph.Node(1), graph.Node(2), 1),
             graph.Edge(graph.Node(2), graph.Node(4), 1),
             graph.Edge(graph.Node(4), graph.Node(5), 1)
         ], searches.dfs(g, graph.Node(1), graph.Node(5)))