Start by listing all vertices and tracking a candidate order so no vertex repeats, because repetition immediately breaks Hamiltonian validity. Then grow the path by choosing adjacent unused vertices, prioritizing forced moves at low-degree vertices. This reduces branching and avoids dead-end exploration late in the search.
After building a full vertex sequence, test the final condition: for a cycle, verify the last vertex is adjacent to the first; for a path, this closure is not required. This single adjacency check often decides Hamiltonian versus semi-Hamiltonian status. Always separate these two checks to avoid classification errors.
For adjacency-matrix inputs, convert to a quick sketch or adjacency list before searching because visual structure reveals feasible ordering constraints faster. A matrix gives connectivity data, but a sketch exposes bottlenecks and near-complete subgraphs that guide trial construction. Use the matrix afterward to verify each step formally.
| Feature | Hamiltonian Path | Hamiltonian Cycle |
|---|---|---|
| Vertex visit condition | Each vertex exactly once | Each vertex exactly once |
| Start and end | Different allowed | Must be same vertex |
| Graph classification impact | Semi-Hamiltonian possible | Hamiltonian graph confirmed |
| Feature | Hamiltonian Idea | Eulerian Idea |
|---|---|---|
| What must be used exactly once | Vertices | Edges |
| Typical check style | Construct full vertex order | Degree parity conditions often help |
| Main failure mode | Repeated or missing vertex | Repeated or omitted edge |
Write the candidate route as an ordered vertex string and tick vertices as they are used, because this creates visible proof of exact-once coverage. Examiners usually award method marks for a logically checkable construction process. A clean sequence is stronger than an unlabeled drawing.
If asked to "show" Hamiltonian status, provide one valid Hamiltonian cycle and state why it satisfies both conditions: complete coverage and return to start. If cycle construction fails but a full path works, explicitly classify as semi-Hamiltonian and justify the missing closure edge. This direct wording protects conclusion marks.
Perform a final audit: count vertices in the graph and compare with vertices listed in your route. In a valid Hamiltonian path/cycle, the route should include each vertex exactly once, so the number of distinct listed vertices must match . This quick check catches omissions before submission.
A common mistake is treating any long cycle as Hamiltonian even when one vertex is skipped. Hamiltonian status is all-or-nothing on vertex coverage, so missing one vertex invalidates the claim completely. Always verify against the full vertex set, not just the visible shape.
Students often confuse "no repeated edges" with "no repeated vertices," but Hamiltonian paths restrict repeated vertices specifically. You may avoid repeating edges and still fail Hamiltonian conditions if a vertex appears twice or is omitted. Keep the constraint language precise during checking.
Another error is assuming high vertex degree guarantees Hamiltonian cycles in every case. High connectivity helps search, but structural bottlenecks can still prevent a valid closed tour. Treat degree as a heuristic, not a proof by itself.