HOME

TheInfoList



OR:

In
graph theory In mathematics, graph theory is the study of ''graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of '' vertices'' (also called ''nodes'' or ''points'') which are conne ...
, Edmonds' algorithm or Chu–Liu/Edmonds' algorithm is an
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algorithms are used as specificat ...
for finding a spanning arborescence of minimum weight (sometimes called an ''optimum branching''). It is the
directed Director may refer to: Literature * ''Director'' (magazine), a British magazine * ''The Director'' (novel), a 1971 novel by Henry Denker * ''The Director'' (play), a 2000 play by Nancy Hasty Music * Director (band), an Irish rock band * ''Di ...
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. T ...
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, pol ...
(1967).


Algorithm


Description

The algorithm takes as input a directed graph D = \langle V, E \rangle where V is the set of nodes and E is the set of directed edges, a distinguished vertex r \in V called the ''root'', and a real-valued weight w(e) for each edge e \in E. It returns a spanning arborescence A rooted at r of minimum weight, where the weight of an arborescence is defined to be the sum of its edge weights, w(A) = \sum_. The algorithm has a recursive description. Let f(D, r, w) denote the function which returns a spanning arborescence rooted at r of minimum weight. We first remove any edge from E whose destination is r. 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 v other than the root, find the edge incoming to v of lowest weight (with ties broken arbitrarily). Denote the source of this edge by \pi(v). If the set of edges P = \ does not contain any cycles, then f(D,r,w) = P. Otherwise, P contains at least one cycle. Arbitrarily choose one of these cycles and call it C. We now define a new weighted directed graph D^\prime = \langle V^\prime, E^\prime \rangle in which the cycle C is "contracted" into one node as follows: The nodes of V^\prime are the nodes of V not in C plus a ''new'' node denoted v_C. * If (u,v) is an edge in E with u\notin C and v\in C (an edge coming into the cycle), then include in E^\prime a new edge e = (u, v_C), and define w^\prime(e) = w(u,v) - w(\pi(v),v). * If (u,v) is an edge in E with u\in C and v\notin C (an edge going away from the cycle), then include in E^\prime a new edge e = (v_C, v), and define w^\prime(e) = w(u,v) . * If (u,v) is an edge in E with u\notin C and v\notin C (an edge unrelated to the cycle), then include in E^\prime a new edge e = (u, v), and define w^\prime(e) = w(u,v) . For each edge in E^\prime, we remember which edge in E it corresponds to. Now find a minimum spanning arborescence A^\prime of D^\prime using a call to f(D^\prime, r,w^\prime). Since A^\prime is a spanning arborescence, each vertex has exactly one incoming edge. Let (u, v_C) be the unique incoming edge to v_C in A^\prime. This edge corresponds to an edge (u,v) \in E with v \in C. Remove the edge (\pi(v),v) from C, breaking the cycle. Mark each remaining edge in C. For each edge in A^\prime, mark its corresponding edge in E. Now we define f(D, r, w) to be the set of marked edges, which form a minimum spanning arborescence. Observe that f(D, r, w) is defined in terms of f(D^\prime, r, w^\prime), with D^\prime having strictly fewer vertices than D. Finding f(D, r, w) for a single-vertex graph is trivial (it is just D itself), so the recursive algorithm is guaranteed to terminate.


Running time

The running time of this algorithm is O(EV). 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 algorithms, including Tarjan's off-line lowest common ancestors algorithm, and co-inventor of both splay trees a ...
runs in time O(E \log V) for
sparse graph In mathematics, a dense graph is a graph in which the number of edges is close to the maximal number of edges (where every pair of vertices is connected by one edge). The opposite, a graph with only a few edges, is a sparse graph. The distinction ...
s and O(V^2) for dense graphs. This is as fast as
Prim's algorithm In computer science, Prim's algorithm (also known as Jarník's algorithm) is a greedy algorithm that finds a minimum spanning tree for a weighted undirected graph. This means it finds a subset of the edges that forms a tree that includes every ve ...
for an undirected minimum spanning tree. In 1986, Gabow,
Galil The IMI Galil ( he, גליל) 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 ...
, Spencer, and Tarjan produced a faster implementation, with running time O(E + V \log V).


References

* * * * * * {{citation , first1=H. N. , last1=Gabow, author1-link=Harold N. Gabow , first2=Z., last2=Galil, author2-link=Zvi Galil , first3=T., last3=Spencer , first4=R. E., last4=Tarjan , author4-link=Robert Tarjan , title=Efficient algorithms for finding minimum spanning trees in undirected and directed graphs, journal= Combinatorica , volume=6 , issue=2 , year=1986, pages= 109–122 , doi=10.1007/bf02579168, s2cid=35618095


External links


Edmonds's algorithm ( edmonds-alg )
– An implementation of Edmonds's algorithm written in
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
and licensed under the
MIT License The MIT License is a permissive free software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts only very limited restriction on reuse and has, therefore, high license comp ...
. 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 (pro ...
library distributed under
BSD The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
, has an implementation o
Edmonds' Algorithm
Graph algorithms