Module net.automatalib.util
Interface GraphTraversalVisitor<N,E,D>
- Type Parameters:
N- node classE- edge classD- user data class
- All Known Implementing Classes:
TarjanSCCVisitor
public interface GraphTraversalVisitor<N,E,D>
Visitor interface for graph traversals.
This interface declares methods that are called upon basic graph traversal actions.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidCalled when an edge is backtracked.default voidfinishExploration(N node, D data) Called when the exploration of a node is finished.default GraphTraversalActionCalled when an edge is processed.default GraphTraversalActionprocessInitial(N initialNode, Holder<D> holder) Called when the initial nodes (as passed to the traversal method) are processed.default booleanstartExploration(N node, D data) Called when the exploration of a node is started.
-
Method Details
-
processInitial
Called when the initial nodes (as passed to the traversal method) are processed.- Parameters:
initialNode- the node that is processedholder- a writable reference whose (node-specific) data is passed to the corresponding methods during traversal- Returns:
- the action to perform
-
startExploration
Called when the exploration of a node is started.- Parameters:
node- the node whose exploration is about to be starteddata- the user data associated with this node- Returns:
true, if the node should be explored,falseotherwise
-
processEdge
default GraphTraversalAction processEdge(N srcNode, D srcData, E edge, N tgtNode, Holder<D> tgtHolder) Called when an edge is processed.- Parameters:
srcNode- the source nodesrcData- the user data associated with the source nodeedge- the edge that is being processedtgtNode- the target nodetgtHolder- a writable reference to provide user data that should be associated with the target node- Returns:
- the action to perform
-
backtrackEdge
Called when an edge is backtracked. This typically happens only in depth-first style traversals.- Parameters:
srcNode- the source nodesrcData- the user data associated with the source nodeedge- the edge that is being processedtgtNode- the target nodetgtData- the user data associated with the target node
-
finishExploration
Called when the exploration of a node is finished.- Parameters:
node- the node whose exploration is being finisheddata- the user data associated with this node
-