Class PrepareRoutingSubnetworks
Sometimes there are also subnetworks that can be reached from the main network but not the other way around (or the opposite). For example this can be parking lots that can only be accessed by a single one-way road (a mapping error). These are called 'one-way subnetworks' and are marked using the same subnetwork encoded value, see #86. To find such one-way subnetworks it is important to search for strongly connected components on the directed graph and not do a simple connectivity check for one direction.
Note that it depends on the weighting whether or not edges belong to a subnetwork or not. For example if a weighting 'closes' a bridge to an island the island might become a subnetwork, but if the bridge was open it would belong to the main network. There can even be subnetworks that are due to turn restrictions.
We always run an edge-based connected component search, because this way we retrieve the edges (not the nodes) that belong to each component and can include turn restrictions as well. Node-based component search is faster, but since the subnetwork search goes relatively fast anyway using it has no real benefit.
- Author:
- Peter Karich, easbar
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPrepareRoutingSubnetworks
(BaseGraph graph, List<PrepareRoutingSubnetworks.PrepareJob> prepareJobs) -
Method Summary
Modifier and TypeMethodDescriptionint
doWork()
Finds and marks all subnetworks according tosetMinNetworkSize(int)
setMinNetworkSize
(int minNetworkSize) All components of the graph with less than 2*minNetworkSize
directed edges (edge keys) will be marked as subnetworks.setThreads
(int threads)
-
Constructor Details
-
PrepareRoutingSubnetworks
public PrepareRoutingSubnetworks(BaseGraph graph, List<PrepareRoutingSubnetworks.PrepareJob> prepareJobs)
-
-
Method Details
-
setMinNetworkSize
All components of the graph with less than 2*minNetworkSize
directed edges (edge keys) will be marked as subnetworks. The biggest component will never be marked as subnetwork, even when it is below this size. -
setThreads
-
doWork
public int doWork()Finds and marks all subnetworks according tosetMinNetworkSize(int)
- Returns:
- the total number of marked edges
-