From 44da8816da461d62d70d253fdcd946d12dbc5d44 Mon Sep 17 00:00:00 2001 From: Xing Shi Cai Date: Tue, 12 Nov 2024 08:55:23 +0800 Subject: [PATCH 1/2] Update 23.1.md Give a correct proof for 23.1-6 --- docs/Chap23/23.1.md | 121 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 120 insertions(+), 1 deletion(-) diff --git a/docs/Chap23/23.1.md b/docs/Chap23/23.1.md index 5c300c5f04..6e24f116cc 100755 --- a/docs/Chap23/23.1.md +++ b/docs/Chap23/23.1.md @@ -38,7 +38,126 @@ Let $A$ be any cut that causes some vertices in the cycle on once side of the cu > Show that a graph has a unique minimum spanning tree if, for every cut of the graph, there is a unique light edge crossing the cut. Show that the converse is not true by giving a counterexample. -(Removed) +**Remark:** Do not assume that all edge weights are distinct. + +--- + +### **Part 1: Proving the Forward Direction** + +**Goal:** Show that if every cut in the graph has a unique light edge crossing it, then the graph has exactly one MST. + +**Proof:** + +Assume, for contradiction, that the graph has **two distinct MSTs**, $T$ and $T'$. + +1. **Identifying an Edge in $T$ but not in $T'$:** + + - Since $T$ and $T'$ are distinct, there exists at least one edge that is in $T$ but not in $T'$. + - Let $(u, v)$ be such an edge. + +2. **Creating a Cut by Removing $(u, v)$:** + + - Removing $(u, v)$ from $T$ divides it into two connected components (since trees are acyclic and connected). + - Let $T_u$ be the set of vertices reachable from $u$ without using $(u, v)$. + - Let $T_v$ be the set of vertices reachable from $v$ without using $(u, v)$. + - The sets $T_u$ and $T_v$ form a **cut** $(T_u, T_v)$ in the graph. + +3. **Unique Light Edge Crossing the Cut:** + + - By assumption, the cut $(T_u, T_v)$ has a **unique light edge** crossing it. + - Let $(x, y)$ be this unique light edge. + - Note that $(u, v)$ crosses this cut because $u \in T_u$ and $v \in T_v$. + +4. **Analyzing the Unique Light Edge:** + + - **Case 1:** If $(x, y) \neq (u, v)$, then: + - Since $(x, y)$ is the unique light edge and not $(u, v)$, it must have a weight **less than** $w(u, v)$. + - **Constructing a New Spanning Tree:** + - Replace $(u, v)$ in $T$ with $(x, y)$ to get $T'' = T - \{ (u, v) \} \cup \{ (x, y) \}$. + - $T''$ is connected (since $(x, y)$ connects $T_u$ and $T_v$) and spans all vertices. + - The total weight of $T''$ is less than that of $T$ because $w(x, y) < w(u, v)$. + - **Contradiction:** + - $T$ was assumed to be an MST, but $T''$ has a lower total weight. + - This contradicts the minimality of $T$. + + - **Case 2:** If $(x, y) = (u, v)$, then: + - The unique light edge crossing the cut is $(u, v)$. + - **Observing $T'$:** + - Since $(u, v) \notin T'$, there must be a path from $u$ to $v$ in $T'$ (since $T'$ is connected). + - This path must cross the cut $(T_u, T_v)$ at least once. + - Let $e$ be an edge on this path that crosses the cut. + + - **Comparing Edge Weights:** + - Since $(u, v)$ is the unique light edge crossing the cut, and $e \neq (u, v)$, it follows that $w(u, v) < w(e)$. + + - **Constructing a New Spanning Tree:** + - Add $(u, v)$ to $T'$, creating a cycle. + - Remove $e$ from this cycle to get $T'' = T' + \{ (u, v) \} - \{ e \}$. + - $T''$ is connected and spans all vertices. + - The total weight of $T''$ is less than that of $T'$ because $w(u, v) < w(e)$. + + - **Contradiction:** + - $T'$ was assumed to be an MST, but $T''$ has a lower total weight. + - This contradicts the minimality of $T'$. + +5. **Conclusion:** + + - In both cases, assuming the existence of two distinct MSTs leads to a contradiction. + - Therefore, the initial assumption that there are two distinct MSTs is false. + - **Hence, the graph must have a unique MST.** + +--- + +### **Part 2: Showing the Converse is Not True** + +**Goal:** Provide a counterexample to show that a graph can have a unique MST even if not every cut has a unique light edge crossing it. + +**Counterexample:** + +**Graph Description:** + +- **Vertices:** $a$, $b$, $c$. +- **Edges and Weights:** + - Edge $(a, b)$ with weight $1$. + - Edge $(a, c)$ with weight $1$. + - Edge $(b, c)$ with weight $2$. + +**Visualization:** + +``` + (1) +a ------- b + \ / + \ / + \ / +(1) \ / (2) + c +``` + +**Analysis:** + +1. **Possible Spanning Trees:** + + - **Tree 1:** Edges $(a, b)$ and $(a, c)$; total weight $1 + 1 = 2$. + - **Tree 2:** Edges $(a, b)$ and $(b, c)$; total weight $1 + 2 = 3$. + - **Tree 3:** Edges $(a, c)$ and $(b, c)$; total weight $1 + 2 = 3$. + +2. **Identifying the Unique MST:** + + - The minimum total weight is $2$, achieved by Tree 1. + - **Therefore, the graph has a unique MST** comprising edges $(a, b)$ and $(a, c)$. + +3. **Examining the Cuts:** + + - **Cut between $\{ a \}$ and $\{ b, c \}$:** + - Edges crossing this cut are $(a, b)$ and $(a, c)$. + - Both edges have the same weight $1$. + - **Therefore, this cut does not have a unique light edge**; it has two edges with the minimum weight. + +4. **Conclusion:** + + - The graph has a unique MST even though at least one cut does not have a unique light edge crossing it. + - **This demonstrates that the converse is not true.** ## 23.1-7 From 189b435f4cd0917dd4e2d0925a99c4daf7a9dc9c Mon Sep 17 00:00:00 2001 From: Peng-Yu Chen Date: Wed, 11 Dec 2024 23:47:42 -0500 Subject: [PATCH 2/2] Update 23.1.md --- docs/Chap23/23.1.md | 115 +++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 60 deletions(-) diff --git a/docs/Chap23/23.1.md b/docs/Chap23/23.1.md index 6e24f116cc..d7aa792785 100755 --- a/docs/Chap23/23.1.md +++ b/docs/Chap23/23.1.md @@ -40,9 +40,7 @@ Let $A$ be any cut that causes some vertices in the cycle on once side of the cu **Remark:** Do not assume that all edge weights are distinct. ---- - -### **Part 1: Proving the Forward Direction** +**Part 1: Proving the Forward Direction** **Goal:** Show that if every cut in the graph has a unique light edge crossing it, then the graph has exactly one MST. @@ -52,63 +50,60 @@ Assume, for contradiction, that the graph has **two distinct MSTs**, $T$ and $T' 1. **Identifying an Edge in $T$ but not in $T'$:** - - Since $T$ and $T'$ are distinct, there exists at least one edge that is in $T$ but not in $T'$. - - Let $(u, v)$ be such an edge. + - Since $T$ and $T'$ are distinct, there exists at least one edge that is in $T$ but not in $T'$. + - Let $(u, v)$ be such an edge. 2. **Creating a Cut by Removing $(u, v)$:** - - Removing $(u, v)$ from $T$ divides it into two connected components (since trees are acyclic and connected). - - Let $T_u$ be the set of vertices reachable from $u$ without using $(u, v)$. - - Let $T_v$ be the set of vertices reachable from $v$ without using $(u, v)$. - - The sets $T_u$ and $T_v$ form a **cut** $(T_u, T_v)$ in the graph. + - Removing $(u, v)$ from $T$ divides it into two connected components (since trees are acyclic and connected). + - Let $T_u$ be the set of vertices reachable from $u$ without using $(u, v)$. + - Let $T_v$ be the set of vertices reachable from $v$ without using $(u, v)$. + - The sets $T_u$ and $T_v$ form a **cut** $(T_u, T_v)$ in the graph. 3. **Unique Light Edge Crossing the Cut:** - - By assumption, the cut $(T_u, T_v)$ has a **unique light edge** crossing it. - - Let $(x, y)$ be this unique light edge. - - Note that $(u, v)$ crosses this cut because $u \in T_u$ and $v \in T_v$. + - By assumption, the cut $(T_u, T_v)$ has a **unique light edge** crossing it. + - Let $(x, y)$ be this unique light edge. + - Note that $(u, v)$ crosses this cut because $u \in T_u$ and $v \in T_v$. 4. **Analyzing the Unique Light Edge:** - - **Case 1:** If $(x, y) \neq (u, v)$, then: - - Since $(x, y)$ is the unique light edge and not $(u, v)$, it must have a weight **less than** $w(u, v)$. - - **Constructing a New Spanning Tree:** - - Replace $(u, v)$ in $T$ with $(x, y)$ to get $T'' = T - \{ (u, v) \} \cup \{ (x, y) \}$. - - $T''$ is connected (since $(x, y)$ connects $T_u$ and $T_v$) and spans all vertices. - - The total weight of $T''$ is less than that of $T$ because $w(x, y) < w(u, v)$. - - **Contradiction:** - - $T$ was assumed to be an MST, but $T''$ has a lower total weight. - - This contradicts the minimality of $T$. - - - **Case 2:** If $(x, y) = (u, v)$, then: - - The unique light edge crossing the cut is $(u, v)$. - - **Observing $T'$:** - - Since $(u, v) \notin T'$, there must be a path from $u$ to $v$ in $T'$ (since $T'$ is connected). - - This path must cross the cut $(T_u, T_v)$ at least once. - - Let $e$ be an edge on this path that crosses the cut. - - - **Comparing Edge Weights:** - - Since $(u, v)$ is the unique light edge crossing the cut, and $e \neq (u, v)$, it follows that $w(u, v) < w(e)$. - - - **Constructing a New Spanning Tree:** - - Add $(u, v)$ to $T'$, creating a cycle. - - Remove $e$ from this cycle to get $T'' = T' + \{ (u, v) \} - \{ e \}$. - - $T''$ is connected and spans all vertices. - - The total weight of $T''$ is less than that of $T'$ because $w(u, v) < w(e)$. - - - **Contradiction:** - - $T'$ was assumed to be an MST, but $T''$ has a lower total weight. - - This contradicts the minimality of $T'$. + - **Case 1:** If $(x, y) \ne (u, v)$, then: + - Since $(x, y)$ is the unique light edge and not $(u, v)$, it must have a weight **less than** $w(u, v)$. + - **Constructing a New Spanning Tree:** + - Replace $(u, v)$ in $T$ with $(x, y)$ to get $T'' = T - \{ (u, v) \} \cup \{(x, y)\}$. + - $T''$ is connected (since $(x, y)$ connects $T_u$ and $T_v$) and spans all vertices. + - The total weight of $T''$ is less than that of $T$ because $w(x, y) < w(u, v)$. + - **Contradiction:** + - $T$ was assumed to be an MST, but $T''$ has a lower total weight. + - This contradicts the minimality of $T$. + + - **Case 2:** If $(x, y) = (u, v)$, then: + - The unique light edge crossing the cut is $(u, v)$. + - **Observing $T'$:** + - Since $(u, v) \notin T'$, there must be a path from $u$ to $v$ in $T'$ (since $T'$ is connected). + - This path must cross the cut $(T_u, T_v)$ at least once. + - Let $e$ be an edge on this path that crosses the cut. + - **Comparing Edge Weights:** + - Since $(u, v)$ is the unique light edge crossing the cut, and $e \ne (u, v)$, it follows that $w(u, v) < w(e)$. + - **Constructing a New Spanning Tree:** + - Add $(u, v)$ to $T'$, creating a cycle. + - Remove $e$ from this cycle to get $T'' = T' + \{(u, v)\} - \{e\}$. + - $T''$ is connected and spans all vertices. + - The total weight of $T''$ is less than that of $T'$ because $w(u, v) < w(e)$. + - **Contradiction:** + - $T'$ was assumed to be an MST, but $T''$ has a lower total weight. + - This contradicts the minimality of $T'$. 5. **Conclusion:** - - In both cases, assuming the existence of two distinct MSTs leads to a contradiction. - - Therefore, the initial assumption that there are two distinct MSTs is false. - - **Hence, the graph must have a unique MST.** + - In both cases, assuming the existence of two distinct MSTs leads to a contradiction. + - Therefore, the initial assumption that there are two distinct MSTs is false. + - **Hence, the graph must have a unique MST.** --- -### **Part 2: Showing the Converse is Not True** +**Part 2: Showing the Converse is Not True** **Goal:** Provide a counterexample to show that a graph can have a unique MST even if not every cut has a unique light edge crossing it. @@ -118,14 +113,14 @@ Assume, for contradiction, that the graph has **two distinct MSTs**, $T$ and $T' - **Vertices:** $a$, $b$, $c$. - **Edges and Weights:** - - Edge $(a, b)$ with weight $1$. - - Edge $(a, c)$ with weight $1$. - - Edge $(b, c)$ with weight $2$. + - Edge $(a, b)$ with weight $1$. + - Edge $(a, c)$ with weight $1$. + - Edge $(b, c)$ with weight $2$. **Visualization:** ``` - (1) + (1) a ------- b \ / \ / @@ -138,26 +133,26 @@ a ------- b 1. **Possible Spanning Trees:** - - **Tree 1:** Edges $(a, b)$ and $(a, c)$; total weight $1 + 1 = 2$. - - **Tree 2:** Edges $(a, b)$ and $(b, c)$; total weight $1 + 2 = 3$. - - **Tree 3:** Edges $(a, c)$ and $(b, c)$; total weight $1 + 2 = 3$. + - **Tree 1:** Edges $(a, b)$ and $(a, c)$; total weight $1 + 1 = 2$. + - **Tree 2:** Edges $(a, b)$ and $(b, c)$; total weight $1 + 2 = 3$. + - **Tree 3:** Edges $(a, c)$ and $(b, c)$; total weight $1 + 2 = 3$. 2. **Identifying the Unique MST:** - - The minimum total weight is $2$, achieved by Tree 1. - - **Therefore, the graph has a unique MST** comprising edges $(a, b)$ and $(a, c)$. + - The minimum total weight is $2$, achieved by Tree 1. + - **Therefore, the graph has a unique MST** comprising edges $(a, b)$ and $(a, c)$. 3. **Examining the Cuts:** - - **Cut between $\{ a \}$ and $\{ b, c \}$:** - - Edges crossing this cut are $(a, b)$ and $(a, c)$. - - Both edges have the same weight $1$. - - **Therefore, this cut does not have a unique light edge**; it has two edges with the minimum weight. + - **Cut between $\{a\}$ and $\{b, c\}$:** + - Edges crossing this cut are $(a, b)$ and $(a, c)$. + - Both edges have the same weight $1$. + - **Therefore, this cut does not have a unique light edge**; it has two edges with the minimum weight. 4. **Conclusion:** - - The graph has a unique MST even though at least one cut does not have a unique light edge crossing it. - - **This demonstrates that the converse is not true.** + - The graph has a unique MST even though at least one cut does not have a unique light edge crossing it. + - **This demonstrates that the converse is not true.** ## 23.1-7