Tutorials › Graph Theory (Undergraduate) › Tied Weights And Multiple Minimum Spanning Trees

Minimum Spanning Trees · Tutorial 150 of 799

Tied Weights And Multiple Minimum Spanning Trees

See when equal-weight edges allow different minimum spanning trees—and why a tie on a cycle alone is not enough.

Intermediate 10 min read

What You'll Learn

  • Identify when swapping equal-weight edges produces another minimum spanning tree.
  • Test uniqueness using the paths in a fixed minimum spanning tree.
  • Explain why tied maximum edges on some cycles affect uniqueness but others do not.
  • Compute and compare the weights of spanning trees in explicit examples.
  • Avoid inferring nonuniqueness from a cycle tie alone.

When a Tie Matters

When several edges have the same weight, an algorithm for finding a minimum spanning tree may have choices. Sometimes different choices lead to distinct minimum spanning trees of the same total weight. Sometimes the tied edges are irrelevant: every minimum spanning tree uses the same edges, even though some weights repeat. The key is not merely whether weights tie, or whether a cycle has a tied maximum, but whether an equal-weight exchange is possible within a minimum spanning tree.

Throughout, let \(G=(V,E)\) be a finite, connected, simple graph with edge-weight function \(w:E\to\mathbb{R}\). A spanning tree is a connected, acyclic subgraph containing every vertex of \(G\). A minimum spanning tree (MST) is a spanning tree whose total weight, the sum of its edge weights, is least among all spanning trees of \(G\). We assume \(G\) is connected so that a spanning tree exists. If \(G\) has one vertex and no edges, its empty edge set is its unique spanning tree and MST.

For a tree \(T\) and an edge \(e=uv\) not in \(T\), there is a unique \(u\)-\(v\) path in \(T\). Adding \(e\) to \(T\) creates a cycle consisting of that path and \(e\); this is the fundamental cycle of \(e\) with respect to \(T\). We will use this cycle to test whether a tie can produce a different MST.

Theorem: Let \(T\) be an MST of a connected weighted graph \(G\). Then \(T\) is the unique MST if and only if, for every edge \(e\in E\setminus E(T)\), \(w(e)\) is strictly greater than the weight of every edge on the \(T\)-path between the endpoints of \(e\).

Proof. First note that for any \(e\notin E(T)\), every edge \(f\) on its \(T\)-path satisfies \(w(f)\leq w(e)\). If instead \(w(f)>w(e)\), adding \(e\) and deleting \(f\) would give a spanning tree of smaller total weight than \(T\), contradicting that \(T\) is an MST.

If the strict condition fails for some non-tree edge \(e\), the inequality just proved means that some edge \(f\) on its \(T\)-path has \(w(f)=w(e)\). Adding \(e\) to \(T\) creates its fundamental cycle, which contains \(f\). Deleting \(f\) breaks that cycle and leaves a spanning tree: the added edge reconnects the two components formed by deleting \(f\) from \(T\). The new tree has the same total weight as \(T\), since it replaces \(f\) by \(e\) of equal weight. It is distinct from \(T\), so \(T\) is not unique.

Conversely, suppose the strict condition holds, but that \(T'\) is a different MST. Choose \(e\in E(T')\setminus E(T)\). Deleting \(e\) from \(T'\) separates \(T'\) into two components. The \(T\)-path between the endpoints of \(e\) crosses between those components, so it contains an edge \(f\) whose endpoints are in different components. This \(f\) cannot be in \(T'\), because the only edge deleted from \(T'\) was \(e\), and every other edge of \(T'\) stays within one of the two components. Thus \(f\in E(T)\setminus E(T')\). By the strict condition, \(w(f)<w(e)\). But \(T'-e+f\) is a spanning tree with smaller total weight than \(T'\): \(f\) reconnects the two components, and it is lighter than the removed edge \(e\). That contradicts the minimality of \(T'\). Hence no such distinct \(T'\) exists, and \(T\) is unique. \(\square\)

This criterion makes the role of a tie precise. If a non-tree edge ties in weight with an edge on its path in \(T\), exchanging them gives a second MST. If every non-tree edge is strictly heavier than every edge on its \(T\)-path, no such equal-weight exchange is possible, and the criterion proves that \(T\) is unique.

Worked Examples

Worked Example: A Tied Cycle Maximum Gives Two MSTs

Let \(G\) have vertex set \(V=\{a,b,c\}\) and edge set \(E=\{ab,bc,ca\}\), with weights \(w(ab)=1\), \(w(bc)=4\), and \(w(ca)=4\). This graph is a triangle whose maximum edge weight is attained twice.

A spanning tree on these three vertices consists of any two edges of the triangle. There are exactly three possibilities, since a spanning tree must omit one of the triangle's three edges. Omitting \(ab\) gives weight \(w(bc)+w(ca)=4+4=8\). Omitting \(bc\) gives \(w(ab)+w(ca)=1+4=5\). Omitting \(ca\) gives \(w(ab)+w(bc)=1+4=5\).

Therefore the two trees with edge sets \(\{ab,ca\}\) and \(\{ab,bc\}\) are both MSTs, each of total weight \(5\). They differ by exchanging the tied edges \(ca\) and \(bc\), while keeping \(ab\).

Check: the three possible spanning-tree weights are \(8\), \(5\), and \(5\), so \(5\) is the minimum and it is attained twice. For the tree with edges \(ab,ca\), the non-tree edge \(bc\) has weight \(4\), and its tree path \(b,a,c\) contains edges of weights \(1\) and \(4\). The tie with \(ca\) is exactly the exchange described by the theorem.

Worked Example: A Tie Below the Cycle Maximum Does Not Break Uniqueness

