Congratulations! You’ve implemented the Hamiltonian algorithm to find both Hamiltonian paths and cycles within a graph!
In this lesson, you have learned:
- What a Hamiltonian path is
- What a Hamiltonian cycle (circuit) is
- How to convert a graph into input data for the Hamiltonian algorithm via a vertex list and adjacency matrix
- How to implement the Hamiltonian algorithm to search for paths and cycles programmatically
Returning to the example graph we introduced in the Backtracking exercise, execute the code on that graph and its adjacency matrix (
adjacency_matrix2) to see what paths and cycles are found.
Create additional adjacency matrices for various graphs to test more with!