<p>The minimum spanning tree problem is to take a connected weighted graph and find the subset of its edges with the lowest total weight while keeping the graph connected (and as a consequence resulting in an acyclic graph).</p>

<p>The algorithm I am considering is:</p>

<ul>
<li>Find all cycles.</li>
<li>remove the largest edge from each cycle.</li>
</ul>

<p>The impetus for this version is an environment that is restricted to "rule satisfaction" without any iterative constructs. It might also be applicable to insanely parallel hardware (i.e. a system where you expect to have several times more degrees of parallelism then cycles).</p>

<p>Edits:</p>

<p>The above is done in a stateless manner (all edges that are not the largest edge in any cycle are selected/kept/ignored, all others are removed).</p>

[{'answer_id': 37477, 'author': 'James A. Rosen', 'author_id': 1190, 'author_profile': 'https://Stackoverflow.com/users/1190', 'pm_score': 1, 'selected': False, 'text': "<p>What happens if two cycles overlap?  Which one has its longest edge removed first?  Does it matter if the longest edge of each is shared between the two cycles or not?</p>\n\n<p>For example:</p>\n\n<pre><code>V = { a, b, c, d }\nE = { (a,b,1), (b,c,2), (c,a,4), (b,d,9), (d,a,3) }\n</code></pre>\n\n<p>There's an a -> b -> c -> a cycle, and an a -> b -> d -> a</p>\n"}, {'answer_id': 37484, 'author': 'user3868', 'author_id': 3868, 'author_profile': 'https://Stackoverflow.com/users/3868', 'pm_score': 1, 'selected': False, 'text': "<p>Your algorithm isn't quite clearly defined.  If you have a complete graph, your algorithm would seem to entail, in the first step, removing all but the two minimum elements.  Also, listing <em>all</em> the cycles in a graph can take exponential time.</p>\n\n<p>Elaboration:</p>\n\n<p>In a graph with n nodes and an edge between every pair of nodes, there are, if I have my math right, n!/(2k(n-k)!) cycles of size k, if you're counting a cycle as some subgraph of k nodes and k edges with each node having degree 2.</p>\n"}, {'answer_id': 37492, 'author': 'Kyle Cronin', 'author_id': 658, 'author_profile': 'https://Stackoverflow.com/users/658', 'pm_score': 1, 'selected': False, 'text': "<p>@shrughes.blogspot.com:</p>\n\n<p>I don't know about removing all but two - I've been sketching out various runs of the algorithm and assuming that parallel runs may remove an edge more than once I can't find a situation where I'm left without a spanning tree. Whether or not it's minimal I don't know.</p>\n"}, {'answer_id': 37537, 'author': 'Tynan', 'author_id': 3548, 'author_profile': 'https://Stackoverflow.com/users/3548', 'pm_score': 1, 'selected': False, 'text': '<p>For this to work, you\'d have to detail how you would want to find all cycles, apparently without any iterative constructs, because that is a non-trivial task.  I\'m not sure that\'s possible.  If you really want to find a MST algorithm that doesn\'t use iterative constructs, take a look at <a href="http://en.wikipedia.org/wiki/Prim%27s_algorithm" rel="nofollow noreferrer">Prim\'s</a> or <a href="http://en.wikipedia.org/wiki/Kruskal%27s_algorithm" rel="nofollow noreferrer">Kruskal\'s</a> algorithm and see if you could modify those to suit your needs.</p>\n\n<p>Also, is recursion barred in this theoretical architecture?  If so, it might actually be impossible to find a MST on a graph, because you\'d have no means whatsoever of inspecting every vertex/edge on the graph.</p>\n'}, {'answer_id': 37562, 'author': 'Marcin', 'author_id': 3105, 'author_profile': 'https://Stackoverflow.com/users/3105', 'pm_score': 1, 'selected': False, 'text': '<p>I dunno if it works, but no matter what <strong>your algorithm is not even worth implementing</strong>. Finding <em>all</em> cycles will be the freaking huge bottleneck that will kill it. Also doing that without iterations is impossible. Why don\'t you implement some standard algorithm, let\'s say <a href="http://en.wikipedia.org/wiki/Prim%27s_algorithm" rel="nofollow noreferrer">Prim\'s</a>.</p>\n'}, {'answer_id': 38335, 'author': 'BCS', 'author_id': 1343, 'author_profile': 'https://Stackoverflow.com/users/1343', 'pm_score': 0, 'selected': False, 'text': '<p>@Tynan The system can be described (somewhat over simplified) as a systems of rules describing categorizations. "Things are in category A if they are in B but not in C", "Nodes connected to nodes in Z are also in Z", "Every category in M is connected to a node N and has \'child\' categories, also in M for every node connected to N". It\'s slightly more complicated than this. (I have shown that by creating unstable rules you can model a turning machine but that\'s beside the point.) It can\'t explicitly define iteration or recursion but can operate on recursive data with rules like the 2nd and 3rd ones.</p>\n\n<p>@Marcin, Assume that there are an unlimited number of processors. It is trivial to show that the program can be run in O(n^2) for n being the longest cycle. With better data structures, this can be reduced to O(n*O(set lookup function)), I can envision hardware (quantum computers?) that can evaluate all cycles in constant time. giving a O(1) solution to the MST problem.</p>\n\n<p>The <a href="http://en.wikipedia.org/wiki/Reverse-Delete_algorithm" rel="nofollow noreferrer">Reverse-delete algorithm</a> seems to provide a partial proof of correctness (that the proposed algorithm will not produce a non-minimal spanning tree) this is derived by arguing that mt algorithm will remove every edge that the Reverse-delete algorithm will. However I\'m not sure how to show that my algorithm won\'t delete more than that algorithm. </p>\n\n<p>Hhmm....</p>\n'}, {'answer_id': 38467, 'author': 'BCS', 'author_id': 1343, 'author_profile': 'https://Stackoverflow.com/users/1343', 'pm_score': 0, 'selected': False, 'text': "<p>OK this is an attempt to finish the proof of correctness. By analogy to the Reverse-delete algorithm, we know that enough edges will be removed. What remains is to show that there will not be to many edges removed. </p>\n\n<p>Removing to many edges can be described as removing all the edges between the side of a binary partition of the graph nodes. However only edges in a cycle are ever removed, therefor, for all edge between partitions to be removed, there needs to be a return path to complete the cycle. If we only consider edges between the partitions then the algorithm can at most remove the larger of each pair of edges, this can never remove the smallest bridging edge. Therefor for any arbitrary binary partitioning, the algorithm can't sever all links between the side.</p>\n\n<p>What remains is to show that this extends to >2 way partitions.</p>\n"}]
['https://Stackoverflow.com/questions/37471', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1343/']