Package com.jgalgo
Interface MinimumDirectedSpanningTree
-
public interface MinimumDirectedSpanningTree
Minimum spanning tree algorithm for directed graphs.A spanning tree in directed graph is defined similarly to a spanning tree in undirected graph, but the 'spanning tree' does not yield a strongly connected graph, but a weakly connected tree rooted at some vertex.
- Author:
- Barak Ugav
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MinimumDirectedSpanningTree.Builder
A builder forMinimumDirectedSpanningTree
objects.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description MinimumSpanningTree.Result
computeMinimumDirectedSpanningTree(Graph g, WeightFunction w, int root)
Compute a minimum directed spanning tree (MDST) in a directed graph, rooted at the given vertex.static MinimumDirectedSpanningTree.Builder
newBuilder()
Create a new minimum directed spanning tree algorithm builder.
-
-
-
Method Detail
-
computeMinimumDirectedSpanningTree
MinimumSpanningTree.Result computeMinimumDirectedSpanningTree(Graph g, WeightFunction w, int root)
Compute a minimum directed spanning tree (MDST) in a directed graph, rooted at the given vertex.- Parameters:
g
- a directed graphw
- an edge weight functionroot
- vertex in the graph the spanning tree will be rooted from- Returns:
- all edges composing the spanning tree
- Throws:
IllegalArgumentException
- ifg
is not directed
-
newBuilder
static MinimumDirectedSpanningTree.Builder newBuilder()
Create a new minimum directed spanning tree algorithm builder.This is the recommended way to instantiate a new
MinimumDirectedSpanningTree
object.- Returns:
- a new builder that can build
MinimumDirectedSpanningTree
objects
-
-