I know every path is a walk. But how do I prove the following question?

904 Views Asked by At

Let $G$ be a graph and let $u$ and $v$ be two nodes of $G$.

(a) Prove that if there is a walk in $G$ from $u$ to $v$, then $G$ contains a path connecting $u$ and $v$.

(b) Use part (a) to give another proof of the fact that if $G$ contains a path connecting $a$ and $b$, and also a path connecting $b$ and $c$, then it contains a path connecting $a$ and $c$.

2

There are 2 best solutions below

0
On

The thing that stops walks from being paths is loops. So you have to show that if there is one or more loops on a walk, then you can safely remove them all and still have a walk. That walk would then be a path.

For (b), you just have to apply (a): appending the path from b to c at the end of the path from a to b clearly gives a walk from a to c. Why is there also a path?

0
On

For part (a), this has been answered already at Prove that if there is a walk from u to v then there is also a path from u to v. .

For part (b), I'm guessing that at this point in the course/book, you've seen that if there is a walk from $a$ to $b$ and a walk from $b$ to $c$, then there is a walk from $a$ to $c$.

To solve part (b), notice that the $a-b$ path is also a $a-b$ walk and the $b-c$ path is also a $b-c$ walk. Since we have a $a-b$ walk and a $b-c$ walk, we have a $a-c$ walk. Then, by part (a), there exists a $a-c$ path.