Parameterized Complexity of Synchronization and Road Coloring

First, we close the multi-parameter analysis of a canonical problem concerning short reset words (SYN) initiated by Fernau et al. (2013). Namely, we prove that the problem, parameterized by the number of states, does not admit a polynomial kernel unless the polynomial hierarchy collapses. Second, we consider a related canonical problem concerning synchronizing road colorings (SRCP). Here we give a similar complete multi-parameter analysis. Namely, we show that the problem, parameterized by the number of states, admits a polynomial kernel and we close the previous research of restrictions to particular values of both the alphabet size and the maximum length of a reset word.


Introduction
Questions about synchronization of finite automata have been studied since the early times of automata theory.The basic concept is very natural: For a given machine, we want to find an input sequence that gets the machine to some particular state, no matter in which state the machine was before.Such sequence is called a reset word (i) .If an automaton has a reset word, we call it a synchronizing automaton.A need for finding reset words appears in several fields of mathematics and engineering.Classical applications (see [21]) include model-based testing of sequential circuits, robotic manipulation, and symbolic dynamics, but there are also some important connections with information theory [20] and with formal models of biomolecular processes [3].
Two particular problems concerning synchronization have gained some publicity: the Road Coloring Problem and the Černý conjecture.The first one has been solved by Trahtman [17,19]  proving that the edges of any strongly connected aperiodic directed multigraph with constant out-degree can be colored such that a synchronizing automaton arises.Motivation for this problem comes from symbolic dynamics [1].The Černý conjecture remains open since 1971 [4,5].It claims that any t-state synchronizing automaton has a reset word of length at most (t − 1) 2 .
In the practical applications of synchronization one may need to compute a reset word for a given automaton and, moreover, the reset word should be as short as possible.The need to compute a synchronizing labeling for a suitable graph, possibly with a request for a short reset word, may arise as well.It turns out, as we describe below, that such computational problems are typically NP-hard, even under heavy restrictions.
Parameterized Complexity offers various notions and useful tools that has became standard in modern analysis of NP-complete problems.The problems are studied with respect to numerical attributes (parameters) of instances.A multi-parameter analysis considers multiple different parameters and their combinations.In the present paper we close the multi-parameter analyses of canonical problems SYN and SRCP related to synchronization and road coloring.The study of SYN was initiated in 2013 by Fernau, Heggernes, and Villanger [8,9].The results about SRCP give complete answers to the questions raised by the second author and Drewienkowski [13,14].
Since the instances of our problems consist of automata, graphs and word lengths, the natural parameters are: the number t of states (or vertices), the alphabet size |I|, and the word length k (see the definitions in Sec.287 and a summary of the results in Tab. 1 and Tab. 2).If such a word exists, we call the automaton synchronizing.Note that each word having a reset word as a factor is also a reset word.The Černý conjecture, a longstanding open problem in automata theory, claims that each synchronizing automaton has a reset word of length at most (|Q| − 1) 2 .There is a series of automata due to Černý whose shortest reset words reach this bound exactly [4], but all known upper bounds lie in Ω |Q| 3 .A tight bound has been established for various special classes of automata, see some of recent advances in [11,16].The best general upper bound of the length of shortest reset words is currently the following (ii) : ).Any t-state synchronizing automaton has a reset word of length z(t), where It is convenient to analyze synchronization as a process in discrete time.Having an automaton A = (Q, I, δ) and a word w = x 1 . . .x |w| (ii) An improved bound published by Trahtman [18] in 2011 has turned out to be proved incorrectly, see [10].
with x 1 , . . ., x |w| ∈ I fixed, we say that a state At time 0, before the synchronization starts, all states are active.As we apply the letters, the number of active states may decrease.
It is also very intuitive to consider activity markers.At time 0 there is an activity marker in each state.Whenever a letter x ∈ I is applied, each activity marker in state s ∈ Q moves to δ(s, x).The state s may become unmarked or receive incoming markers.A state is active if an only if it has an activity marker.
When the number of active states decreases to 1 at a time l, the synchronization is complete and the word x 1 . . .x l is a reset word of A.

