$P \cup Q$ contains a cycle if $P$ and $Q$ are distinct paths with the same initial and terminal vertices

131 Views Asked by At

Let $P$ and $Q$ be distinct paths in a graph $G$ with the same initial and terminal vertices. I am trying to show that $P \cup Q$ contains a cycle.

My attempt: I would use the following theorem

Let $G$ be a graph in which all vertices have degree at least two. Then $G$ contains a cycle.

with the subgraph $G[E(P) \triangle E(Q)]$

Any help on proving this?

1

There are 1 best solutions below

0
On

The simpler way is this. Since $P\neq Q$, there exists a vertex $u\in P\cap Q$ such that the edges $e=ux$ and $e'=uy$ are distinct and $e\in P$, $e'\in Q$. Choose $u$ so that it is the first vertex with this property after the initial vertex (it is possible that $u$ is the initial vertex). Now let $v$ be the vertex nearest to $u$ such that $v\in P\cap Q$ and $v\neq u$ (it is possible that $v$ is a terminal vertex).

Then $ux\ldots v\ldots yu$ is the required cycle.