Let \(G\) have vertex set \(V=\{a,b,c\}\) and edge set \(E=\{ab,bc,ca\}\), with weights \(w(ab)=1\), \(w(bc)=1\), and \(w(ca)=3\). The two weight-\(1\) edges are tied, but they are not maximum-weight edges on the triangle.

Again, list all three spanning trees. The tree \(\{ab,bc\}\) has total weight \(1+1=2\). The tree \(\{ab,ca\}\) has total weight \(1+3=4\), and the tree \(\{bc,ca\}\) has total weight \(1+3=4\). Thus \(\{ab,bc\}\) is the unique MST.

Check: in this MST, the only non-tree edge is \(ca\), of weight \(3\). Its tree path from \(c\) to \(a\) uses \(bc\) and \(ab\), both of weight \(1\). Since \(3>1\) for each path edge, the theorem confirms uniqueness. The repeated weight \(1\) does not allow a same-weight exchange: replacing either tree edge by \(ca\) would increase the total weight from \(2\) to \(4\).

Worked Example: A Tied Cycle Maximum Can Be Irrelevant

A tied maximum on a cycle is not, by itself, enough to conclude that there are multiple MSTs. Let \(G\) have vertex set \(V=\{1,2,3,4\}\) and edge set \(E=\{14,12,13,23,34\}\), with weights \(w(14)=1\), \(w(12)=2\), \(w(13)=3\), \(w(23)=5\), and \(w(34)=5\).

The cycle \(1,2,3,4,1\) has edge weights \(2,5,5,1\), so its maximum weight, \(5\), occurs twice. Consider the tree \(T\) with edge set \(\{14,12,13\}\). It is connected, since vertices \(4,2,3\) are each joined to \(1\), and it has no cycle. Its total weight is \(1+2+3=6\).

The non-tree edges are \(23\) and \(34\). The path in \(T\) between \(2\) and \(3\) is \(2,1,3\), with edge weights \(2\) and \(3\); the edge \(23\) has weight \(5\), strictly greater than both. The path in \(T\) between \(3\) and \(4\) is \(3,1,4\), with edge weights \(3\) and \(1\); the edge \(34\) has weight \(5\), again strictly greater than both. The theorem therefore shows that \(T\) is the unique MST, despite the tied maximum on the displayed cycle.

Check: the two non-tree-edge comparisons are \(5>2\), \(5>3\), \(5>3\), and \(5>1\). Each is strict, so neither non-tree edge ties an edge on its path in \(T\). The tie between \(23\) and \(34\) does not produce an equal-weight exchange in this MST.

How Cycle Ties Relate to the Test

The examples separate two claims that are easy to confuse. In the first example, two maximum-weight edges on a cycle can be exchanged while retaining a minimum total weight. In the third, two maximum-weight edges on a cycle exist, but both are heavier than the edges on their paths in the unique MST, so neither can replace a tree edge without increasing the total weight. The relevant question is not just whether a cycle has a tied maximum; it is whether a non-tree edge ties an edge on its path in an MST.

There is a useful special case. If the whole graph is a cycle, every spanning tree is obtained by deleting one edge. If the maximum edge weight on that cycle is attained at least twice, deleting either of two maximum-weight edges leaves a spanning tree of the same minimum total weight. If instead the maximum occurs only once, deleting that unique heaviest edge gives the unique minimum-weight spanning tree of the cycle. In graphs with additional edges, the situation can differ, as the third example demonstrates.

A common mistake is to apply the special case for a graph that is itself a cycle to any cycle inside a larger graph.

Common pitfall: “This cycle has two maximum-weight edges, so the graph has multiple MSTs” is not a valid conclusion. A tied maximum guarantees an alternative only when the tie enables an equal-weight exchange in a spanning tree. Check the non-tree edge against the edges on its path in an MST.

For instance, in the third example, the cycle weights are \(2,5,5,1\), so its tied maximum is indeed \(5\). But the two non-tree edges each have weight \(5\), while the largest edge on either corresponding tree path has weight \(3\). Substituting gives \(5>3\) in both cases, so the uniqueness test passes. The correction is to examine the fundamental paths, not just the weights around an arbitrary cycle.

Why the Exchange Test Is Useful

The test is useful when a minimum spanning tree has already been found and the weights contain ties. It does not require listing every spanning tree. For each edge outside the chosen tree, find the tree path between its endpoints and compare weights. A tie with any edge on that path gives a second MST by swapping those edges. If all comparisons are strict, the proof of the theorem rules out every other MST.

This also explains why two runs of an algorithm can return different trees when ties occur, without either answer being wrong: if a valid equal-weight exchange is available, both trees have the same minimum total weight. But a different tie-breaking order does not necessarily change the result. Tied edges may be forced out of a minimum tree, or may be too heavy to replace any tree edge, as the examples show. Weight repetition signals a choice to investigate; the path comparisons determine whether it affects uniqueness.

Check Your Understanding

For each question, distinguish a tie in the graph from an equal-weight exchange in a spanning tree.

  1. In the triangle with edge weights \(2,6,6\), list all spanning trees and determine how many are MSTs.
  2. In the triangle with edge weights \(2,2,5\), use the path test to explain why the MST is unique.
  3. For a fixed MST \(T\), suppose a non-tree edge \(e\) has weight strictly greater than every edge on its \(T\)-path. What does the theorem say about exchanging \(e\) with a path edge?
  4. Why does a tied maximum on a cycle that is part of a graph with additional edges not, by itself, prove that the graph has multiple MSTs?
  5. State the condition on every non-tree edge and its path in a fixed MST that guarantees the MST is unique.