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 22
33 <PropertyGroup >
44 <TargetFrameworks >netstandard1.3;net40</TargetFrameworks >
5- <Version >1.0.7 </Version >
5+ <Version >1.0.8 </Version >
66 <Authors >Mateusz Mazurek</Authors >
77 <Company />
88 <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 ;
24using Dijkstra . NET . Model ;
35using Dijkstra . NET . ShortestPath ;
46
@@ -19,6 +21,19 @@ static void Main(string[] args)
1921 IShortestPathResult result = dijkstra . Process ( 0 , 1 ) ; //result contains the shortest path
2022
2123 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+ }
2237 }
2338 }
2439}
You can’t perform that action at this time.
0 commit comments