Road coloring
In this paper directed multigraphs are referred to as graphs.A graph is: 1. aperiodic if the lengths of its cycles do not have any nontrivial common divisor, 2. admissible if it is aperiodic and all its out-degrees are equal, 3. road colorable if its edges can be labeled such that a synchronizing deterministic finite automaton arises.
It is not hard to observe that any road colorable graph is admissible.In 1977 Adler, Goodwyn and Weiss [1] conjectured that for strongly connected graphs the backward implication holds as well.Their question became known as the Road Coloring Problem and a positive answer was given in 2008 by Trahtman [17,19]: Theorem 2 (Road Coloring Theorem).Each strongly connected admissible graph is road colorable.
In the literature it is common to consider only strongly connected graphs since many general claims can be easily reduced to the corresponding claims about strongly connected cases.We do not admit such restriction explicitly, because in the scope of computational problems it does not seem very natural.However, all the results hold with the restriction as well.Especially the NP-completeness proofs have been made slightly more complicated in order to use only strongly connected graphs.

Parameterized complexity
In most of the paper we do not need to work with a formal definition of a parameterized problem.We see it as a classical decision problem where we consider some special numerical property (parameter) of each input.Parameterized complexity studies the way in which the hardness of an NP-complete problem depends on the parameter.A problem may remain NP-hard even if restricted to instances with a particular value of the parameter, or there may be a polynomial-time algorithm for each such value.In the second case, if the algorithm is the same (uniform) for all the values, the problem is said to lie in the class XP.Moreover, if the time-bounding polynomials for different values are all of the same degree, we get into the class FPT: A parameterized problem is fixed-parameter tractable (FPT) if there is an algorithm that solves it in time where x is the input string, P ∈ N is the parameter of x, r is an appropriate polynomial, and f is any computable function.If there is more than one possible parameter for a problem, one may consider combinations of parameters.A problem is FPT with respect to parameters P, Q if it is decidable in time This is typically much less restrictive condition than the previous one, where f depends only on P .
There is a hierarchy of problems (the W-hierarchy) lying in XP but possibly outside FPT.It consists of the classes Since it has been conjectured that all the inclusions are proper, it is common to use W[i]-hardness (with respect to an appropriate type of reduction) as the evidence of lying outside FPT.However, we do not need to define the W-hierarchy here since it is used only to formulate former results, not the new ones (see Tab. 1).See the textbook [6] for the definitions and many other great ideas of parameterized complexity.
A kernel of a parameterized problem is a polynomial-time procedure that transforms any input x with parameter P x to another input y with parameter P y such that both |y| and P y are bounded by f (P x ), where f is an arbitrary function.Having a kernel is equivalent to lying in FPT.If f is a polynomial, we get a polynomial kernel.

Studied problems
In this paper we work with two canonical computational problems related to synchronization (SYN) and road coloring (SRCP).The problems are defined as follows:

Output:
Is there w ∈ I of length at most k such that |δ(Q, w)| = 1?
Is there a coloring δ such that |δ(Q, w)| = 1 for some w ∈ I of length at most k?
We need the following basic facts related to SYN:

Theorem 3 ([4]
).There is a polynomial-time algorithm that decides whether a given automaton is synchronizing.
Corollary 1. SYN, if restricted to the instances with k ≥ z(t) = t 3 −t 6 , is solvable in polynomial time.Theorem 4 ( [7]).SYN is NP-complete, even if restricted to automata with two-letter alphabets.
The results of this paper, as well as the former results of Fernau, Heggernes, and Villanger [8,9] and of the second author and Drewienkowski [13,14] are summarized by Tables 1 and 2. We have filled all the gaps in the corresponding tables from [8,Sec. 3] and [13,Sec. 6].This means that the multi-parameter analysis of SYN and SRCP is complete in the sense that NP-complete restrictions are identified and we know, under several standard assumptions, which parameterizations lie in FPT and which of them have polynomial kernels.

Parameterized Complexity of SYN
The following lemma, easy to prove using the construction of a power automaton, says that SYN lies in FPT if parameterized by the number of states: 8,15]).There exists an algorithm that solves SYN in time r(t, |I|) • 2 t for an appropriate polynomial r.
But does there exist a polynomial kernel?In this section we use methods developed by Bodlaender et al. [2] to prove the following: Theorem 5.If SYN parameterized by the number of states has a polynomial kernel, then PH = Σ 3 p , where PH denotes the union of the entire polynomial hierarchy.
The claim PH = Σ 3 p means that polynomial hierarchy collapses into the third level, which is widely assumed to be false.The key proof method relies on composition algorithms.In order to use them immediately we introduce the formalization of our parameterized problem as a set of string-integer pairs: where Σ is an appropriate finite alphabet.

