Algorithmica

, Volume 81, Issue 3, pp 1267–1287

# Parameterized Algorithms for List K-Cycle

• Saket Saurabh
• Meirav Zehavi
Article

## Abstract

The classic $$K$$-Cycle problem asks if a graph G, with vertex-set V(G), has a simple cycle containing all vertices of a given set $$K\subseteq V(G)$$. In terms of colored graphs, it can be rephrased as follows: Given a graph G, a set $$K\subseteq V(G)$$ and an injective coloring $$c: K\rightarrow \{1,2,\ldots ,|K|\}$$, decide if G has a simple cycle containing each color in $$\{1,2,\ldots ,|K|\}$$ exactly once. Another problem widely known since the introduction of color coding is Colorful Cycle. Given a graph G and a coloring $$c: V(G)\rightarrow \{1,2,\ldots ,k\}$$ for some $$k\in \mathbb {N}$$, it asks if G has a simple cycle of length k containing each color in $$\{1,2,\ldots ,k\}$$ exactly once. We study a generalization of these problems: Given a graph G, a set $$K\subseteq V(G)$$, a list-coloring $$L: K\rightarrow 2^{\{1,2,\ldots ,k^*\}}$$ for some $$k^*\in \mathbb {N}$$ and a parameter $$k\in \mathbb {N}$$, List$$K$$-Cycle asks if one can assign a color to each vertex in K so that G has a simple cycle (of arbitrary length) containing exactly k vertices from K with distinct colors. We design a randomized algorithm for List$$K$$-Cycle running in time $$2^kn^{{{\mathcal {O}}}(1)}$$ on an n-vertex graph, matching the best known running times of algorithms for both $$K$$-Cycle and Colorful Cycle. Moreover, unless the Set Cover Conjecture is false, our algorithm is essentially optimal. We also study a variant of List$$K$$-Cycle that generalizes the classic Hamiltonicity problem, where one specifies the size of a solution. Our results integrate three related algebraic approaches, introduced by Björklund, Husfeldt and Taslaman (SODA’12), Björklund, Kaski and Kowalik (STACS’13), and Björklund (FOCS’10).

## Keywords

Parameterized complexity K-cycle Colorful path k-path

## References

