@@ -31,35 +31,5 @@ public static ShortestPathResult Dijkstra<T, TEdgeCustom>(this IGraph<T, TEdgeCu
3131 {
3232 return ShortestPath . Dijkstra . GetShortestPath ( graph , from , to , depth ) ;
3333 }
34-
35- /// <summary>
36- /// Get path from @from to @to
37- /// </summary>
38- /// <param name="graph">Source graph</param>
39- /// <param name="from">Start node</param>
40- /// <param name="to">End node</param>
41- /// <returns>Value with path</returns>
42- public static ShortestPathResult DijkstraBinary < T , TEdgeCustom > ( this IGraph < T , TEdgeCustom > graph , uint from , uint to )
43- where TEdgeCustom : IEquatable < TEdgeCustom > => DijkstraBinary ( graph , from , to , Int32 . MaxValue ) ;
44-
45- /// <summary>
46- /// Get path from @from to @to
47- /// </summary>
48- /// <param name="graph">Source graph</param>
49- /// <param name="from">Start node</param>
50- /// <param name="to">End node</param>
51- /// <param name="depth">Depth of path</param>
52- /// <returns>Value with path</returns>
53- public static ShortestPathResult DijkstraBinary < T , TEdgeCustom > ( this IGraph < T , TEdgeCustom > graph , uint from , uint to ,
54- int depth )
55- where TEdgeCustom : IEquatable < TEdgeCustom >
56- {
57- var p1 = Task . Factory . StartNew ( ( ) => ShortestPath . Dijkstra . GetShortestPath ( graph , from , to , depth , 2 , 0 ) ) ;
58- var p2 = Task . Factory . StartNew ( ( ) => ShortestPath . Dijkstra . GetShortestPath ( graph , from , to , depth , 2 , 1 ) ) ;
59-
60- Task . WaitAll ( p1 , p2 ) ;
61-
62- return p1 . Result . Distance < p2 . Result . Distance ? p1 . Result : p2 . Result ;
63- }
6434 }
6535}
0 commit comments