Composition algorithms
An or-composition algorithm for a parameterized problem L ⊆ Σ × N is an algorithm that where # / ∈ Σ is a special symbol.

Theorem 6 ([2]
).Let L be a parameterized problem having an or-composition algorithm.Assume that its unparameterized version L is NP-complete.If L has a polynomial kernel, then PH = Σ 3 p .The unparameterized version of L SYN is computationally as hard as the classical SYN, so it is NPcomplete.It remains only to describe an or-composition algorithm for L SYN , which is done in the remainder of this section.

Preprocessing
Let the or-composition algorithm receive an input consisting of t-state automata A 1 , . . ., A m , each of them equipped with a number k i .Assume that the following easy procedures have been already applied: • For each i = 1, . . ., m such that k i ≥ z(t), use the polynomial-time synchronizability algorithm from Corollary 1 to decide whether ((A i , k i ) , t) ∈ L SYN .If so, return a trivial true instance immediately.Otherwise just delete the i-th member from the sequence.
• For each i = 1, . . ., m, add an additional letter κ to A i such that κ acts as the identical mapping: • For each i = 1, . . ., m,rename the states and letters of A i such that After that, our algorithm chooses one of the following procedures according to the length m of the input sequence: where we add lengths of descriptions of the pairs.Note that D ≥ m ≥ 2 t and that D is the quantity used to restrict the running time of or-composition algorithms.By the lemma, in time we are able to analyze all the m automata and decide if some of them have a reset word of the corresponding length.It remains to output some appropriate trivial instance ((A , k ) , t ).
• If m < 2 t , put q(m) = log (m + 1) .It follows that q(m) ≤ t + 2. On the output of the orcomposition algorithm we put ((A , k ) , t ), where A is the automaton described in the following paragraphs and d = z(t) + 1 is our choice of the maximal length of reset words to be found in A .

Construction of A and its ideas
Here we describe the automaton A that appears in the output of our or-composition algorithm.We set The letters from m i=1 I i act on the states 1, . . ., t in the following way: for each s ∈ {1, . . ., t}, i ∈ {1, . . ., m}, a i,j ∈ I i .In other words, we let all the letters from all the automata A 1 , . . ., A m act on the states 1, . . ., t just as they did in the original automata.The additional letters act on 1, . . ., t simply as well: (C2) Any reset word w of A having length exactly z(t) + 1 is of the form for some i ∈ {1, . . ., m}, y 1 , . . ., y ki ∈ I i , and s ∈ {1, . . ., t} such that y 1 . . .y ki is a reset word of A i .
(C3) Any word w • of the form (2), • and satisfying Fig. 1: Some transitions of the example automaton described in Sec.3.4.Grey states remain active after applying α6.
If the guard table manages to guarantee these three properties of A , we are done: It is easy to check that they imply all the conditions given in the definition of a composition algorithm.So, let us define the action of the letters from I on the states from {0, . . ., z(t)} × {0, . . ., q(m)} × {T, F}.After that A will be complete and we will check the properties C1, C2, C3.The actions of α 1 , . . ., α m should meet the following two conditions: • Any reset word w of length z(t) + 1 has to start with some α i .
• After applying the first letter α i there must occur at least z(t) − 1 consecutive letters from I i .Informally, by applying α i we choose the automaton A i .
How to do that?The number m may be quite large and each of α 1 , . . ., α m needs to have a unique effect.
The key tool is what we call activity patterns.Let us work with the set R = {0, . . ., q(m)} , which matches ,,half of a row" of the guard table.Subsets of R correspond in a canonical way to binary representations of numbers 0, . . ., 2 q(m)+1 − 1.We will actually represent only the numbers 1, . . ., m.These does not include any of the extreme values corresponding to the empty set and whole R, because we have m < 2 q(m)+1 − 1.Let the mapping b : {1, . . ., m} → 2 R assign the corresponding subset of R to a number.For instance, it holds that b(11) = {0, 1, 3} because 11 = 2 0 + 2 1 + 2 3 .For each i ∈ {1, . . ., m} we define specific pattern functions for each i.It is irrelevant how exactly π T i and π F i are defined.It is sure that they exist, because the range is never expected to be empty.The action of the letters α 1 , . . ., α m is , for each i ∈ {1, . . ., m} , h ∈ {0, . . ., z(t)}, and p ∈ R.
Note that each α i maps the entire guard table, including row 0, into row 1.In fact, all ,,downward" transitions within the guard table will lead only one row down and the only transitions escaping from the guard table will lead from the bottom row.Thus, any reset word will have length at least k = z(t) + 1.Moreover, during its application, at time l the rows 0, . . ., l − 1 will have to be all inactive.This is a key mechanism that the guard table uses for enforcing necessary properties of short reset words.
Let us define how the letters a i,j act on the guard table.Choose any i ∈ {1, . . ., m}.The action of a i,j within the guard table does not depend on j.All the letters coming from a single automaton act identically here: • for the rows h ∈ {1, . . ., k i } we set otherwise, • for the remaining rows h ∈ {0} ∪ {k i + 1, . . ., z(t)} we set Recall that sending an activity marker along any transition ending in the row 0 is a ,,suicide".A word that does this cannot be a short reset word.So, if we restrict ourselves to the letters from some I i , the transitions defined above imply that the forthcoming letter can be a i,j only at times 1, . . ., k i .In the following z(t) − k i − 1 steps the only letter from I i that can be applied is κ.
The letter κ maps all the states of the guard table simply one state down, except for the rows 0 and z(t).

