Search code examples
algorithmminimum-spanning-tree

MST - Question with cycle in length 6 or less


I came across a question that I tried to solve by myself but I didn't come up with a satisfactory enough answer.

The Question:

Given an undirected graph G = (V, E) with weight function w: E->R such that there are no two edges that have the same weight, given that G doesn't contain a cycle length of 6 or shorter.

Let e4 be the fourth edge in the weight therefore have exactly 3 edges there is less weight than e4.

Prove or disprove: every MST of G contains e4.

My Attempt:

Assume, for the sake of contradiction, that there exists an MST of G that does not contain edge e4.

Let T be an MST of G that does not contain e4.

Given that there are exactly 3 edges with weights less than the weight of e4, denote these edges as e1, e2, and e3, in non-decreasing order of weight.

Consider the removal of e4 from T. Since T is a tree, removing e4 disconnects T into two subtrees, denoted as T1 and T2, where e4 was originally connecting vertices in T1 and T2.

Since T is an MST, it must have the minimum total weight among all spanning trees of G. Thus, removing e4 and replacing it with edges e1, e2, and e3 (which are lighter than e4) must result in a spanning tree with a total weight less than that of T.

Let T' be the spanning tree obtained by replacing e4 in T with edges e1, e2, and e3.

However, T' forms a cycle of length 4 with e1, e2, e3, and an existing edge in T. This contradicts the given condition that there are no cycles of length 6 or less in G.

Therefore, our assumption that there exists an MST of G that does not contain e4 is false.

Hence, for every MST of G, the MST contains edge e4.


Solution

  • First, a critique of your attempt (your work in italics; my comments in bold):

    Assume, for the sake of contradiction, that there exists an MST of G that does not contain edge e4. Let T be an MST of G that does not contain e4. Given that there are exactly 3 edges with weights less than the weight of e4, denote these edges as e1, e2, and e3, in non-decreasing order of weight. Consider the removal of e4 from T. Since T is a tree, removing e4 disconnects T into two subtrees, denoted as T1 and T2, where e4 was originally connecting vertices in T1 and T2. Since T is an MST, it must have the minimum total weight among all spanning trees of G.

    You can't remove e4 from T since you already assumed T didn't contain e4.

    Thus, removing e4 and replacing it with edges e1, e2, and e3 (which are lighter than e4) must result in a spanning tree with a total weight less than that of T.

    This is wrong. Every spanning tree on n vertices has n-1 edges. If you replace one edge with three, then you no longer have a spanning tree.

    Now, I'll stop reviewing your approach and show a way to prove this.

    • Let G be as defined above, and let T be a MST of G.
    • Let e1, e2, e3, e4, ... be the edges in ascending order of weight.
    • Let (a, b) be the endpoints of e4.
    • Suppose e4 isn't in T.
    • Consider T U {e4}, the graph (not tree) formed by including e4 in with the edges of T. Since T is an MST, T contains a path between every pair of vertices, in particular, it must have a path between a and b. This path, together with e4, form a cycle in T U {e4}. Since all edges are in E, this cycle must also exist in G, and therefore must have length >= 6.
    • This means, there are at least 5 other edges in this cycle. Since there are only 3 edges smaller than e4 in E, at least two of these edges must be bigger.
    • Form T' from T U {e4} by deleting one of the heavier edges from the cycle.
    • Then, T' is a spanning tree with a lower overall weight, which is a contradiction.