Algorithms to find the number of Hamiltonian paths in a graph

后端 未结 5 1364
轮回少年
轮回少年 2020-12-19 10:05

I\'m trying to solve a slightly modified version of the Hamiltonian Path problem. It is modified in that the start and end points are given to us and instead of determining

5条回答
  •  生来不讨喜
    2020-12-19 10:20

    On a 7x7 array (i.e. a total of 7*7=49 nodes), having either a O(n!) algorithm or a O(2^n*n^2) algorithm will both take way too much time.

    Perhaps there is some way speeding this up taking into account the special characteristics of this particular graph (e.g. each node has at most 4 edges), but a fast solution seems improbable (unless someone incidentally finds a polynomial time algorithm for the Hamiltonian Path problem itself).

提交回复
热议问题