File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
<PropertyGroup >
4
4
<TargetFrameworks >netstandard1.3;net40</TargetFrameworks >
5
- <Version >1.0.7 </Version >
5
+ <Version >1.0.8 </Version >
6
6
<Authors >Mateusz Mazurek</Authors >
7
7
<Company />
8
8
<Description >High performance the shortest path in directed graph with non negative weights algorithm implementation.</Description >
Original file line number Diff line number Diff line change 1
- using Dijkstra . NET . Contract ;
1
+ using System ;
2
+ using System . Linq ;
3
+ using Dijkstra . NET . Contract ;
2
4
using Dijkstra . NET . Model ;
3
5
using Dijkstra . NET . ShortestPath ;
4
6
@@ -19,6 +21,19 @@ static void Main(string[] args)
19
21
IShortestPathResult result = dijkstra . Process ( 0 , 1 ) ; //result contains the shortest path
20
22
21
23
var path = result . GetPath ( ) ;
24
+
25
+ graph . Reset ( ) ;
26
+
27
+ var bfs = new BfsParallel < int , string > ( graph ) ;
28
+
29
+ IShortestPathResult bfsResult = bfs . Process ( 0 , 1 ) ;
30
+
31
+ var bfsPath = bfsResult . GetPath ( ) ;
32
+
33
+ if ( ! bfsPath . SequenceEqual ( path ) )
34
+ {
35
+ throw new Exception ( "The path should be the same." ) ;
36
+ }
22
37
}
23
38
}
24
39
}
You can’t perform that action at this time.
0 commit comments