java.lang.Object
lv.id.jc.algorithm.graph.BreadthFirstSearch<T>
- Type Parameters:
T
- the type of vertex
- All Implemented Interfaces:
SearchAlgorithm<T>
Algorithm for finding the shortest paths between nodes in a graph.
The algorithm doesn't take into account the distance between nodes.
- Since:
- 1.0
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
BreadthFirstSearch
public BreadthFirstSearch()
-
-
Method Details
-
findPath
Description copied from interface:SearchAlgorithm
Find the path from the source node to the target- Specified by:
findPath
in interfaceSearchAlgorithm<T>
- Parameters:
graph
- The graph in which we search for the pathsource
- Search starting point identifiertarget
- Search finish point identifier- Returns:
- Path found or empty list if path cannot be found
-