In
graph theory
In mathematics and computer science, graph theory is the study of ''graph (discrete mathematics), graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of ''Vertex (graph ...
, Edmonds' algorithm or Chu–Liu/Edmonds' algorithm is an
algorithm
In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...
for finding a
spanning arborescence
Arborescence refers to any tree-like structure. It may also refer to:
* Arborescence (graph theory)
* ''Arborescence'' (album), a 1994 album by Ozric Tentacles
* ''Arborescence'', a 2013 album by Aaron Parks
{{disambiguation ...
of minimum weight (sometimes called an ''optimum branching'').
[ The algorithm is applicable to finding a minimum spanning forest with given roots. However, when searching for the minimum spanning forest among all -component spanning forests, a multiplier arises in the complexity of the algorithm
, corresponding to the choice of a subset of vertices designated as roots. This makes it unsuitable for such a task. Even when constructing a minimum spanning tree, regardless of the root, the algorithm must be used
times, sequentially assigning each vertex as the root. An efficient algorithm for finding minimum spanning forests that solves the root assignment problem is presented in (https://link.springer.com/article/10.1007/s10958-023-06666-w).
It builds a sequence of minimal -component spanning forests for all up to the minimum spanning tree. The Chu-Liu/Edmonds algorithm is a component of it. ]
It is the
directed
Direct may refer to:
Mathematics
* Directed set, in order theory
* Direct limit of (pre), sheaves
* Direct sum of modules, a construction in abstract algebra which combines several vector spaces
Computing
* Direct access (disambiguation), a ...
analog of the
minimum spanning tree
A minimum spanning tree (MST) or minimum weight spanning tree is a subset of the edges of a connected, edge-weighted undirected graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight. ...
problem.
The algorithm was proposed independently first by Yoeng-Jin Chu and Tseng-Hong Liu (1965) and then by
Jack Edmonds
Jack R. Edmonds (born April 5, 1934) is an American-born and educated computer scientist and mathematician who lived and worked in Canada for much of his life. He has made fundamental contributions to the fields of combinatorial optimization, po ...
(1967).
Algorithm
Description
The algorithm takes as input a directed graph
where
is the set of nodes and
is the set of directed edges, a distinguished vertex
called the ''root'', and a real-valued weight
for each edge
.
It returns a spanning
arborescence
Arborescence refers to any tree-like structure. It may also refer to:
* Arborescence (graph theory)
* ''Arborescence'' (album), a 1994 album by Ozric Tentacles
* ''Arborescence'', a 2013 album by Aaron Parks
{{disambiguation ...
rooted at
of minimum weight, where the weight of an arborescence is defined to be the sum of its edge weights,
.
The algorithm has a recursive description.
Let
denote the function which returns a spanning arborescence rooted at
of minimum weight.
We first remove any edge from
whose destination is
.
We may also replace any set of parallel edges (edges between the same pair of vertices in the same direction) by a single edge with weight equal to the minimum of the weights of these parallel edges.
Now, for each node
other than the root, find the edge incoming to
of lowest weight (with ties broken arbitrarily).
Denote the source of this edge by
.
If the set of edges
does not contain any cycles, then
.
Otherwise,
contains at least one cycle.
Arbitrarily choose one of these cycles and call it
.
We now define a new weighted directed graph
in which the cycle
is "contracted" into one node as follows:
The nodes of
are the nodes of
not in
plus a ''new'' node denoted
.
* If
is an edge in
with
and
(an edge coming into the cycle), then include in
a new edge
, and define
.
* If
is an edge in
with
and
(an edge going away from the cycle), then include in
a new edge
, and define
.
* If
is an edge in
with
and
(an edge unrelated to the cycle), then include in
a new edge
, and define
.
For each edge in
, we remember which edge in
it corresponds to.
Now find a minimum spanning arborescence
of
using a call to
.
Since
is a spanning arborescence, each vertex has exactly one incoming edge.
Let
be the unique incoming edge to
in
.
This edge corresponds to an edge
with
.
Remove the edge
from
, breaking the cycle.
Mark each remaining edge in
.
For each edge in
, mark its corresponding edge in
.
Now we define
to be the set of marked edges, which form a minimum spanning arborescence.
Observe that
is defined in terms of
, with
having strictly fewer vertices than
. Finding
for a single-vertex graph is trivial (it is just
itself), so the recursive algorithm is guaranteed to terminate.
Running time
The running time of this algorithm is
. A faster implementation of the algorithm due to
Robert Tarjan
Robert Endre Tarjan (born April 30, 1948) is an American computer scientist and mathematician. He is the discoverer of several graph theory algorithms, including his strongly connected components algorithm, and co-inventor of both splay trees a ...
runs in time
for
sparse graph
In mathematics, a dense graph is a Graph (discrete mathematics), graph in which the number of edges is close to the maximal number of edges (where every pair of Vertex (graph theory), vertices is connected by one edge). The opposite, a graph with ...
s and
for dense graphs. This is as fast as
Prim's algorithm
In computer science, Prim's algorithm is a greedy algorithm that finds a minimum spanning tree for a Weighted graph, weighted undirected graph. This means it finds a subset of the edge (graph theory), edges that forms a Tree (graph theory), tree ...
for an undirected minimum spanning tree. In 1986,
Gabow,
Galil
The IMI Galil () is a family of Israeli-made automatic rifles chambered for the 5.56×45mm NATO and 7.62×51mm NATO cartridges. Originally designed by Yisrael Galili and Yakov Lior in the late 1960s, the Galil was first produced by the state-o ...
, Spencer, and
Tarjan produced a faster implementation, with running time
.
References
*
*
*
*
*
*
*
External links
Edmonds's algorithm ( edmonds-alg )– An implementation of Edmonds's algorithm written in
C++ and licensed under the
MIT License
The MIT License is a permissive software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts very few restrictions on reuse and therefore has high license compatibility.
Unl ...
. This source is using Tarjan's implementation for the dense graph.
*NetworkX, a
python
Python may refer to:
Snakes
* Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia
** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia
* Python (mythology), a mythical serpent
Computing
* Python (prog ...
library distributed under
BSD
The Berkeley Software Distribution (BSD), also known as Berkeley Unix or BSD Unix, is a discontinued Unix operating system developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berkeley, beginni ...
, has an implementation o
Edmonds' Algorithm(spanning-forest-builder 0.0.2)– Library for constructing oriented forests of minimum weight.
{{Graph traversal algorithms
Graph algorithms