An example
Consider an input consisting of m = 12 automata A 1 , . . ., A 12 , each of them having t = 4 states.Because z(4) = 10 and q(12) = 3, the output automaton A has 93 states in total.In Fig. 1 all the states are depicted, together with some of the transitions.We focus on the transitions corresponding to the automaton A 6 , assuming that k 6 = 5.
The action of α 6 is determined by the fact that 6 = 2 1 + 2 2 and thus If the first letter of a reset word is α 6 , when applied, only the states remain active within the guard table.Now we need to move their activity markers one row down in each of the following z(t) − 1 = 9 steps.The only way to do this is to apply k 6 = 5 letters of I 6 and then z(t) − 1 − k 6 = 4 occurrences of κ.Then we are allowed to apply one of the letters ω 1 , . . ., ω t .But before that time there should remain only one active state s ∈ {1, . . ., t}, so that we could use ω s .The letter κ does not affect the activity within {1, . . ., t} so we need to synchronize these states using k 6 = 5 letters from I 6 .So, any short reset word of A starting with α 6 has to contain a short reset word of A 6 .

The guard table works
It remains to use the ideas informally outlined in Sec.3.3 to prove that A has the properties C1, C2, and C3 from Sec. 3.3.

Proof C1:
As it has been said, for each x ∈ I and each state (h, p, Q), where Q ∈ {T, F} and h ∈ {0, . . ., z(t) − 1}, it holds that (h, p, Q) where h < h or h = h + 1.So the shortest paths from the row 0 to the state D have lengths at least z(t) + 1.
Proof C2: We should prove that any reset word w having length exactly z(t) + 1 is of the form where y 1 . . .y ki is a reset word of A i .The starting α i is necessary, because α 1 , . . ., α m are the only letters that map states from the row 0 to other rows.Denote the remaining z(t) letters of w by y 1 , . . ., y z(t) .
Once an α i is applied, only |R| = q(m) + 1 active states in the guard table remain.All of them are in the row 1, depending on i.The active states are exactly from because this is exactly the range of α i within the guard table.Let us continue by an induction.We claim that for 0 ≤ τ < k i it holds what we have already proved for τ = 0: 1.If τ ≥ 1, the letter y τ lies in I i .Moreover, if τ > k i , it holds that w τ = κ.
For τ = 0 both claims hold.Take some 1 ≤ τ < k i and suppose that the claims hold for τ − 1.Let us use the second claim for τ − 1 to prove the first claim for τ .All the states from {τ } × b(i) × {T} and {τ } × R\b(i) × {F} are active.Which letter may appear as y τ ?The letters ω 1 , . . ., ω t and α 1 , . . ., α m would map all the active states to rows 0 and 1, which is a contradiction.Consider any letter a l,j for l = i.It holds that b(i) = b(l), so there is some p ∈ R lying in their symmetrical difference.For such p it holds that (τ, p, T) This necessarily activates some state in the row 0, which is a contradiction again.So, y τ ∈ I i .Moreover, if τ > k i , the letters from I i \ {κ} map the entire row τ into the row 0, so the only possibility is y τ = κ.
The letter y τ maps all the active states right down to the row τ + 1, so the second claim for τ holds as well.
Proof C3: It is easy to verify that no ,,suicidal" transitions within the guard table are used, so during the application of y 1 . . .y ki κ z(t)−1−ki the activity markers just flow down from the row 1 to the row z(t).Since y 1 . . .y ki is a reset word of A i , there remains only one particular state s within {1, . . ., t}.Finally, the letter ω s is applied that maps s and the entire row z(t) directly to D.

