}
new_front_size = 0;
- // We remove all vertex without incoming edge
+ // We remove all the vertices without incoming edge
for(int f = 0; f < front_size; f++) {
v = _front[f];
if(v->iteration == iteration) {
return front_size == 0;
}
-// This method does not change the edge occupation. It update
-// distance_from_source and pred_edge_toward_source.
+// This method does not change the edge occupation. It only set
+// properly for every vertex the fields distance_from_source and
+// pred_edge_toward_source.
+
void MTPGraph::find_shortest_path() {
Vertex **tmp_front;
int tmp_front_size;
// Let's be a bit paranoid
ASSERT(is_dag());
- // We use one iteration of find_shortest_path simply to propagate
- // the distance to make all the edge lengths positive.
+ // We use call find_shortest_path here to set properly the distance,
+ // so that we can make all the edge lengths positive at the first
+ // iteration.
find_shortest_path();
do {
total_length = 0.0;
- // Do we reach the _sink?
+ // Do we reach the sink?
if(_sink->pred_edge_toward_source) {
// If yes, compute the length of the best path
v = _sink;