If graph G is an n-nodes Hamiltonian path, why χ(G)=2 or χ(G)=3?

51 Views Asked by At

graph $G$ is a $n$-nodes Hamiltonian path, $χ(G)$ is the least number of needed colors to make sure any two adjacent nodes not to have the same colors, then: $$ χ(G)=\begin{cases} 2,&\text{if $n$ is even}\\ 3,&\text{if $n$ is odd} \end{cases} $$ how could I yield this conclusion?

1

There are 1 best solutions below

0
On

To get you started...

Given a graph $G(V,E)$ let $H(V,E)$ be a Hamiltonial cycle (not just a path).

This means $H$ it essentially a "circle" of nodes. Start at any node and color it red. Then move to the next node (in either direction). That node can't be red, so color it blue. You can keep going this way, red $\rightarrow$ blue $\rightarrow$ red, etc...

Now, think about what happens with even and odd cycles.