<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Edmonds%27_algorithm</id>
	<title>Edmonds&#039; algorithm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Edmonds%27_algorithm"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Edmonds%27_algorithm&amp;action=history"/>
	<updated>2026-05-04T21:33:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Edmonds%27_algorithm&amp;diff=4773253&amp;oldid=prev</id>
		<title>imported&gt;DanilaBudylyov: /* External links */</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Edmonds%27_algorithm&amp;diff=4773253&amp;oldid=prev"/>
		<updated>2025-01-23T15:31:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;External links&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Algorithm for the directed version of the minimum spanning tree problem}}&lt;br /&gt;
{{about|the optimum branching algorithm|the maximum matching algorithm|Blossom algorithm}}&lt;br /&gt;
&lt;br /&gt;
In [[graph theory]], &amp;#039;&amp;#039;&amp;#039;Edmonds&amp;#039; algorithm&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;Chu–Liu/Edmonds&amp;#039; algorithm&amp;#039;&amp;#039;&amp;#039; is an [[algorithm]] for finding a [[spanning subgraph|spanning]] [[Arborescence (graph theory)|arborescence]] of minimum weight (sometimes called an &amp;#039;&amp;#039;optimum branching&amp;#039;&amp;#039;).&amp;lt;ref&amp;gt; The algorithm is applicable to finding a minimum spanning forest with given roots. However, when searching for the minimum spanning forest among all &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-component spanning forests, a multiplier arises in the complexity of the algorithm &lt;br /&gt;
 &amp;lt;math&amp;gt;C_V^k&amp;lt;/math&amp;gt;, 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 &lt;br /&gt;
&amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; 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). &lt;br /&gt;
It builds a sequence of minimal &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-component spanning forests for all &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; up to the minimum spanning tree. The Chu-Liu/Edmonds algorithm is a component of it. &amp;lt;/ref&amp;gt;&lt;br /&gt;
It is the [[Directed graph|directed]] analog of the [[minimum spanning tree]] problem.&lt;br /&gt;
The algorithm was proposed independently first by Yoeng-Jin Chu and Tseng-Hong Liu (1965) and then by [[Jack Edmonds]] (1967).&lt;br /&gt;
&lt;br /&gt;
==Algorithm==&lt;br /&gt;
&lt;br /&gt;
===Description===&lt;br /&gt;
The algorithm takes as input a directed graph &amp;lt;math&amp;gt;D = \langle V, E \rangle&amp;lt;/math&amp;gt; where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the set of nodes and &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; is the set of directed edges, a distinguished vertex &amp;lt;math&amp;gt;r \in V&amp;lt;/math&amp;gt; called the &amp;#039;&amp;#039;root&amp;#039;&amp;#039;, and a real-valued weight &amp;lt;math&amp;gt;w(e)&amp;lt;/math&amp;gt; for each edge &amp;lt;math&amp;gt;e \in E&amp;lt;/math&amp;gt;.&lt;br /&gt;
It returns a spanning [[Arborescence (graph theory)|arborescence]] &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; rooted at &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; of minimum weight, where the weight of an arborescence is defined to be the sum of its edge weights, &amp;lt;math&amp;gt;w(A) = \sum_{e \in A}{w(e)}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The algorithm has a recursive description.&lt;br /&gt;
Let &amp;lt;math&amp;gt;f(D, r, w)&amp;lt;/math&amp;gt; denote the function which returns a spanning arborescence rooted at &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; of minimum weight.&lt;br /&gt;
We first remove any edge from &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; whose destination is &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;.&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
Now, for each node &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; other than the root, find the edge incoming to &amp;lt;math&amp;gt;v&amp;lt;/math&amp;gt; of lowest weight (with ties broken arbitrarily).&lt;br /&gt;
Denote the source of this edge by &amp;lt;math&amp;gt;\pi(v)&amp;lt;/math&amp;gt;.&lt;br /&gt;
If the set of edges &amp;lt;math&amp;gt;P = \{(\pi(v),v) \mid v \in V \setminus \{ r \} \}&amp;lt;/math&amp;gt; does not contain any cycles, then &amp;lt;math&amp;gt;f(D,r,w) = P&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Otherwise, &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; contains at least one cycle.&lt;br /&gt;
Arbitrarily choose one of these cycles and call it &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;.&lt;br /&gt;
We now define a new weighted directed graph &amp;lt;math&amp;gt;D^\prime = \langle V^\prime, E^\prime \rangle&amp;lt;/math&amp;gt; in which the cycle &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; is &amp;quot;contracted&amp;quot; into one node as follows:&lt;br /&gt;
&lt;br /&gt;
The nodes of &amp;lt;math&amp;gt;V^\prime&amp;lt;/math&amp;gt; are the nodes of &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; not in &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; plus a &amp;#039;&amp;#039;new&amp;#039;&amp;#039; node denoted &amp;lt;math&amp;gt;v_C&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* If &amp;lt;math&amp;gt;(u,v)&amp;lt;/math&amp;gt; is an edge in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;u\notin C&amp;lt;/math&amp;gt;  and &amp;lt;math&amp;gt;v\in C&amp;lt;/math&amp;gt; (an edge coming into the cycle), then include in &amp;lt;math&amp;gt;E^\prime&amp;lt;/math&amp;gt; a new edge &amp;lt;math&amp;gt;e = (u, v_C)&amp;lt;/math&amp;gt;, and define &amp;lt;math&amp;gt;w^\prime(e) = w(u,v) - w(\pi(v),v)&amp;lt;/math&amp;gt;.&lt;br /&gt;
* If &amp;lt;math&amp;gt;(u,v)&amp;lt;/math&amp;gt; is an edge in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;u\in C&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v\notin C&amp;lt;/math&amp;gt; (an edge going away from the cycle), then include in &amp;lt;math&amp;gt;E^\prime&amp;lt;/math&amp;gt; a new edge &amp;lt;math&amp;gt;e = (v_C, v)&amp;lt;/math&amp;gt;, and define &amp;lt;math&amp;gt;w^\prime(e) = w(u,v) &amp;lt;/math&amp;gt;.&lt;br /&gt;
* If &amp;lt;math&amp;gt;(u,v)&amp;lt;/math&amp;gt; is an edge in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;u\notin C&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v\notin C&amp;lt;/math&amp;gt; (an edge unrelated to the cycle), then include in &amp;lt;math&amp;gt;E^\prime&amp;lt;/math&amp;gt; a new edge &amp;lt;math&amp;gt;e = (u, v)&amp;lt;/math&amp;gt;, and define &amp;lt;math&amp;gt;w^\prime(e) = w(u,v) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For each edge in &amp;lt;math&amp;gt;E^\prime&amp;lt;/math&amp;gt;, we remember which edge in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt; it corresponds to.&lt;br /&gt;
&lt;br /&gt;
Now find a minimum spanning arborescence &amp;lt;math&amp;gt;A^\prime&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt; using a call to &amp;lt;math&amp;gt;f(D^\prime, r,w^\prime)&amp;lt;/math&amp;gt;.&lt;br /&gt;
Since &amp;lt;math&amp;gt;A^\prime&amp;lt;/math&amp;gt; is a spanning arborescence, each vertex has exactly one incoming edge.&lt;br /&gt;
Let &amp;lt;math&amp;gt;(u, v_C)&amp;lt;/math&amp;gt; be the unique incoming edge to &amp;lt;math&amp;gt;v_C&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;A^\prime&amp;lt;/math&amp;gt;.&lt;br /&gt;
This edge corresponds to an edge &amp;lt;math&amp;gt;(u,v) \in E&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;v \in C&amp;lt;/math&amp;gt;.&lt;br /&gt;
Remove the edge &amp;lt;math&amp;gt;(\pi(v),v)&amp;lt;/math&amp;gt; from &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;, breaking the cycle.&lt;br /&gt;
Mark each remaining edge in &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;.&lt;br /&gt;
For each edge in &amp;lt;math&amp;gt;A^\prime&amp;lt;/math&amp;gt;, mark its corresponding edge in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;.&lt;br /&gt;
Now we define &amp;lt;math&amp;gt;f(D, r, w)&amp;lt;/math&amp;gt; to be the set of marked edges, which form a minimum spanning arborescence.&lt;br /&gt;
&lt;br /&gt;
Observe that &amp;lt;math&amp;gt;f(D, r, w)&amp;lt;/math&amp;gt; is defined in terms of &amp;lt;math&amp;gt;f(D^\prime, r, w^\prime)&amp;lt;/math&amp;gt;, with &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt; having strictly fewer vertices than &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. Finding &amp;lt;math&amp;gt;f(D, r, w)&amp;lt;/math&amp;gt; for a single-vertex graph is trivial (it is just &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; itself), so the recursive algorithm is guaranteed to terminate.&lt;br /&gt;
&lt;br /&gt;
==Running time==&lt;br /&gt;
The running time of this algorithm is &amp;lt;math&amp;gt;O(EV)&amp;lt;/math&amp;gt;. A faster implementation of the algorithm due to [[Robert Tarjan]] runs in time &amp;lt;math&amp;gt;O(E \log V)&amp;lt;/math&amp;gt; for [[sparse graph]]s and &amp;lt;math&amp;gt;O(V^2)&amp;lt;/math&amp;gt; for dense graphs. This is as fast as [[Prim&amp;#039;s algorithm]] for an undirected minimum spanning tree. In 1986, [[Harold N. Gabow|Gabow]], [[Zvi Galil|Galil]], Spencer, and [[Robert Tarjan|Tarjan]] produced a faster implementation, with running time &amp;lt;math&amp;gt;O(E + V \log V)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
* {{citation | first1=Yeong-Jin |last1=Chu |first2=Tseng-Hong |last2 = Liu |title= On the Shortest Arborescence of a Directed Graph |journal=Scientia Sinica |volume=XIV |issue=10 |year= 1965| pages=1396–1400 | url =https://github.com/jungyeul/chu-liu-1965/blob/main/chu-liu-1965.pdf}}&lt;br /&gt;
* {{citation | first1=J. |last1=Edmonds |title=Optimum Branchings  | journal=  Journal of Research of the National Bureau of Standards Section B | volume=71B |issue=4 |year= 1967 |pages=233–240 | doi=10.6028/jres.071b.032|doi-access=free }}&lt;br /&gt;
* {{citation | first1=R. E.|last1=Tarjan |author1-link=Robert Tarjan|title=Finding Optimum Branchings | journal =Networks | volume=7 |year=1977 | pages=25–35 | doi=10.1002/net.3230070103}}&lt;br /&gt;
* {{citation | first1=P.M.|last1= Camerini |first2= L. |last2=Fratta | first3 =F. |last3= Maffioli |title=A note on finding optimum branchings | journal=Networks | volume=9 |issue= 4 |year= 1979| pages=309–312 | doi=10.1002/net.3230090403}}&lt;br /&gt;
* {{citation | first1=Alan |last1= Gibbons |title=Algorithmic Graph Theory | publisher=Cambridge University press | year=1985 |isbn= 0-521-28881-9 }}&lt;br /&gt;
* {{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}}&lt;br /&gt;
* {{citation | first1=V. |last1=Buslov |title=Algorithm for Sequential Construction of Spanning Minimal Directed Forests  | journal=  Journal of Mathematical Sciences | volume=275 |year= 2023 |pages=117-129 | doi=10.1007/s10958-023-06666-w|doi-access=free }}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
*[https://github.com/atofigh/edmonds-alg/ Edmonds&amp;#039;s algorithm ( edmonds-alg )] – An implementation of Edmonds&amp;#039;s algorithm written in [[C++]] and licensed under the [[MIT License]]. This source is using Tarjan&amp;#039;s implementation for the dense graph.&lt;br /&gt;
*NetworkX, a [[python (programming language)|python]] library distributed under [[BSD]], has an implementation of [https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.algorithms.tree.branchings.Edmonds.html Edmonds&amp;#039; Algorithm].&lt;br /&gt;
*[https://pypi.org/project/spanning-forest-builder/ (spanning-forest-builder 0.0.2)] – Library for constructing oriented forests of minimum weight.&lt;br /&gt;
&lt;br /&gt;
{{Graph traversal algorithms}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Graph algorithms]]&lt;/div&gt;</summary>
		<author><name>imported&gt;DanilaBudylyov</name></author>
	</entry>
</feed>