Блог пользователя Lance_HAOH

Автор Lance_HAOH, история, 7 лет назад, По-английски

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.

  • Проголосовать: нравится
  • -3
  • Проголосовать: не нравится