Skip to content

Commit

Permalink
Fix incorrect distance calculation for ComputeDense (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryBubelnikSoftSmile authored Aug 17, 2023
1 parent 922f968 commit 16f4f82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/DijkstraGraphDistance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ protected void Compute_Dense()
{
while (DenseQueue.Count > 0) {
float idx_priority = DenseQueue.FirstPriority;
max_value = Math.Max(idx_priority, max_value);
int idx = DenseQueue.Dequeue();
GraphNodeStruct g = DenseNodes[idx];
g.frozen = true;
if (TrackOrder)
order.Add(g.id);
g.distance = max_value;
DenseNodes[idx] = g;
max_value = Math.Max(idx_priority, max_value);
update_neighbours_dense(g.id);
}
}
Expand Down Expand Up @@ -584,4 +584,4 @@ void update_neighbours_dense(int parent_id)


}
}
}

0 comments on commit 16f4f82

Please sign in to comment.