@Alpha public class BFSPathFinder extends AbstractPathFinder
PathFinder that assumes an unweighted FlowGraph and computes the
shortest path using a variant of the BFS path-finding algorithm. This implementation has two key differences from the
traditional BFS implementations:
the input graph is a multi-graph i.e. there could be multiple edges between each pair of nodes, and
each edge has a label associated with it. In our case, the label corresponds to the set of input/output dataset descriptors that are accepted by the edge.
a HashMap of list of visited edges, as opposed to list of visited
vertices as in the case of traditional BFS, and
for each edge, we maintain additional state that includes the input/output dataset descriptor associated with the particular visitation of that edge.
This additional information allows us to accurately mark edges as visited and guarantee termination of the algorithm.PathFinder.PathFinderExceptionflowConfig, flowExecutionId, flowSpec| Constructor and Description |
|---|
BFSPathFinder(FlowGraph flowGraph,
FlowSpec flowSpec)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
List<FlowEdgeContext> |
findPathUnicast(DataNode destNode)
A simple path finding algorithm based on Breadth-First Search.
|
findPathpublic BFSPathFinder(FlowGraph flowGraph, FlowSpec flowSpec) throws ReflectiveOperationException
flowGraph - ReflectiveOperationExceptionpublic List<FlowEdgeContext> findPathUnicast(DataNode destNode)
FlowEdges
to a queue. The FlowEdges whose output DatasetDescriptor matches the destDatasetDescriptor are
added first to the queue. This ensures that dataset transformations are always performed closest to the source.findPathUnicast in class AbstractPathFinderFlowEdgeContexts starting at the srcNode and ending at the destNode.