哈密顿路径
Problem Statement:
问题陈述:
Given a graph G. you have to find out that that graph is Hamiltonian or not.
给定图G。 您必须找出该图是否为哈密顿量 。
Example:
例:
Input:
输入:
![hamiltonian path](https://www.includehelp.com/icp/Images/hamiltonian-path.jpg)
Output: 1
输出1
Because here is a path 0 → 1 → 5 → 3 → 2 → 0 and 0 → 2 → 3 → 5 → 1 → 0
因为这里是路径0→1→5→3→2→0和0→2→3→5→1→0
Algorithm:
算法:
To solve this problem we follow this approach:
为了解决这个问题,我们采用以下方法:
We take the source v