Skip to content

Implemented Tarjan's algorithm for removing dead-end nodes. - #235

Merged
karussell merged 1 commit into
graphhopper:masterfrom
rodneyodonnell:master
Jul 14, 2014
Merged

karussell merged 1 commit into
graphhopper:masterfrom
rodneyodonnell:master

Conversation

@rodneyodonnell

Copy link
Copy Markdown
  • Previous two pass algorithm didn't work optimally in all cases.
  • Tarjan's is a single pass, and ~2x the speed.
  • Added extra tests.

 - Previous two pass algorithm didn't work in all cases.
 - Tarjan's is a single pass, and ~2x the speed.
@karussell

Copy link
Copy Markdown
Member

Thanks! Looks good!

Did you tried it for the world wide case? And how large can the stateStack container get for world wide?

@rodneyodonnell

Copy link
Copy Markdown
Author

It build the planet file fine using -Xmx31000m.
Unfortunately I didn't record how large the stateStack got or try smaller
VM sizes.

I'll add some temporary printf instumentation code and kick off a build of
the planet graph tonight just to be sure.
I haven't build planet with this exact sha, so it probably makes sense to
run it again anyway to make sure nothing broke when I was cleaning up the
code.

Rod.

On Sun, Jul 13, 2014 at 11:40 PM, Peter [email protected] wrote:

Thanks! Looks good!

Did you tried it for the world wide case? And how large can the stateStack
container get for world wide?

—
Reply to this email directly or view it on GitHub
#235 (comment)
.

@rodneyodonnell

Copy link
Copy Markdown
Author

BTW. What memory setting do you usually build planet with? I should make sure that still works too.

@karussell

Copy link
Copy Markdown
Member

I'm using -Xmx30000m but without elevation it should be possible with 25gb and if only car it should be even less like 24gb. Normally the cleanup uses a lot less memory than required for CH or the import.

@rodneyodonnell

Copy link
Copy Markdown
Author

It all works great for me.

The Planet/Car/No-Elevation data builds fine with -Xmx24000m.

The run time of removeDeadEndUnvisitedNetworks() is less than three minutes (not sure how long the two pass approach took).

My diagnostics shows:
2014-07-13 17:55:48,961 [main] INFO routing.util.TarjansStronglyConnectedComponentsAlgorithm - Max Observed Stack Size = 3600000 totalMB:23726, usedMB:13672
2014-07-13 17:58:28,542 [main] INFO routing.util.PrepareRoutingSubnetworks - optimize to remove subnetworks (860973), zero-degree-nodes (0), unvisited-dead-end-nodes(203296), maxEdges/node (39)
2014-07-13 18:30:54,122 [main] INFO com.graphhopper.GraphHopper - edges: 128152019, nodes 95673337, there were 860973 subnetworks. removed them => 3029846 less nodes. Remaining subnetworks:681
2014-07-13 18:30:54,122 [main] INFO com.graphhopper.GraphHopper - optimizing ... (totalMB:23735, usedMB:18538)

karussell pushed a commit that referenced this pull request Jul 14, 2014
Implemented Tarjan's algorithm for removing dead-end nodes. Replacing old two-pass algorithm.
@karussell
karussell merged commit 7a6e067 into graphhopper:master Jul 14, 2014
@karussell

Copy link
Copy Markdown
Member

Nice - thanks again!

@karussell karussell mentioned this pull request Sep 12, 2014
1 of 3 tasks
@karussell

Copy link
Copy Markdown
Member

This pull request improved #226

dabiih pushed a commit to dabiih/graphhopper that referenced this pull request Jan 7, 2025
dabiih pushed a commit to dabiih/graphhopper that referenced this pull request Jan 7, 2025
…hopper#232)

* reintroduce LongPressHandler for iOS

* comment

* popup menu above cursor is problematic

* try to improve right-click popup

* a bit tighter

* really no close button necessary?

* css style

* hover should be centered

* remove close button, graphhopper#235
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 this pull request may close these issues.

3 participants