Package com.jgalgo.alg
Most algorithms accept a Graph object as input, and perform some computation on it.
Algorithms in this package follow a common pattern: an interface is defined for the functionality only (e.g.
ShortestPathSingleSource), a result object is defined within the interface (e.g.
ShortestPathSingleSource.Result), a default implementation is provided via
newInstance() method (e.g. ShortestPathSingleSource.newInstance()), and a builder that
allow more control over the algorithm is provided via newBuilder() method (e.g.
ShortestPathSingleSource.newBuilder()). In addition, algorithm interfaces define a result
specifically for graphs in which the vertices and edges are integer only, IntGraph (e.g.
ShortestPathSingleSource.IResult). For the most common use case, there is no need to use
IntGraph and the result objects that are specific to it.
Non of the algorithms or result objects in this package are thread safe. Result objects should not be used once the graph on which the result was computed is modified, as the result object may relay on the graph for information and may not be able to detect the modification.
Most algorithm implementations are not expose as public API.
-
Interface Summary Interface Description AlgorithmBuilderBase A base interface for all algorithm builders.Bfs Bread first search (BFS) iterator.Bfs.IntIter A BFS iterator forIntGraph.Bfs.Iter<V,E> A BFS iterator.BiConnectedComponentsAlgo An algorithm that compute the bi-connected components of a graph.BiConnectedComponentsAlgo.Builder A builder forBiConnectedComponentsAlgoobjects.BiConnectedComponentsAlgo.IResult A result object of aBiConnectedComponentsAlgocomputation forIntGraph.BiConnectedComponentsAlgo.Result<V,E> A result object of aBiConnectedComponentsAlgocomputation.ChinesePostman An algorithm for the chinese postman problem.ChinesePostman.Builder A builder forChinesePostmanobjects.ClosuresEnumerator An algorithm that enumerate all the closure subsets in a directed graph.ClosuresEnumerator.Builder A builder forClosuresEnumeratorobjects.ColoringAlgo An algorithm that assign a color to each vertex in a graph while avoiding identical color for any pair of adjacent vertices.ColoringAlgo.Builder A builder forColoringAlgoobjects.CoresAlgo Cores computing algorithm.CoresAlgo.Builder A builder forCoresAlgoobjects.CoresAlgo.IResult The result of the cores computation forIntGraph.CoresAlgo.Result<V,E> The result of the cores computation.CyclesEnumerator An algorithm that enumerate all cycles in a graph.CyclesEnumerator.Builder A builder forCyclesEnumeratorobjects.Dfs Depth first search (DFS) iterator.Dfs.IntIter A DFS iterator forIntGraph.Dfs.Iter<V,E> A DFS iterator.DominatingSetAlgo An algorithm for computing a minimum dominating set.DominatingSetAlgo.Builder A builder forDominatingSetAlgoalgorithms.EdgeCover Minimum edge vertex cover algorithm.EdgeCover.Builder A builder forEdgeCoveralgorithms.EulerianTourAlgo Eulerian tour calculation algorithm.EulerianTourAlgo.Builder A builder forEulerianTourAlgoobjects.Flow<V,E> Flow on graph edges.IFlow Flow onIntGraphedges.IMatching A matching in aIntGraph.IPath A path of edges in an int graph.IVertexBiPartition A partition of the vertices of an int graph into two blocks.IVertexPartition A partition of the vertices of an int graph.KEdgeConnectedComponentsAlgo An algorithm that compute the k-edge connected components of a graph.KEdgeConnectedComponentsAlgo.Builder A builder forKEdgeConnectedComponentsAlgoobjects.KShortestPathsST An algorithm for computing the K shortest paths between two vertices in a graph.KShortestPathsST.Builder A builder forKShortestPathsSTobjects.KVertexConnectedComponentsAlgo Finds the k-vertex connected components of a graph.KVertexConnectedComponentsAlgo.Builder A builder forKVertexConnectedComponentsAlgoobjects.KVertexConnectedComponentsAlgo.IResult Result of aKVertexConnectedComponentsAlgocomputation forIntGraph.KVertexConnectedComponentsAlgo.Result<V,E> Result of aKVertexConnectedComponentsAlgocomputation.LowestCommonAncestorDynamic Dynamic algorithm for Lowest Common Ancestor (LCA) queries.LowestCommonAncestorDynamic.Builder A builder forLowestCommonAncestorDynamicobjects.LowestCommonAncestorDynamic.Vertex A tree vertex in anLowestCommonAncestorDynamicdata structure.LowestCommonAncestorOffline An algorithm for computing the lowest common ancestor (LCA) of two vertices in a tree, offline.LowestCommonAncestorOffline.Builder A builder forLowestCommonAncestorOfflineobjects.LowestCommonAncestorOffline.IQueries Queries container forLowestCommonAncestorOfflinecomputations forIntGraph.LowestCommonAncestorOffline.IResult Result of aLowestCommonAncestorOfflinecomputation forIntGraph.LowestCommonAncestorOffline.Queries<V,E> Queries container forLowestCommonAncestorOfflinecomputations.LowestCommonAncestorOffline.Result<V,E> Result of aLowestCommonAncestorOfflinecomputation.LowestCommonAncestorStatic Static Lowest Common Ancestor (LCA) algorithm.LowestCommonAncestorStatic.Builder A builder forLowestCommonAncestorStaticobjects.LowestCommonAncestorStatic.DataStructure<V,E> Data structure result created from a static LCA pre-processing.LowestCommonAncestorStatic.IDataStructure Data structure result created from a static LCA pre-processing forIntGraph.Matching<V,E> A matching in a graph.MatchingAlgo Maximum/minimum matching algorithm.MatchingAlgo.Builder A builder forMatchingAlgoobjects.MaximalCliquesEnumerator Algorithm for enumerating over all maximal cliques in a graph.MaximalCliquesEnumerator.Builder A builder forMaximalCliquesEnumeratorobjects.MaximumFlow Calculate the maximum flow in a flow network.MaximumFlow.Builder A builder forMaximumFlowobjects.MinimumCostFlow Compute the minimum-cost (max) flow in a flow network.MinimumCostFlow.Builder A builder forMinimumCostFlowobjects.MinimumDirectedSpanningTree Minimum spanning tree algorithm for directed graphs.MinimumDirectedSpanningTree.Builder A builder forMinimumDirectedSpanningTreeobjects.MinimumEdgeCutAllST Minimum Edge-Cut algorithm that finds all minimum edge-cuts in a graph between two terminal vertices (source-sink, S-T).MinimumEdgeCutAllST.Builder A builder forMinimumEdgeCutAllSTobjects.MinimumEdgeCutGlobal Global Minimum Edge-Cut algorithm without terminal vertices.MinimumEdgeCutGlobal.Builder A builder forMinimumEdgeCutGlobalobjects.MinimumEdgeCutST Minimum Edge-Cut algorithm with terminal vertices (source-sink, S-T).MinimumEdgeCutST.Builder A builder forMinimumEdgeCutSTobjects.MinimumMeanCycle Algorithm that find the cycle with the minimum mean weight.MinimumMeanCycle.Builder A builder forMinimumMeanCycleobjects.MinimumSpanningTree Minimum spanning tree algorithm.MinimumSpanningTree.Builder A builder forMinimumSpanningTreeobjects.MinimumSpanningTree.IResult A result object forMinimumSpanningTreecomputation forIntGraph.MinimumSpanningTree.Result<V,E> A result object forMinimumSpanningTreecomputation.MinimumVertexCutAllGlobal Minimum Vertex-Cut algorithm that finds all minimum vertex-cuts in a graph (global vertex-cut).MinimumVertexCutAllGlobal.Builder A builder forMinimumVertexCutAllGlobalobjects.MinimumVertexCutAllST Minimum Vertex-Cut algorithm that finds all minimum vertex-cuts in a graph between two terminal vertices (source-sink, S-T).MinimumVertexCutAllST.Builder A builder forMinimumVertexCutAllSTobjects.MinimumVertexCutGlobal Minimum Vertex-Cut algorithm without terminal vertices.MinimumVertexCutGlobal.Builder A builder forMinimumVertexCutGlobalobjects.MinimumVertexCutST Minimum Vertex-Cut algorithm with terminal vertices (source-sink, S-T).MinimumVertexCutST.Builder A builder forMinimumVertexCutSTobjects.Path<V,E> A path of edges in a graph.RandomizedAlgorithm Randomized algorithm interface.ShortestPathAllPairs An algorithm that compute all pairs shortest path (APSP) in a graph.ShortestPathAllPairs.Builder A builder forShortestPathAllPairsobjects.ShortestPathAllPairs.IResult A result object for anShortestPathAllPairsalgorithm forIntGraph.ShortestPathAllPairs.Result<V,E> A result object for anShortestPathAllPairsalgorithm.ShortestPathHeuristicST Shortest path algorithm that uses a distance heuristic function.ShortestPathHeuristicST.Builder A builder forShortestPathHeuristicSTobjects.ShortestPathSingleSource Single Source Shortest Path algorithm.ShortestPathSingleSource.Builder A builder forShortestPathSingleSourceobjects.ShortestPathSingleSource.IResult A result object for theShortestPathSingleSourceproblem forIntGraph.ShortestPathSingleSource.Result<V,E> A result object for theShortestPathSingleSourceproblem.ShortestPathST An algorithm for computing the shortest path between two vertices in a graph.ShortestPathST.Builder A builder forShortestPathSTobjects.SimplePathsEnumerator An algorithm that enumerate over simple paths between a source and a target.SimplePathsEnumerator.Builder A builder forSimplePathsEnumeratorobjects.SteinerTreeAlgo An algorithm for the Steiner tree problem.SteinerTreeAlgo.Builder A builder forSteinerTreeAlgoobjects.SteinerTreeAlgo.IResult A result object forSteinerTreeAlgocomputation forIntGraph.SteinerTreeAlgo.Result<V,E> A result object forSteinerTreeAlgocomputation.StronglyConnectedComponentsAlgo Strongly Connected components algorithm.StronglyConnectedComponentsAlgo.Builder A builder forStronglyConnectedComponentsAlgoobjects.TopologicalOrderAlgo Algorithm that calculate a topological order of graph vertices.TopologicalOrderAlgo.Builder A builder forTopologicalOrderAlgoobjects.TopologicalOrderAlgo.IResult A result object of aTopologicalOrderAlgoalgorithm forIntGraph.TopologicalOrderAlgo.Result<V,E> A result object of aTopologicalOrderAlgoalgorithm.TreePathMaxima Tree Path Maxima (TPM) algorithm.TreePathMaxima.Builder A builder forTreePathMaximaobjects.TreePathMaxima.IQueries Queries container forTreePathMaximacomputations forIntGraph.TreePathMaxima.IResult A result object forTreePathMaximaalgorithm forIntGraph.TreePathMaxima.Queries<V,E> Queries container forTreePathMaximacomputations.TreePathMaxima.Result<V,E> A result object forTreePathMaximaalgorithm.TspMetric Metric Traveling Salesman Problem (TSP) algorithm.VertexBiPartition<V,E> A partition of the vertices of a graph into two blocks.VertexCover Minimum weighted vertex cover algorithm.VertexCover.Builder A builder forVertexCoveralgorithms.VertexPartition<V,E> A partition of the vertices of a graph.VoronoiAlgo Voronoi cells algorithm.VoronoiAlgo.Builder A builder forVoronoiAlgoalgorithms.VoronoiAlgo.IResult A result object ofVoronoiAlgocomputation forIntGraph.VoronoiAlgo.Result<V,E> A result object ofVoronoiAlgocomputation.WeaklyConnectedComponentsAlgo Weakly Connected components algorithm.WeaklyConnectedComponentsAlgo.Builder A builder forWeaklyConnectedComponentsAlgoobjects. -
Class Summary Class Description BipartiteGraphs Static class for bipartite graphs.GraphsUtils Static methods class for graphs.Trees Static methods class for tree graphs.TspMetricMatchingAppx TSP \(3/2\)-approximation using maximum matching.TspMetricMSTAppx TSP \(2\)-approximation using MST. -
Enum Summary Enum Description EdgeDirection The direction type of an edge with respect to a vertex.