Added check for independent nodes

This commit is contained in:
Michael Krasnyk 2018-04-11 13:14:18 +02:00
parent b5dcbcc051
commit f0416488c1
No known key found for this signature in database
GPG Key ID: 49C12AD0F43D2108
3 changed files with 12 additions and 3 deletions

View File

@ -13,7 +13,7 @@ notifications:
branches:
only:
- master
- "5.16"
- "5.16.5-debug.0"
# enable building tags
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/

View File

@ -1,6 +1,6 @@
{
"name": "osrm",
"version": "5.16.5",
"version": "5.16.5-debug.0",
"private": false,
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
"dependencies": {

View File

@ -671,6 +671,14 @@ std::vector<bool> contractGraph(ContractorGraph &graph,
stable_partition(remaining_nodes.begin(),
remaining_nodes.end(),
[](RemainingNodeData node_data) { return !node_data.is_independent; });
if (begin_independent_nodes == remaining_nodes.end())
{
util::Log() << "No independent node found in " << remaining_nodes.size()
<< " remaining nodes";
break;
}
auto begin_independent_nodes_idx =
std::distance(remaining_nodes.begin(), begin_independent_nodes);
auto end_independent_nodes_idx = remaining_nodes.size();
@ -761,7 +769,8 @@ std::vector<bool> contractGraph(ContractorGraph &graph,
}
util::Log() << "Contracted graph has " << graph.GetNumberOfEdges()
<< " thus far, with an edge list of (" << (graph.GetNumberOfEdges() * sizeof(ContractorEdge)) << " bytes)";
<< " thus far, with an edge list of ("
<< (graph.GetNumberOfEdges() * sizeof(ContractorEdge)) << " bytes)";
/* comment out renumbering and observe if memory spike still happens
node_data.Renumber(new_to_old_node_id);