File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 9292 * var shortestDist = dijkstra(0, 2, distMatrix); // 9
9393 */
9494 return function ( src , dest , graph ) {
95- var tempDistance = 0 ;
95+ var tempDistance = 0 ;
9696 init ( src , graph ) ;
9797 while ( current . node !== dest && isFinite ( current . distance ) ) {
9898 for ( var i = 0 ; i < graph . length ; i += 1 ) {
9999 if ( current . node !== i && //if it's not the current node
100100 ! visited [ i ] && //and if we haven't visited this node
101101 //and this node is sibling of the current...
102102 Number . isFinite ( graph [ i ] [ current . node ] ) ) {
103-
103+
104104 tempDistance = current . distance + graph [ i ] [ current . node ] ;
105105 if ( tempDistance < distance [ i ] . distance ) {
106106 distance [ i ] . distance = tempDistance ;
107- current . distance = tempDistance ;
108107 unvisited . update ( current ) ;
109108 }
110109 }
You can’t perform that action at this time.
0 commit comments