Parameterization by the number of states
We point out that SRCP parameterized by the number of states has a polynomial kernel, so it necessarily lies in FPT.
and the algorithm just deletes appropriate edges in order to reduce the out-degree to |I |.Let us use a procedure that: • takes an admissible graph with out-degree d > t • (z(t) − 1) • for each of its vertices: finds an outgoing multiedge with the largest multiplicity (which is at least z(t)), deletes one edge from the multiedge.
Clearly the resulting graph has out-degree d − 1.We create the graph G by repeating this procedure (starting with G) until the out-degree is at most t • (z(t) − 1).Now we claim that The upward implication is trivial since any coloring of G can be extended to G and the appropriate reset word can be still used.On the other hand, let us have a coloring δ of G such that |δ(Q, w)| = 1 for a word w of length at most k < z(t), so it uses at most z(t) − 1 letters from I. If we delete from G all the edges labeled by non-used letters, we get a subgraph of G because during the reduction of edges we have reduced only multiedges having more than z(t) − 1 edges.So we are able to color G according to the used letters of G and synchronize it by the word w.

Restriction to |I| = 2 and k = 3
Here we prove that SRCP restricted to |I| = 2 and k = 3 is decidable in polynomial time.If G = (Q, E) is a graph, by V i (q) we denote the set of vertices from which there is a path of length i leading to q and there is no shorter one.For any w ∈ I * by G w we denote the set of graphs with outdegree 2 that admit a coloring δ such that δ(Q, w) = {q} for some q ∈ Q.
Lemma 2. A graph G = (Q, E) lies in G aaa if and only if there is a state q ∈ Q such that (q, q) ∈ E and there is a path of length at most 3 from each r ∈ Q to q.
Proof: If there exists a coloring δ with δ(Q, aaa) = {q}, both claims follow immediately.On the other hand, if the loop (q, q) and all the paths leading to q are colored by a, we obtain a suitable coloring.Let us perform a reduction from 3-SAT.Consider a propositional formula of the form and l j,k ∈ {x 1 , . . ., x n , x 1 , . . ., x n } for each j ∈ {1, . . ., m} and k ∈ {1, 2, 3}.
We construct a directed multigraph G Φ = (Q, E) with states, each of them having exactly two outgoing edges.We describe Q as a disjoint union of the following sets: where for each j ∈ {1, . . ., m} and i ∈ {1, . . ., n}.The parts C j correspond to clauses, the parts V i correspond to variables.In each V i there are two special states labeled by literals x i and x i .All the edges of G Φ are defined by Figures 2, 3, 4.
Fig. 2: The part Cj.Note the edges that depend on Φ: they end in vertices labeled by literals from Cj. x

The upward implication
Suppose that there is a labeling δ by letters a (solid) and b (dotted) such that w = y 1 . . .y 4 ∈ {a, b} Let a be the first letter of w.By a k-path (resp.k-reachable) we understand a path of length exactly k (resp.reachable by a path of length exactly k).Lemma 6.All edges outgoing from states of D are labeled as in Figure 6.
Proof: Since D 4 is not 3-reachable from D 0 nor D 6 , all the edges incoming to D 0 and D 6 are labeled by b.The remaining labeling follows easily.Proof: If both x i and x i are active after applying y 1 y 2 = ab, there have to be 2-paths labeled by a 2 from both x i , x i to D 4 .It is easy to see that it is not possible to find such labeling.
We are done -the existence of a satisfying assignment is guaranteed.

