Skip to content

Partial fix for #86 - removing dead-end small subnetworks - #226

Closed
cgarreau wants to merge 13 commits into
graphhopper:masterfrom
cgarreau:master
Closed

cgarreau wants to merge 13 commits into
graphhopper:masterfrom
cgarreau:master

Conversation

@cgarreau

Copy link
Copy Markdown

Partial fix for #86

This implements a solution to the "route not found" issues when the nearest point is link to a dead-end subnetworks.

The algorithm is the following:

  • First loop on nodes using a one-way explorer ;
  • It gives a list of all the sub-networks with their size ;
  • Sort the list by size (bigger first) in order to keep the big networks and kill all small networks (size < minNetworkSize).
  • For each sub-network (identified by its first nodeid) explore all nodes starting from this nodeId and not in the big networks (>minNetworkSize) and remove them ;

The algorithm is done twice (forward and backward).

We do it only for mono-encoding manager.
Tested on worldwide map. it fixes all issues we have identified (a few hundred of routes among a test file of 5000).

@karussell

Copy link
Copy Markdown
Member

Thanks a lot this looks good!

What do the failing integration tests mean? See e.g. here. Is there a bigger problem behind it or just that the routes are now different?

Some more things we need after this is clarified:

  • very important: we need at least two unit tests showing that this is working as expected on a simple graph (e.g. use a similar graph like here). E.g. one test that shows it is working just for forward and one test for forward&backward
  • can you make this configurable and disabled by default (for now)
  • minor thing: RemoveDeadEndUnvisitedNetworks should be removeDeadEndUnvisitedNetworks
  • after all is done: would you squash the commits into one?

@cgarreau

Copy link
Copy Markdown
Author

Hi Peter,

Yes, I think the integration test failures are due to the removed points in
the graph.

As far as I can see, all the errors are due to different route distance
(different path) or different number of expected points.

Indeed the code removes a lot of small erroneous network in the planet
file, mainly dead-end parking’s.

I’ve added the 2 requested unit tests and fix the function name.

Regarding the configuration, currently it relies on the existing
“prepare.minNetworkSize” parameters and is activated only for single
encoder maps.

I can add a Boolean for activation or use a different minNetworkSize
parameters set to zero by default?

What do you prefer?

Best,

Christophe

…areas - remove one-way nodes that drives to dead-end"

revert unneeded change
@karussell

Copy link
Copy Markdown
Member

Thanks! I'll also have a look into the failing tests.

Yes, a second minNetworkSize would be nice. Maybe name it prepare.minOnewayNetworkSize or similar :)

@cgarreau

Copy link
Copy Markdown
Author

Hi Peter,

Done and squashed

@karussell karussell mentioned this pull request Jun 30, 2014
1 of 3 tasks
karussell pushed a commit that referenced this pull request Jun 30, 2014
@karussell

Copy link
Copy Markdown
Member

Merged. I'm also in the process of testing it now. If there is a problem we create a new issue!

BTW: I noticed that lots of the examples I had were already fixed - really nice OSM guys!

@karussell karussell closed this Jul 1, 2014
dabiih pushed a commit to dabiih/graphhopper that referenced this pull request Jan 7, 2025
* use last entry of profiles, looks a bit ugly

* previous approach was too ugly. Now give the first marker the focus but 'hide' it from normal TAB sequence

* minor revert

* minor
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.

2 participants