Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generation of inefficient MLD partitions #6085

Merged
merged 1 commit into from
Sep 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
- FIXED: Allow for special characters in the profile/method as part of the HTTP URL. [#6090](https://github.com/Project-OSRM/osrm-backend/pull/6090)
- Build:
- CHANGED: Replace Travis with Github Actions for CI builds [#6071](https://github.com/Project-OSRM/osrm-backend/pull/6071)
- Routing:
- FIXED: Fix generation of inefficient MLD partitions [#6084](https://github.com/Project-OSRM/osrm-backend/pull/6084)

# 5.25.0
- Changes from 5.24.0
Expand Down
7 changes: 7 additions & 0 deletions src/extractor/edge_based_graph_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,13 @@ EdgeBasedGraphFactory::GenerateEdgeExpandedNodes(const WayRestrictionMap &way_re
m_edge_based_node_distances.push_back(
m_edge_based_node_distances[nbe_to_ebn_mapping[eid]]);

// Include duplicate nodes in cnbg to ebg mapping. This means a
// compressed node pair (u,v) can appear multiple times in this list.
// This is needed by the MLD partition step to ensure duplicate nodes
// are also assigned to partitions (the MLD partitioner is currently
// the only consumer of this mapping).
mapping.push_back(NBGToEBG{node_u, node_v, edge_based_node_id, SPECIAL_NODEID});

edge_based_node_id++;
progress.PrintStatus(progress_counter++);
}
Expand Down
4 changes: 4 additions & 0 deletions src/partitioner/partitioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ int Partitioner::Run(const PartitionerConfig &config)
edge_based_partition_ids[backward_node] = node_based_partition_ids[v];
}

BOOST_ASSERT(std::none_of(edge_based_partition_ids.begin(),
edge_based_partition_ids.end(),
[](auto x) { return x == SPECIAL_NODEID; }));

std::vector<Partition> partitions;
std::vector<std::uint32_t> level_to_num_cells;
std::tie(partitions, level_to_num_cells) =
Expand Down