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

Generation of inefficient MLD partitions #6084

Closed
mjjbell opened this issue Jul 17, 2021 · 1 comment · Fixed by #6085
Closed

Generation of inefficient MLD partitions #6084

mjjbell opened this issue Jul 17, 2021 · 1 comment · Fixed by #6085

Comments

@mjjbell
Copy link
Member

mjjbell commented Jul 17, 2021

Issue

As discovered by @zhudelong, the mapping from node-based edges to edge-based nodes (osrm.cnbg_to_ebg) does not include the duplicate nodes used to represent turn restrictions.

The MLD partitioner uses this mapping to assign nodes to a partition. Duplicate restriction nodes are not assigned, and end up in a special "invalid" partition.

// Partition ids, keyed by edge based graph nodes
std::vector<NodeID> edge_based_partition_ids(edge_based_graph.GetNumberOfNodes(),
SPECIAL_NODEID);
// Only resolve all easy cases in the first pass
for (const auto &entry : mapping)
{
const auto u = entry.u;
const auto v = entry.v;
const auto forward_node = entry.forward_ebg_node;
const auto backward_node = entry.backward_ebg_node;
// This heuristic strategy seems to work best, even beating chosing the minimum
// border edge bisection ID
edge_based_partition_ids[forward_node] = node_based_partition_ids[u];
if (backward_node != SPECIAL_NODEID)
edge_based_partition_ids[backward_node] = node_based_partition_ids[v];
}

This special partition will break the spatial properties of the multi-level hierarchy - the partition and its super levels will have a large number of border nodes and very few internal paths between them. This will bloat the hierarchy and make queries slower due to reduced data locality.

This issue will have existed since via way restriction support was added in #4255, but will have become more prominent with the support of multi-via way restrictions in #5907.

Fix

As osrm.cnbg_to_ebg is only used by the MLD partitioner, this can be fixed by simply including the duplicate restriction nodes in the mapping.

@zhudelong
Copy link

Nice work, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants