public class EdgeBasedTarjanSCC extends Object
The algorithm is of course very similar to the node-based version and it might be possible to reuse some code between the two, but especially the version with an explicit stack needs different 'state' information and loops require some special treatment as well.
TarjanSCC
Modifier and Type | Class and Description |
---|---|
static class |
EdgeBasedTarjanSCC.ConnectedComponents |
Constructor and Description |
---|
EdgeBasedTarjanSCC(Graph graph,
BooleanEncodedValue accessEnc,
TurnCostProvider turnCostProvider,
boolean excludeSingleEdgeComponents) |
Modifier and Type | Method and Description |
---|---|
static int |
createEdgeKey(EdgeIteratorState edgeState,
boolean reverse) |
EdgeBasedTarjanSCC.ConnectedComponents |
findComponents()
Runs Tarjan's algorithm using an explicit stack.
|
EdgeBasedTarjanSCC.ConnectedComponents |
findComponentsRecursive()
Runs Tarjan's algorithm in a recursive way.
|
static int |
getEdgeFromKey(int edgeKey) |
public EdgeBasedTarjanSCC(Graph graph, BooleanEncodedValue accessEnc, TurnCostProvider turnCostProvider, boolean excludeSingleEdgeComponents)
excludeSingleEdgeComponents
- if set to false components that only contain a single edge will not be
returned when calling findComponents()
or findComponentsRecursive()
,
which can be useful to save some memory.turnCostProvider
- used to check the turn costs between edges. if a turn has infinite costs the corresponding
path will be ignored (edges that are only connected by a path with such a turn will not
be considered to belong to the same component)public EdgeBasedTarjanSCC.ConnectedComponents findComponentsRecursive()
findComponents()
) should be
preferred. However, this recursive implementation is easier to understand.public EdgeBasedTarjanSCC.ConnectedComponents findComponents()
public static int createEdgeKey(EdgeIteratorState edgeState, boolean reverse)
public static int getEdgeFromKey(int edgeKey)
Copyright © 2012–2020. All rights reserved.