- if(compute_dp_ranks()) {
- // Here the distance_from_source field of every vertex is the
- // number of DP iterations needed to update it. Hence we only have
- // to process the vertex in that order.
- for(int v = 0; v < _nb_vertices; v++) { _dp_order[v] = &_vertices[v]; }
- qsort(_dp_order, _nb_vertices, sizeof(Vertex *), compare_vertex);
- } else {
- cerr << __FILE__ << ": This graph is not a DAG." << endl;
- abort();
- }
+ compute_dp_ranks();
+ for(int v = 0; v < _nb_vertices; v++) { _dp_order[v] = &_vertices[v]; }
+ qsort(_dp_order, _nb_vertices, sizeof(Vertex *), compare_vertices_on_distance);