Package org.graph4j

Class GraphAlgorithm

java.lang.Object
org.graph4j.GraphAlgorithm
Direct Known Subclasses:
AStarAlgorithm, BacktrackLongestPathAlgoritm, BellmanFordShortestPath, BFSAllPairsShortestPath, BFSSinglePairShortestPath, BFSSingleSourceShortestPath, BidirectionalDijkstra, CycleFinder, DijkstraShortestPathBase, EdgeConnectivityAlgorithm, EulerianCircuitAlgorithmBase, FloydWarshallShortestPath, GraphMetrics, GreedyWeightedMatching, HierholzerEulerianTrail, JohnsonShortestPath, MaximalCardinalityMatching, MaximumInducedPath, MinimumSpanningTreeBase, ParallelFilterKruskal, PathFinder, SmallestDegreeLastOrdering, TreeExtremaCalculator, VertexConnectivityAlgorithm

public abstract class GraphAlgorithm extends Object
Represents an algorithm that accepts any graph as input, directed or not. For example, DFS or BFS traversal algorithms are implemented exactly the same, regardless the fact that the graph is directed or not, by inspecting the adjacency lists of the vertices provided by the Graph data type.
Author:
Cristian Frăsinaru
  • Field Details

    • graph

      protected final Graph graph
    • directed

      protected final boolean directed
  • Constructor Details

    • GraphAlgorithm

      public GraphAlgorithm(Graph graph)
      Constructs an algorithm which will be executed on the input graph.
      Parameters:
      graph - the input graph.
  • Method Details

    • getGraph

      public Graph getGraph()
      Returns the input graph on which the algorithm is executed.
      Returns:
      the input graph.