Interface SearchAlgorithm<T>

Type Parameters:
T - the type of vertex
All Known Implementing Classes:
BreadthFirstSearch, DijkstrasAlgorithm
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SearchAlgorithm<T>
A functional interface for graph search algorithm
Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    findPath(Graph<T> graph, T source, T target)
    Find the path from the source node to the target
  • Method Details

    • findPath

      List<T> findPath(Graph<T> graph, T source, T target)
      Find the path from the source node to the target
      Parameters:
      graph - The graph in which we search for the path
      source - Search starting point identifier
      target - Search finish point identifier
      Returns:
      Path found or empty list if path cannot be found