سوال ۱۱۷ کنکور ارشد علوم کامپیوتر ۱۳۹۹
تعداد تطابقهای کامل در گراف زیر چقدر است؟
پاسخ صحیح: گزینهٔ A — ۲۷
Reading the graph
The figure is a horizontal chain of diamonds. Label the vertices on the middle horizontal line (the spine) as . Between each consecutive pair sits a top vertex and a bottom vertex . Diamond is the vertex set , and it is a complete graph : the four outer sides are present, plus both diagonals — the spine edge (horizontal diagonal) and the edge (vertical diagonal).
There are vertices, so a perfect matching (a set of edges covering every vertex exactly once) uses edges.
Key observation: each is local
The vertices and appear only in diamond (they touch nothing outside it). So in any perfect matching, and must be matched using edges inside diamond . The only "shared" vertices between adjacent diamonds are the spine vertices.
Process the diamonds left to right and track one bit of state: whether the incoming spine vertex is already matched (consumed by diamond ) or still free.
Case A — is free. Then diamond must internally cover three vertices . Matching an odd number of vertices () inside forces to be used as well. The valid pairings are:
That is ways, and in every one of them becomes matched.
Case B — is already matched. Then only remain to cover. If either were matched to , the other would have to use — but is taken. So the only option is the edge : way, and stays free.
Multiply along the chain
Start with free. The state alternates deterministically:
| Diamond | incoming | ways | outgoing |
|---|---|---|---|
| 1 | free | matched | |
| 2 | matched | free | |
| 3 | free | matched | |
| 4 | matched | free | |
| 5 | free | matched |
The last spine vertex has no diamond to its right, so it must be matched inside diamond — which is exactly what Case A delivers, so the count is consistent. Multiplying the independent choices:
The answer is (option 1).
General pattern
For a chain of such diamonds there are vertices, so a perfect matching exists only when is odd, and then the count is . Here gives .
Exam trick: When a graph is a chain of identical blocks glued at single "cut" vertices, scan it block by block and carry just the cut vertex's matched/free status. The per-block choices multiply, turning a -vertex matching count into a one-line product.