HackerRank Problem: Bytelandian Tours — How do I solve this problem?

Revision en1, by Lance_HAOH, 2017-07-10 19:55:55

I am trying to solve the HackerRank problem "Bytelandian Tours".

Here is the link to the problem.

I think that the problem requires us to count the number of Hamiltonian circuits in a general graph — which is a NP-complete problem. Hence, I think that there must be some way to avoid the direct enumeration of all possible Hamiltonian circuits like what this solution did. I am unable to comprehend the author's logic though. Could someone please advise me on how to solve this problem?

Thanks in advance.

Tags #hackerrank, #hamiltonian-circuit, #graph

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Lance_HAOH 2017-07-10 19:55:55 729 Initial revision (published)