The downward implication
For a given satisfying assignment we construct a coloring based on the above-mentioned ideas and the example given by Fig. 7.
• For each j, the coloring of edges outgoing from C j,0 , C j,1 , C j,2 depends on which of the three literals of C j are satisfied by the assignment (the example assigns x 1 = 1, x 2 = 0, x 3 = 0, x 4 = 1).The 2-path from C j,0 labeled by ab should lead to a state labeled by a satisfied literal.The edges outgoing from C j,3 and C j,4 are always colored in the same way.
• For each i, all the edges outgoing from the states of the V i part are colored in one of two ways depending on the truth value assigned to x i .
• The edges outgoing from the states of D admit the only possible coloring.Note that in our example the edges outgoing from the states of V 3 could be colored in the opposite way as well.None of the literals x 3 , x 3 is chosen by the coloring to satisfy a clause.

Strong connectivity
If there is a non-negated occurrence of each x i in Φ, the graph G Φ is strongly connected.This assumption can be easily guaranteed by adding tautological clauses like x i ∨ x i ∨ x i .In [22] we study SRCW with respect to fixed values of both |I| and W .For |I| = 2, singleton sets W that make the problem NP-complete are characterized.We also study the situation with the additional restriction to strongly connected graphs.We show that the complexity differs in the case |I| = 2 and W = {abb}.However, with such restriction the characterization remains incomplete.There are also no results about non-binary alphabets and non-singleton sets W .The current state of art is mostly depicted in Tab. 3.

2. 1
Automata and synchronizationA deterministic finite automaton is a triple A = (Q, I, δ), where Q and I are finite sets and δ is an arbitrary mappingQ × I → Q. Elements of Q are calledstates, I is the alphabet.The transition function δ is naturally extended to Q × I → Q, still denoted by δ, slightly abusing the notation.We extend it also by defining δ(S, w) = {δ(s, w) | s ∈ S} for each S ⊆ Q and w ∈ I .If an automaton A = (Q, I, δ) is fixed, we write r x −→ s instead of δ (r, x) = s.For a given automaton A = (Q, I, δ) we call w ∈ I a reset word if |δ(Q, w)| = 1.
s otherwise for each s, s ∈ {1, . . ., t}, i ∈ {1, . . ., m}.The state D is a sink state, which means that D y −→ D for each y ∈ I .Note that any reset word of A has to map all the states of Q to D.The remaining 2 • (z(t) + 1) • (q(m) + 1) states form what we call a guard table.Its purpose is to guarantee that: (C1) Any reset word of A has to be of length at least k = z(t) + 1.

Theorem 7 .
There is a polynomial kernel for SRCP parameterized by t = |Q|.Proof: The algorithm takes an instance of SRCP, i.e., an alphabet I, an admissible graph G = (Q, E) with out-degrees |I|, and a number k ∈ N. It produces another instance of size depending only on t = |Q|.If k ≥ z(t), we just solve the problem using Corollary 1 and output a trivial instance.Otherwise the output instance is denoted by I , G = (Q , E ) , k , where

Lemma 5 .
The synchronization takes place in D 4 .Proof: From D 1 only states from D are 4-reachable.From D 0 the only states within D that are 4reachable are D 2 , D 3 , D 4 .From C 1,0 only D 4 is 4-reachable.

5
Further Research: SRCW Part of the RSCP input consists of a prescribed length of a reset word that should be used in the road coloring.But what if an exact reset word or a set of possible reset words were prescribed?This problem is called SRCW: SRCW Input: Alphabet I, admissible graph G = (Q, E) with out-degrees |I|, W ⊆ I Output: Is there a coloring δ such that |δ(Q, w)| = 1 for some w ∈ W ?
in 2008 by Tab. 1: Results of the complete multi-parameter analysis of SYN and SRCP.Diamonds mark the results of the present paper 5, . . .
Tab. 2: Complexity of SRCP restricted to particular values of k and |I| 2 Preliminaries