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 may be provided via builder() method (e.g.
ShortestPathSingleSource.builder()). In addition, algorithm interfaces define a result object
specifically for int graphs in which the vertices and edges are integer only
(e.g. ShortestPathSingleSource.IResult). In the common use case, there is no need to use
IntGraph and the result objects that are specific for it.
None 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.BfsIter<V,E> Bread first search (BFS) iterator.BfsIter.Int A BFS iterator forIntGraph.BiConnectedComponentsAlgo An algorithm that compute the bi-connected components of a graph.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.ClosuresEnumerator An algorithm that enumerate all the closure subsets in a directed graph.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.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.DfsIter<V,E> Depth first search (DFS) iterators static class.DfsIter.Int A DFS iterator forIntGraph.DistanceMeasures<V,E> A set of graph distance measures.DominatingSetAlgo An algorithm for computing a minimum dominating set.EdgeCover Minimum edge vertex cover algorithm.EdgeCover.Builder A builder forEdgeCoveralgorithms.EulerianTourAlgo Eulerian tour calculation algorithm.Flow<V,E> Flow on graph edges.HamiltonianPathAlgo Hamiltonian path/cycle algorithm.IDistanceMeasures A set of graph distance measures forIntGraph.IFlow Flow onIntGraphedges.IMatching A matching in aIntGraph.IPath A path of edges in an int graph.IsomorphismIMapping A mapping between two graphs that preserves the structure of the graphs forIntGraph.IsomorphismMapping<V1,E1,V2,E2> A mapping between two graphs that preserves the structure of the graphs.IsomorphismTester Tester that check whether two graphs are isomorphic.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.KShortestPathsST An algorithm for computing the K shortest paths between two vertices in a graph.KVertexConnectedComponentsAlgo Finds the k-vertex connected components of a graph.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.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.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.MinimumEdgeCutAllST Minimum Edge-Cut algorithm that finds all minimum edge-cuts in a graph between two terminal vertices (source-sink, S-T).MinimumEdgeCutGlobal Global Minimum Edge-Cut algorithm without terminal vertices.MinimumEdgeCutST Minimum Edge-Cut algorithm with terminal vertices (source-sink, S-T).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).MinimumVertexCutAllST Minimum Vertex-Cut algorithm that finds all minimum vertex-cuts in a graph between two terminal vertices (source-sink, S-T).MinimumVertexCutGlobal Minimum Vertex-Cut algorithm without terminal vertices.MinimumVertexCutST Minimum Vertex-Cut algorithm with terminal vertices (source-sink, S-T).Path<V,E> A path of edges in a graph.RandomizedAlgorithm Randomized algorithm interface.RandomWalkIter<V,E> Random walk iterator.RandomWalkIter.Int A random walk iterator forIntGraph.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.SteinerTreeAlgo An algorithm for the Steiner tree problem.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.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.VertexPartition<V,E> A partition of the vertices of a graph.VoronoiAlgo Voronoi cells algorithm.VoronoiAlgo.IResult A result object ofVoronoiAlgocomputation forIntGraph.VoronoiAlgo.Result<V,E> A result object ofVoronoiAlgocomputation.WeaklyConnectedComponentsAlgo Weakly Connected components algorithm. -
Class Summary Class Description BipartiteGraphs Static class for bipartite 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. -
Exception Summary Exception Description NegativeCycleException Exception thrown when a negative cycle is detected in a graph during a shortest path computation.