# A Space-Efficient Parameterized Algorithm for the Hamiltonian Cycle Problem by Dynamic Algebraization

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 11532)

## Abstract

An NP-hard graph problem may be intractable for general graphs but it could be efficiently solvable using dynamic programming for graphs with bounded treewidth. Employing dynamic programming on a tree decomposition usually uses exponential space. In 2010, Lokshtanov and Nederlof introduced an elegant framework to avoid exponential space by algebraization. Later, Fürer and Yu modified the framework in a way that even works when the underlying set is dynamic, thus applying it to tree decompositions.

In this work, we design space-efficient algorithms to count the number of Hamiltonian cycles and furthermore solve the Traveling Salesman problem, using polynomial space while the time complexity is only slightly increased. This might be inevitable since we are reducing the space usage from an exponential amount (in dynamic programming solutions) to polynomial. We give an algorithm to count the number of Hamiltonian cycles in time $$\mathcal {O}((4k)^d\, nM(n\log {n}))$$ using $$\mathcal {O}(kdn\log {n})$$ space, where M(r) is the time complexity to multiply two integers, each of which being represented by at most r bits. Then, we solve the more general Traveling Salesman problem in time $$\mathcal {O}((4k)^d poly(n))$$ using space $$\mathcal {O}(\mathcal {W}kdn\log {n})$$, where k and d are the width and the depth of the given tree decomposition and $$\mathcal {W}$$ is the sum of weights. Furthermore, this algorithm counts the number of Hamiltonian Cycles.

## References

1. 1.
Bellman, R.: Dynamic programming treatment of the travelling salesman problem. J. ACM (JACM) 9(1), 61–63 (1962)
2. 2.
Björklund, A., Husfeldt, T., Kaski, P., Koivisto, M.: Fourier meets Möbius: fast subset convolution. In: Proceedings of the Thirty-Ninth Annual ACM Symposium on Theory of Computing, pp. 67–74. ACM (2007)Google Scholar
3. 3.
Björklund, A., Kaski, P., Koutis, I.: Directed Hamiltonicity and out-branchings via generalized Laplacians. In: 44th International Colloquium on Automata, Languages, and Programming, ICALP 2017, Warsaw, Poland, 10–14 July 2017, pp. 91:1–91:14 (2017)Google Scholar
4. 4.
Bodlaender, H.L., Cygan, M., Kratsch, S., Nederlof, J.: Deterministic single exponential time algorithms for connectivity problems parameterized by treewidth. Inf. Comput. 243, 86–111 (2015)
5. 5.
Bodlaender, H.L., Gilbert, J.R., Hafsteinsson, H., Kloks, T.: Approximating treewidth, pathwidth, frontsize, and shortest elimination tree. J. Algorithms 18(2), 238–255 (1995)
6. 6.
Curticapean, R., Lindzey, N., Nederlof, J.: A tight lower bound for counting Hamiltonian cycles via matrix rank. In: Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms, Society for Industrial and Applied Mathematics, pp. 1080–1099 (2018)Google Scholar
7. 7.
Cygan, M., et al.: Parameterized Algorithms. Springer, Heidelberg (2015).
8. 8.
Cygan, M., Nederlof, J., Pilipczuk, M., Pilipczuk, M., van Rooij, J.M.M., Wojtaszczyk, J.O.: Solving connectivity problems parameterized by treewidth in single exponential time. In: IEEE 52nd Annual Symposium on Foundations of Computer Science (FOCS), pp. 150–159. IEEE (2011)Google Scholar
9. 9.
Fürer, M., Huiwen, Y.: Space saving by dynamic algebraization based on tree-depth. Theory Comput. Syst. 61(2), 283–304 (2017)
10. 10.
Karp, R.M.: Dynamic programming meets the principle of inclusion and exclusion. Oper. Res. Lett. 1(2), 49–51 (1982)
11. 11.
Kneis, J., Mölle, D., Richter, S., Rossmanith, P.: A bound on the pathwidth of sparse graphs with applications to exact algorithms. SIAM J. Discrete Math. 23(1), 407–427 (2009)
12. 12.
Kohn, S., Gottlieb, A., Kohn, M.: A generating function approach to the traveling salesman problem. In: Proceedings of the 1977 Annual Conference, pp. 294–300. ACM (1977)Google Scholar
13. 13.
Lokshtanov, D., Nederlof, J.: Saving space by algebraization. In: Proceedings of the Forty-Second ACM Symposium on Theory of Computing, pp. 321–330. ACM (2010)Google Scholar
14. 14.
Nešetřil, J., De Mendez, P.O.: Tree-depth, subgraph coloring and homomorphism bounds. Eur. J. Comb. 27(6), 1022–1041 (2006)
15. 15.
Pilipczuk, M., Wrochna, M.: On space efficiency of algorithms working on structural decompositions of graphs. ACM Trans. Comput. Theory (TOCT) 9(4), 18:1–18:36 (2018)Google Scholar
16. 16.
Rota, G.-C.: On the foundations of combinatorial theory, I. Theory of Möbius functions, Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete 2(4), 340–368 (1964)
17. 17.
Stanley, R.P.: Enumerative Combinatorics. Vol. 1, with a foreword by Gian-Carlo Rota. Corrected reprint of the 1986 original, Cambridge Studies in Advanced Mathematics, vol. 49 (1997)Google Scholar
18. 18.
Williams, V.V.: Multiplying matrices faster than Coppersmith-Winograd. In: Proceedings of the Forty-Fourth Annual ACM Symposium on Theory of Computing, STOC 2012, pp. 887–898. ACM, New York (2012)Google Scholar