I'm trying to prove the following statement:
Let $G=\left(V,E\right)$ be an undirect and connected graph and $w\,:\,E\to\mathbb{R}$ weight function on edges. Then for every $v\in V$, the MST of $G$ contains an edge, touching $v$, that has the minimal weight from all the edges touching $v$.
My attempt:
Let $T=\left(V,E_{T}\right)$ be an MST of $G$ by $w$. Let $e=\{u,v\}\in E$ be the edge that has the minimal weight from all the edges touching $v$. Lets assume that $e\not\in E_{T}$. This means that there is an edge $e'=\{w,v\}\in E$ so $e'\in E_{T}$. Since $e$ is the has the minimal weight from all the edges touching $v$, then $w\left(e\right)<w\left(e'\right)$. From that we get $-w\left(e'\right)+w\left(e\right)<0$. Lets take a look at $T'=\left(V,E_{T'}\right)$ so $E_{T'}=\left(E_{T}\backslash\left\{ e'\right\} \right)\cup\left\{ e\right\} $. We get: $$w\left(T'\right)=w\left(T\right)-w\left(e'\right)+w\left(e\right)\overset{-w\left(e'\right)+w\left(e\right)<0}{<}w\left(T\right)+0=w\left(T\right)$$ As a contradiction for $T$ being MST of $G$ by $w$. So we get $e\in E_{T}$.
How is my solution? I feel like I need to explain:
- Why $w\left(e\right)<w\left(e'\right)$ and not $w\left(e\right)\leq w\left(e'\right)$?
- Why $T'$ is a tree?
For the first question, if it's true then my whole proof is invalid. Please review my solution and help me answer those questions (or point any other suggestions).
You are almost there.
Ad 1: If $w(e')=w(e)$, then you are actually done as $e'$ is then an edge with minimal weight incident with $v$.
Ad 2: Actually, depending on your choice of $e'$, $T'$ might not always still be a tree. To see this, suppose your graph has vertices $\{1,2,3,4\}$ and edges $\{1,2\}, \{2,3\}, \{1,3\}, \{3,4\}$. Consider the tree made up of the edges $\{1,2\}, \{2,3\}, \{3,4\}$ and suppose in your proof, we have $v=3$ and $e=\{1, 3\}$; as you don't further qualify the choice of $e'$, it might well be that $e'=\{3, 4\}$ - but with this choice of edges, the result $T'$ will not be a tree.
So you have to modify your approach. What happens if you add $e$ to the tree $T$? You will create a unique cycle containing $v$. Now how should you choose $e'$?