Let be an undirected graph, which is a path on 8 vertices. The number of matchings in is . (answer in integer)
GATE CSE 2026Graph Theory › Graph Isomorphism, Matching & CountingVerified
GATE CSE 2026 PYQ: Let G G G be an undirected graph, which is a path on 8 8 8 vertices. The number of matchings in G G G is _ _…
Answer
34
Approach
Count matchings of a path $P_n$ by a Fibonacci-style recurrence: condition on whether the last edge e = $(v_{n-1}, v_n)$ belongs to the matching. If it does not, the remaining objects are matchings of $P_{n-1}$; if it does, the edge $(v_{n-2}, v_{n-1})$ is forbidden and the rest is a matching of $P_{n-2}$. With base cases $M_0 = 1$ and $M_1 = 1$, iterate up to n = 8.
The number of matchings of a path on n vertices satisfies $M_n = M_{n-1} + M_{n-2}$ with $M_0 = M_1 = 1$, i.e. $M_n = F_{n+1}$. For n = 8 the sequence gives 34, so the required integer answer is 34.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.