Skip to content

Finding the prevEdge from the prevNode - #1014

Merged
karussell merged 6 commits into
graphhopper:masterfrom
boldtrn:issue_1010
Apr 25, 2017
Merged

karussell merged 6 commits into
graphhopper:masterfrom
boldtrn:issue_1010

Conversation

@boldtrn

@boldtrn boldtrn commented Mar 27, 2017 •

Copy link
Copy Markdown
Member

This issues fixes #1010. The old behavior was created when the algorithm was searching for the current edge and the previous edge. I pass the current edge in the method parameter now, so the current edge is not needed anymore. It makes more sense to search from the previous node to the base node instead of searching from the base node to the previous node in reverse.

I have seen some issues here with VirtualNodes that couldn't be found from the base node correctly. This only happened in combination with a custom weighting and CH, so it is hard to write a test here.

@karussell

Copy link
Copy Markdown
Member

I have seen some issues here with VirtualNodes that couldn't be found from the base node correctly. This only happened in combination with a custom weighting and CH, so it is hard to write a test here.

Ok, let us fix this other issue first, I think you mean #1013 ?

@karussell karussell added the bug label Mar 27, 2017
@karussell karussell added this to the 0.9 milestone Mar 27, 2017
@karussell

Copy link
Copy Markdown
Member

Ok, this has not much to do with #1013. Would you mind to try if you can find this bug in a (integration) test against a CH graph? I can guess this should easily occur if you do

./graphhopper.sh measurement core/files/some.osm.gz

@karussell

Copy link
Copy Markdown
Member

Strange, I cannot find such an issue although I thought this could happen frequently due to the graph.disconnect call in PrepareContractionHierarchies

@karussell

karussell commented Apr 7, 2017 •

Copy link
Copy Markdown
Member

I thought I had reproduced the issue but these changes doesn't fix the problem that I had, see this commit, where the tests fails with: Couldn't find the previous edge for 436-435-1369

See the discussion where this is coming from.

@karussell

karussell commented Apr 10, 2017 •

Copy link
Copy Markdown
Member

The reason that this still fails sometimes for via points is tricky. If we have via points we create 3 virtual nodes e.g. A,B and C to find the paths A->B and B->C. Now if A is on the path B->C the QueryGraph correctly contains the two virtual edges with A leading to a path like B->...->x1->A->x2->...->C but it does not contain x1->x2

BUT when using the CH graph the query B->C can return paths with shortcuts, and these shortcuts are extracted but using only real edge like x1->x2 and not the QueryGraph with virtual edges. Now the turn instruction code relies on finding the previous nodes and fails to find the virtual node A at the real node x2.

@boldtrn

boldtrn commented Apr 19, 2017

Copy link
Copy Markdown
Member Author

Thanks a lot for debugging this and finding a test case @karussell.

I suspected the virtual nodes to be the source of the issue as well. I actually wrote some code to ignore virtual nodes a couple of weeks ago (I think I mentioned it offline). The code does not fix the issue, that why I haven't created a PR.

But, I just had an idea. And I have to blame myself for writing unnecessarily complicated code here. I cannot so any reason to not store the prevEdge like we do with prevName. I just implemented this (see my latest commit to your branch issue_1014). Currently I simply force the turn sign if the prevEdge is null (which should not happen frequently, if it happens at all).

WDYT?

boldtrn added 2 commits April 20, 2017 10:40
# Conflicts:
#	core/src/main/java/com/graphhopper/routing/Path.java
@boldtrn
boldtrn requested a review from karussell April 20, 2017 00:44
@karussell

Copy link
Copy Markdown
Member

So this means we can avoid the limitation of the CH path extraction (returning real edges)? Nice!

@karussell

Copy link
Copy Markdown
Member

Would you mind to update the PR to the latest HEAD?

# Conflicts:
#	core/src/main/java/com/graphhopper/routing/InstructionsFromEdges.java
@boldtrn

boldtrn commented Apr 25, 2017

Copy link
Copy Markdown
Member Author

So this means we can avoid the limitation of the CH path extraction (returning real edges)? Nice!

Yes :). Somehow I must have missed that before...

Would you mind to update the PR to the latest HEAD?

I just updated the PR to the latest master.

@karussell
karussell merged commit bca37b9 into graphhopper:master Apr 25, 2017
@boldtrn
boldtrn deleted the issue_1010 branch October 6, 2017 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Instructions Exception "Couldn't find the edges for..."

2 participants