File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,17 @@ def sample_graph_2() -> list[list[int]]:
1717 [20 , 25 , 30 , 0 ],
1818 ]
1919
20+
2021def test_brute_force () -> None :
2122 graph = sample_graph_1 ()
2223 assert tsp_brute_force (graph ) == 64
2324
25+
2426def test_dp () -> None :
2527 graph = sample_graph_1 ()
2628 assert tsp_dp (graph ) == 64
2729
30+
2831def test_greedy () -> None :
2932 graph = sample_graph_1 ()
3033 # The greedy algorithm does not guarantee an optimal solution;
@@ -35,6 +38,7 @@ def test_greedy() -> None:
3538 assert isinstance (result , int )
3639 assert result >= 64
3740
41+
3842def test_dp_larger_graph () -> None :
3943 graph = sample_graph_2 ()
4044 assert tsp_dp (graph ) == 80
@@ -44,6 +48,7 @@ def test_brute_force_larger_graph() -> None:
4448 graph = sample_graph_2 ()
4549 assert tsp_brute_force (graph ) == 80
4650
51+
4752def test_greedy_larger_graph () -> None :
4853 graph = sample_graph_2 ()
4954 result = tsp_greedy (graph )
You can’t perform that action at this time.
0 commit comments