Added check for independent nodes
This commit is contained in:
parent
b5dcbcc051
commit
f0416488c1
@ -13,7 +13,7 @@ notifications:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
- "5.16"
|
- "5.16.5-debug.0"
|
||||||
# enable building tags
|
# enable building tags
|
||||||
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "osrm",
|
"name": "osrm",
|
||||||
"version": "5.16.5",
|
"version": "5.16.5-debug.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
|
"description": "The Open Source Routing Machine is a high performance routing engine written in C++14 designed to run on OpenStreetMap data.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@ -671,6 +671,14 @@ std::vector<bool> contractGraph(ContractorGraph &graph,
|
|||||||
stable_partition(remaining_nodes.begin(),
|
stable_partition(remaining_nodes.begin(),
|
||||||
remaining_nodes.end(),
|
remaining_nodes.end(),
|
||||||
[](RemainingNodeData node_data) { return !node_data.is_independent; });
|
[](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 =
|
auto begin_independent_nodes_idx =
|
||||||
std::distance(remaining_nodes.begin(), begin_independent_nodes);
|
std::distance(remaining_nodes.begin(), begin_independent_nodes);
|
||||||
auto end_independent_nodes_idx = remaining_nodes.size();
|
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()
|
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
|
/* comment out renumbering and observe if memory spike still happens
|
||||||
node_data.Renumber(new_to_old_node_id);
|
node_data.Renumber(new_to_old_node_id);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user