1. 1.
Alon, N., Yuster, R., Zwick, U.: Color coding. J. ACM 42(4), 844–856 (1995)
2. 2.
Björklund, A.: Determinant sums for undirected hamiltonicity. SIAM J. Comput. 43(1), 280–299 (2014)
3. 3.
Björklund, A., Husfeldt, T., Kaski, P., Koivisto, M.: Narrow sieves for parameterized paths and packings. J. Comput. Syst. Sci. 87, 119–139 (2017)
4. 4.
Björklund, A., Husfeldt, T., Taslaman, N.: Shortest cycle through specified elements. In: SODA, pp. 1747–1753 (2012)Google Scholar
5. 5.
Björklund, A., Kamat, V., Kowalik, L., Zehavi, M.: Spotting trees with few leaves. In: ICALP, pp. 243–255 (2015)Google Scholar
6. 6.
Björklund, A., Kaski, P., Kowalik, L.: Constrained multilinear detection and generalized graph motifs. Algorithmica 74(2), 947–967 (2016)
7. 7.
Björklund, A., Kaski, P., Lauri, J., Kowalik, L.: Engineering motif search for large graphs. In: ALENEX, pp. 104–118 (2016)Google Scholar
8. 8.
Bodlaender, H.L.: On linear time minor tests with depth-first search. J. Algorithms 14(1), 1–23 (1993)
9. 9.
Chen, J., Kneis, J., Lu, S., M$$\ddot{\rm o}$$lle, D., Richter, S., Rossmanith, P., Sze, S.H., Zhang, F.: Randomized divide-and-conquer: improved path, matching, and packing algorithms. SIAM J. Comput. 38(6), 2526–2547 (2009)Google Scholar
10. 10.
Cygan, M., Dell, H., Lokshtanov, D., Marx, D., Nederlof, J., Okamoto, Y., Paturi, P., Saurabh, S., Wahlström, M.: On problems as hard as CNF-SAT. ACM Trans. Algorithms 12(3), 41:1–41:24 (2016).
11. 11.
Cygan, M., Fomin, F.V, Kowalik, L., Lokshtanov, D., Marx, D., Pilipczuk, M., Pilipczuk, M., Saurabh, S.: Parameterized Algorithms. Springer (2015)Google Scholar
12. 12.
DeMillo, R.A., Lipton, R.J.: A probabilistic remark on algebraic program testing. Inf. Process Lett. 7(4), 193–195 (1978)
13. 13.
Deshpande, P., Barzilay, R., Karger, D.R.: Randomized decoding for selection-and-ordering problems. In: HLT-NAACL, pp. 444–451 (2007)Google Scholar
14. 14.
Downey, R., Fellows, M.: Fundamentals of Parameterized Complexity. Springer (2013)Google Scholar
15. 15.
Fleischner, H., Woeginger, G.H.: Detecting cycles through three fixed vertices in a graph. Inf. Process Lett. 41, 29–33 (1992)
16. 16.
Fomin, F.V., Lokshtanov, D., Panolan, F., Saurabh, S.: Representative families of product families. ACM Trans. Algorithms 13(3), 36 (2017).
17. 17.
Fomin, F.V., Lokshtanov, D., Panolan, F., Saurabh, S.: Efficient computation of representative families with applications in parameterized and exact algorithms. J. ACM 63(4), 29:1–29:60 (2016).
18. 18.
Fortune, S., Hopcroft, J., Wyllie, J.: The directed subgraph homeomorphism problem. Theor. Comput. Sci. 10, 111–121 (1980)
19. 19.
Huffner, F., Wernicke, S., Zichner, T.: Algorithm engineering for color-coding with applications to signaling pathway detection. Algorithmica 52(2), 114–132 (2008)
20. 20.
Kawarabayashi, K.: An improved algorithm for finding cycles through elements. In: IPCO, pp. 374–384 (2008)Google Scholar
21. 21.
Kawarabayashi, K., Li, Z., Reed, B.A.: Recognizing a totally odd $$K_4$$-subdivision, parity 2-disjoint rooted paths and a parity cycle through specified elements. In: SODA, pp. 318–328 (2010)Google Scholar
22. 22.
Kobayashi, Y., Kawarabayashi, K.: Algorithms for finding an induced cycle in planar graphs and bounded genus graphs. In: SODA, pp. 1146–1155 (2009)Google Scholar
23. 23.
Koutis, I.: Faster algebraic algorithms for path and packing problems. In: ICALP, pp. 575–586 (2008)Google Scholar
24. 24.
Kowalik, L., Lauri, J.: On finding rainbow and colorful paths. Theor. Comput. Sci. 628, 110–114 (2016).
25. 25.
LaPaugh, A.S., Rivest, R.L.: The subgraph homomorphism problem. J. Comput. Syst. Sci. 20, 133–149 (1980)
26. 26.
Monien, B.: How to find long paths efficiently. Ann. Discrete Math. 25, 239–254 (1985)
27. 27.
Pinter, R.Y., Shachnai, H., Zehavi, M.: Improved parameterized algorithms for network query problems. In: IPEC, pp. 294–306 (2014)Google Scholar
28. 28.
Pinter, R.Y., Zehavi, M.: Algorithms for topology-free and alignment network queries. JDA 27, 29–53 (2014)
29. 29.
Robertson, N., Seymour, P.D.: Graph minors XIII: the disjoint paths problem. J. Comb. Theory Ser. B 63, 65–110 (1995)
30. 30.
Schwartz, J.T.: Fast probabilistic algorithms for verification of polynomial identities. J. Assoc. Comput. Mach. 27(4), 701–717 (1980)
31. 31.
Shachnai, H., Zehavi, M.: Representative families: a unified tradeoff-based approach. J. Comput. Syst. Sci. 82(3), 488–502 (2016)
32. 32.
Wahlström, M.: Abusing the Tutte matrix: an algebraic instance compression for the $$k$$-set-cycle problem. In: STACS, pp. 341–352 (2013)Google Scholar
33. 33.
Williams, R.: Finding paths of length $$k$$ in $${O}^*(2^k)$$ time. Inf. Process. Lett. 109(6), 315–318 (2009)
34. 34.
Zehavi, M.: Parameterized algorithms for the module motif problem. In: MFCS, pp. 825–836 (2013)Google Scholar
35. 35.
Zehavi, M.: Mixing color coding-related techniques. In: ESA, pp. 1037–1049 (2015)Google Scholar
36. 36.
Zippel, R.: Probabilistic algorithms for sparse polynomials. In: EUROSAM, pp. 216–226 (1979)Google Scholar