Given that, a caterpillar.
Let us name it as C.
To prove: C is graceful.
Proof:
Let C contain n vertices and let the longest path in C contain k vertices.
We can call this longest path as spine and all other vertices as feet.
Referring part (a) of the labelling.
Since, we label the first vertex in the spine with 1 and the adjacent vertex in the spine with n.
All feet of the vertex labelled n are labelled as \(2,3,...,m\)before we label the next vertex in the spine with\(m + 1\).
Next, we label all the feet of the vertex as \(m + 1\)by \(n - 1,n - 2,...,p\) and the next vertex in the spine with \(p - 1\).
And so on for all the other vertices of the spine.
So, we noticed that the successive differences in the tree C are\(n - 1,n - 2,...,2,1\) and the difference of the labels of adjacent vertices are all different.
So, C is graceful.
Hence proved.