Skip to content
Snippets Groups Projects
Commit 4beec299 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

If the end node is not reachable, it return the maximum cost.

parent da458e35
No related branches found
No related tags found
1 merge request!2Solved a bug when creating a new geometry object: the sale factor is...
......@@ -106,6 +106,8 @@ double CDijkstra::find_shortest_path(Eigen::MatrixXd &graph,unsigned int start_n
d2=new_d2;
}
path.clear();
if(w(1,end_node)==w(w.rows()-1,end_node) && w(1,end_node)==std::numeric_limits<double>::max()/2.0)
return std::numeric_limits<double>::max()/2.0;
if(end_node==start_node)
path.push_back(0);
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment