We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48554f5 commit 218a8cfCopy full SHA for 218a8cf
test/testshortestpath.jl
@@ -66,4 +66,36 @@
66
end
67
68
69
+
70
+ @testset "Simple Problem - Two way connections" begin
71
+ problem = ShortestPathProblem(
72
+ Connection[
73
+ Connection(1, 2, 4), #1
74
+ Connection(1, 3, 15), #2
75
76
+ # Two way connection
77
+ Connection(2, 3, 2), #3
78
+ Connection(3, 2, 3), #4
79
80
+ Connection(2, 4, 15), #5
81
+ Connection(3, 4, 6), #6
82
+ ]
83
+ )
84
85
+ # Shortest path: 1 -> 2 -> 3 -> 4
86
+ CorrectShortestPath = [
87
+ problem.connections[1],
88
+ problem.connections[3],
89
+ problem.connections[6]]
90
91
+ result = solve(problem)
92
93
+ @test result isa ShortestPathResult
94
+ @test result.cost == 12.0
95
96
+ for element in result.path
97
+ @test element in CorrectShortestPath
98
+ end
99
100
101
0 commit comments