-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Distances in MLD #5019
Distances in MLD #5019
Conversation
1beecb1
to
0e2092a
Compare
649e0af
to
5ebc145
Compare
1048bd3
to
1ac22d0
Compare
181486a
to
0470d55
Compare
d3d24b1
to
40c025c
Compare
e5598d7
to
ecf8016
Compare
@ghoshkaj @chaupow I have pushed a commit that contains some fixes for the branch:
|
2351bdc
to
8537df0
Compare
ran current branch and compared with CH numbers:
|
ran current branch and measured 25x25 requests
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some cleanup needs to be done.
@@ -21,6 +21,7 @@ Feature: Basic Distance Matrix | |||
| a | 0 | 100+-1 | | |||
| b | 100+-1 | 0 | | |||
|
|||
@ch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should capture why these tests only work on CH.
@@ -45,6 +46,7 @@ Feature: Basic Distance Matrix | |||
| c | | | 0 | 100+-1 | | |||
| d | | | 100+-1 | 0 | | |||
|
|||
@ch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
namespace | ||
{ | ||
struct NodeBucket | ||
{ | ||
NodeID middle_node; | ||
NodeID parent_node; | ||
bool from_clique_arc; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cam optimize the size here with bit packing:
unsigned column_index : 31;
unsigned from_clique_arc : 1;
@@ -351,6 +446,21 @@ UnpackedPath search(SearchEngineData<Algorithm> &engine_working_data, | |||
// Get packed path as edges {from node ID, to node ID, from_clique_arc} | |||
auto packed_path = retrievePackedPathFromHeap(forward_heap, reverse_heap, middle); | |||
|
|||
// if (!packed_path.empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is left-over debugging code and needs to be removed.
@@ -410,7 +520,96 @@ UnpackedPath search(SearchEngineData<Algorithm> &engine_working_data, | |||
unpacked_edges.insert(unpacked_edges.end(), subpath_edges.begin(), subpath_edges.end()); | |||
} | |||
} | |||
// std::cout << "unpacked_nodes: "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same.
profiles/testbot.lua
Outdated
end | ||
if turn.has_traffic_light then | ||
turn.duration = turn.duration + profile.properties.traffic_light_penalty | ||
end | ||
|
||
io.write("after penalty turn.duration: ", turn.duration, "turn.weight: ", turn.weight, "\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is debug code and needs to be removed.
@@ -74,6 +74,15 @@ InternalRouteResult directShortestPathSearch(SearchEngineData<mld::Algorithm> &e | |||
auto &reverse_heap = *engine_working_data.reverse_heap_1; | |||
insertNodesInHeaps(forward_heap, reverse_heap, phantom_nodes); | |||
|
|||
std::cout << "source_phantom.forward_segment_id.id: " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is debug code and needs to be removed.
|
||
// Store settled nodes in search space bucket | ||
search_space_with_buckets.emplace_back( | ||
node, parent, column_index, target_weight, target_duration); | ||
node, parent, INVALID_CLIQUE_ARC_TYPE, column_index, target_weight, target_duration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of pushing this to the call-site we can add a second constructor.
: facade.IsBackwardEdge(edge)) | ||
if ((DIRECTION == FORWARD_DIRECTION ? facade.IsForwardEdge(edge) | ||
: facade.IsBackwardEdge(edge)) && | ||
!query_heap.WasInserted(facade.GetTarget(edge))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should pull out facade.GetTarget(edge)
in an own variable.
This commit brings feature parity with CH for the `table` pluging.
Issue
#5013 - Distances in Matrix, MLD
Similar to unpacking in CH, we need to do two things for MLD
Details
ManyToMany/Bidirectional search: Path finding already happens in the forward routing steps and the backward routing steps in the MLD ManyToManySearch function. The idea is to use the heap from the ForwardRoutingStep and the search space buckets in the BackwardRoutingStep to recreate the packed or shortcutted path.
OneToMany/Unidirectional Search: Path finding already happens during the unidirectional search - however, we need to extract the packed path from the heap and the multi-map that it uses.
manyToMany
heaps, but rather, just regular heaps.Tasklist
Requirements / Relations
Link any requirements here. Other pull requests this PR is based on?