<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=78.63.225.128</id>
	<title>formulasearchengine - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=78.63.225.128"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/wiki/Special:Contributions/78.63.225.128"/>
	<updated>2026-09-16T07:27:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.47.0-wmf.7</generator>
	<entry>
		<id>https://en.formulasearchengine.com/w/index.php?title=Element_(category_theory)&amp;diff=17250</id>
		<title>Element (category theory)</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Element_(category_theory)&amp;diff=17250"/>
		<updated>2013-08-04T11:17:38Z</updated>

		<summary type="html">&lt;p&gt;78.63.225.128: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{graph search algorithm}}&lt;br /&gt;
{{about|the optimum branching algorithm|the maximum matching algorithm|Blossom algorithm}}&lt;br /&gt;
&lt;br /&gt;
In [[graph theory]], a branch of mathematics, &#039;&#039;&#039;Edmonds&#039; algorithm&#039;&#039;&#039; or &#039;&#039;&#039;Chu–Liu/Edmonds&#039; algorithm&#039;&#039;&#039; is an [[algorithm]] for finding a maximum or minimum &#039;&#039;optimum branchings&#039;&#039;. This is similar to the [[minimum spanning tree]] problem which concerns undirected graphs. However, when nodes are connected by weighted edges that are [[Directed graph|directed]], a [[minimum spanning tree]] algorithm cannot be used.&lt;br /&gt;
&lt;br /&gt;
The optimum branching algorithm was proposed independently first by Yoeng-jin Chu and Tseng-hong Liu (1965) and then by [[Jack Edmonds|Edmonds]] (1967). To find a maximum path length, the largest edge value is found and connected between the two nodes, then the next largest value, and so on. If an edge creates a loop, it is erased.  A minimum path length is found by starting from the smallest value.&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&#039;s algorithm]] for an undirected minimum spanning tree. In 1986, Gabow, Galil, Spencer, and 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;
==Algorithm==&lt;br /&gt;
===Description===&lt;br /&gt;
The algorithm has a conceptual recursive description. We will denote by &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; the function which, given a weighted directed graph &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; with a distinguished vertex &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; called the &#039;&#039;root&#039;&#039;, returns a spanning tree rooted at &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; of minimal cost.&lt;br /&gt;
&lt;br /&gt;
The precise description is as follows. Given a weighted directed graph &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; with root &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; we first 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, mark an (arbitrarily chosen) incoming edge of lowest cost. Denote the other endpoint of this edge by &amp;lt;math&amp;gt;\pi(v)&amp;lt;/math&amp;gt;. The edge is now denoted as &amp;lt;math&amp;gt;(\pi(v),v)&amp;lt;/math&amp;gt; with associated cost &amp;lt;math&amp;gt;w(\pi(v),v)&amp;lt;/math&amp;gt;. If the marked edges form an SRT ([[Shortest path tree|Shortest Route Tree]]), &amp;lt;math&amp;gt;f(D)&amp;lt;/math&amp;gt; is defined to be this SRT. Otherwise, the set of marked edges form at least one cycle. Call (an arbitrarily chosen) one of these cycles &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;. We now define a weighted directed graph &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt; having a root &amp;lt;math&amp;gt;r^\prime&amp;lt;/math&amp;gt; as follows. The nodes of &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt; are the nodes of &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; not in &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt; plus a &#039;&#039;new&#039;&#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;D&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;, then include in &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt; the edge &amp;lt;math&amp;gt;e = (u, v_C)&amp;lt;/math&amp;gt;, and define &amp;lt;math&amp;gt;w(e) = w(u,v) - w(\pi(v),v)&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;D&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;, then include in &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt; the edge &amp;lt;math&amp;gt;e = (v_C, v)&amp;lt;/math&amp;gt;, and define &amp;lt;math&amp;gt;w(e) = w(u,v) &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;D&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;, then include in &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt; the edge &amp;lt;math&amp;gt;e = (u, v)&amp;lt;/math&amp;gt;, and define &amp;lt;math&amp;gt;w(e) = w(u,v) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We include no other edges in &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The root &amp;lt;math&amp;gt;r^\prime&amp;lt;/math&amp;gt; of &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt; is simply the root &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Using a call to &amp;lt;math&amp;gt;f(D^\prime)&amp;lt;/math&amp;gt;, find an SRT of &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt;. First, mark in &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; all shared edges with &amp;lt;math&amp;gt; D^\prime&amp;lt;/math&amp;gt; that are marked in the SRT of &amp;lt;math&amp;gt;D^\prime&amp;lt;/math&amp;gt;. Also, mark in &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; all the edges in &amp;lt;math&amp;gt; C &amp;lt;/math&amp;gt;. Now, suppose that in the SRT of &amp;lt;math&amp;gt; D^\prime&amp;lt;/math&amp;gt;, the (unique) incoming edge at &amp;lt;math&amp;gt;v_C&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;(u, v_C)&amp;lt;/math&amp;gt;. This edge comes from some pair &amp;lt;math&amp;gt;(u,v)&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;. Unmark &amp;lt;math&amp;gt;(\pi(v),v)&amp;lt;/math&amp;gt; and mark &amp;lt;math&amp;gt;(u,v)&amp;lt;/math&amp;gt;. Also, for each marked &amp;lt;math&amp;gt;(v_C,v)&amp;lt;/math&amp;gt; in the SRT of &amp;lt;math&amp;gt; D^\prime&amp;lt;/math&amp;gt; and coming from an edge &amp;lt;math&amp;gt; (u,v) &amp;lt;/math&amp;gt; in &amp;lt;math&amp;gt; D &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;, mark the edge &amp;lt;math&amp;gt; (u,v)&amp;lt;/math&amp;gt;. Now the set of marked edges do form an SRT, which we define to be the value of &amp;lt;math&amp;gt;f(D)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Observe that &amp;lt;math&amp;gt;f(D)&amp;lt;/math&amp;gt; is defined in terms of &amp;lt;math&amp;gt;f(D^\prime)&amp;lt;/math&amp;gt; for weighted directed rooted graphs &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;, and finding &amp;lt;math&amp;gt;f(D)&amp;lt;/math&amp;gt; for a single-vertex graph is trivial.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
Let BV be a vertex bucket and BE be an edge bucket. Let &#039;&#039;v&#039;&#039; be a vertex and &#039;&#039;e&#039;&#039; be an edge of maximum positive weight that is incident to &#039;&#039;v.&#039;&#039; C&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt; is a circuit. G&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; = (V&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;,E&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt;) is the original digraph. &#039;&#039;u&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;&#039;&#039; is a replacement vertex for C&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 &amp;lt;math&amp;gt;BV \leftarrow BE \leftarrow \varnothing&amp;lt;/math&amp;gt;&lt;br /&gt;
 i=0&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
 A:&lt;br /&gt;
 if &amp;lt;math&amp;gt;BV = V_i&amp;lt;/math&amp;gt; then goto B&lt;br /&gt;
 for some vertex &amp;lt;math&amp;gt;v \notin BV&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v \in V_i &amp;lt;/math&amp;gt; {&lt;br /&gt;
    &amp;lt;math&amp;gt;BV \leftarrow BV \cup \lbrace v\rbrace&amp;lt;/math&amp;gt;&lt;br /&gt;
    find an edge &amp;lt;math&amp;gt; e = (x,v) &amp;lt;/math&amp;gt; such that w(e) = max{ w(y,v)|(y,v) &amp;lt;math&amp;gt;\in&amp;lt;/math&amp;gt; E&amp;lt;sub&amp;gt;i&amp;lt;/sub&amp;gt;}&lt;br /&gt;
    if w(e) &amp;amp;le; 0 then goto A&lt;br /&gt;
 }&lt;br /&gt;
 if &amp;lt;math&amp;gt;BE \cup \lbrace e\rbrace&amp;lt;/math&amp;gt; contains a circuit {&lt;br /&gt;
    i=i+1&lt;br /&gt;
    construct &amp;lt;math&amp;gt;G_i&amp;lt;/math&amp;gt; by shrinking &amp;lt;math&amp;gt;C_i&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt;&lt;br /&gt;
    modify BE, BV and some edge weights&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;math&amp;gt;BE \leftarrow BE \cup {e}&amp;lt;/math&amp;gt;&lt;br /&gt;
 goto A&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
 B:&lt;br /&gt;
 while i &amp;amp;ne; 0 {&lt;br /&gt;
    reconstruct &amp;lt;math&amp;gt;G_{i-1}&amp;lt;/math&amp;gt; and rename some edges in BE&lt;br /&gt;
    if &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; was a root of an out-tree in BE {&lt;br /&gt;
        &amp;lt;math&amp;gt;BE \leftarrow BE \cup \lbrace e|e \in C_i &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; e \ne e_0^i\rbrace&amp;lt;/math&amp;gt;&lt;br /&gt;
    }else{&lt;br /&gt;
        &amp;lt;math&amp;gt;BE \leftarrow BE \cup \lbrace e|e \in C_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;e \ne \tilde{e}_i\rbrace&amp;lt;/math&amp;gt;&lt;br /&gt;
    }&lt;br /&gt;
    i=i-1&lt;br /&gt;
 }&lt;br /&gt;
 Maximum branching weight = &amp;lt;math&amp;gt;\sum_{e \in BE} w(e)&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
* Y. J. Chu and T. H. Liu, &amp;quot;On the Shortest Arborescence of a Directed Graph&amp;quot;, &#039;&#039;Science Sinica&#039;&#039;, vol. 14, 1965, pp.&amp;amp;nbsp;1396–1400.&lt;br /&gt;
* J. Edmonds, “Optimum Branchings”, &#039;&#039;J. Res. Nat. Bur. Standards&#039;&#039;, vol. 71B, 1967, pp.&amp;amp;nbsp;233–240.&lt;br /&gt;
* [[Robert Tarjan|R. E. Tarjan]], &amp;quot;Finding Optimum Branchings&amp;quot;, Networks, v.7, 1977, pp.&amp;amp;nbsp;25–35.&lt;br /&gt;
* P.M. Camerini, L. Fratta, and F. Maffioli, &amp;quot;A note on finding optimum branchings&amp;quot;, Networks, v.9, 1979, pp.&amp;amp;nbsp;309–312.&lt;br /&gt;
* Alan Gibbons &#039;&#039;Algorithmic Graph Theory,&#039;&#039; Cambridge University press, 1985 ISBN 0-521-28881-9&lt;br /&gt;
* H. N. Gabow, Z. Galil, T. Spencer, and R. E. Tarjan, “Efficient algorithms for finding minimum spanning trees in undirected and directed graphs,” Combinatorica 6 (1986), 109-122.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
*[http://www.ce.rit.edu/~sjyeec/dmst.html The Directed Minimum Spanning Tree Problem ] Description of the algorithm summarized by Shanchieh Jay Yang, May 2000.&lt;br /&gt;
*[http://edmonds-alg.sourceforge.net/ Edmonds&#039;s algorithm ( edmonds-alg )] – An [[open source]] implementation of Edmonds&#039;s algorithm written in [[C++]] and licensed under the [[MIT License]]. This source is using Tarjan&#039;s implementation for the dense graph.&lt;br /&gt;
&lt;br /&gt;
[[Category:Graph algorithms]]&lt;/div&gt;</summary>
		<author><name>78.63.225.128</name></author>
	</entry>
</feed>