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

Правка en1, от 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.

Теги #hackerrank, #hamiltonian-circuit, #graph

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Lance_HAOH 2017-07-10 19:55:55 729 Initial revision (published)