1 Introduction
^{1}^{1}todo: 1 noch etwas geschichte. subset sync varianten und so Skizze NPReduktion. QED an alle Beweise. erwähnen, dass nichts mit polycyclic monoid zu tun hat.A deterministic semiautomaton is synchronizing if it admits a reset word, i.e., a word which leads to some definite state, regardless of the starting state. This notion has a wide range of applications, from software testing, circuit synthesis, communication engineering and the like, see [25, 23]. The famous Černý conjecture [3] states that a minimal synchronizing word has at most quadratic length. We refer to the mentioned survey articles for details. Due to its importance, the notion of synchronization has undergone a range of generalizations and variations for other automata models. It was noted in [16] that in some generalizations only certain paths, or input words, are allowed (namely those for which the input automaton is defined). In [10] the notion of constraint synchronization was introduced in connection with a reduction procedure for synchronizing automata. The paper [8] introduced the computational problem of constraint synchronization. In this problem, we search for a synchronizing word coming from some specific subset of allowed input sequences. For further motivation and applications we refer to the aforementioned paper [8]. Let us mention that restricting the solution space by a regular language has also been applied in other areas, for example to topological sorting [1], solving word equations [4, 5], constraint programming [18], or shortest path problems [20]. In [8] it was shown that the smallest partial constraint automaton for which the problem becomes PSPACEcomplete has two states and a ternary alphabet. Also, the smallest constraint automaton for which the problem is NPcomplete needs three states and a binary alphabet. A complete classification of the complexity landscape for constraint automata with two states and a binary or ternary alphabet was given in this previous work. In [12] the result for twostate automata was generalized to arbitrary alphabets, and a complexity classification for special threestate constraint automata over a binary alphabet was given. As shown in [11], for regular commutative constraint languages, we only find constraint problems that are NPcomplete, PSPACEcomplete, or solvable in polynomial time. In all the mentioned work [8, 11, 12], it was noted that the constraint automata for which the corresponding constraint synchronization problem is NPcomplete admit a special form, which we generalize in this work.
Our contribution: Here, we generalize a Theorem from [8] to give a wider class of constrained synchronization problems in NP. As noted in [12], the constraint automata that yield problems in NP admit a special form and our class encompasses all known cases of constraint problems in NP. We also give a characterization that this class is given precisely by those constraint automata whose strongly connected components are single cycles. We call automata of this type polycyclic. Then we introduce the language class of polycyclic languages. We show that this class is closed under boolean operations, quotients, concatenation and also admits certain robustness properties with respect to different definitions by partial, complete or nondeterministic automata. Lastly, we also give a criterion for our class that yields constraint synchronization problems that are NPcomplete and a criterion for problems in P.
2 Preliminaries and Definitions
By we denote the natural numbers, including zero. Throughout the paper, we consider deterministic finite automata (DFAs). Recall that a DFA is a tuple , where the alphabet is a finite set of input symbols, is the finite state set, with start state , and final state set . The transition function extends to words from in the usual way. The function can be further extended to sets of states in the following way. For every set with and , we set . We sometimes refer to the function as a relation and we identify a transition with the tuple . We call complete if is defined for every ; if is undefined for some , the automaton is called partial. If , we call a unary automaton. The set denotes the language accepted by . A semiautomaton is a finite automaton without a specified start state and with no specified set of final states. The properties of being deterministic, partial, and complete of semiautomata are defined as for DFA. When the context is clear, we call both deterministic finite automata and semiautomata simply automata. We call a deterministic complete semiautomaton a DCSA and a partial deterministic finite automaton a PDFA for short. If we want to add an explicit initial state and an explicit set of final states to a DCSA or change them in a DFA , we use the notation . A nondeterministic finite automaton (NFA) is a tuple where is an arbitrary relation. Hence, they generalize deterministic automata. With a nondeterministic automaton we also associate the set of accepted words . We refer to [13] for a more formal treatment. In this work, when we only use the word automaton without any adjective, we always mean a deterministic automaton. An automaton is called synchronizing if there exists a word with . In this case, we call a synchronizing word for . For a word , we call a state in an active state. We call a state with for some a synchronizing state. A state from which some final state is reachable is called coaccessible. For a set , we say is reachable from or is synchronizable to if there exists a word such that . We call an automaton initially connected, if every state is reachable from the start state. An automaton is called returning, if for every state , there exists a word such that , where is the start state of .
Fact 1
[25] For any DCSA, we can decide if it is synchronizing in polynomial time . Additionally, if we want to compute a synchronizing word , then we need time and the length of will be .
The following obvious remark will be used frequently without further mentioning.
Lemma 1
Let be a DCSA and be a synchronizing word for . Then for every , the word is also synchronizing for .
For a fixed PDFA , we define the constrained synchronization problem:
The automaton will be called the constraint automaton. If an automaton is a yesinstance of ConstrSync we call synchronizing with respect to . Occasionally, we do not specify and rather talk about ConstrSync. We are going to inspect the complexity of this problem for different (small) constraint automata. We assume the reader to have some basic knowledge in computational complexity theory and formal language theory, as contained, e.g., in [13]. For instance, we make use of regular expressions to describe languages, or use manyone polynomial time reductions. We write for the empty word, and for we denote by the length of . For some language , we denote by , and the set of prefixes, suffixes and factors of words in . The language is called prefixfree if for each we have . If , a prefix is called a proper prefix if . For and , the language is called a quotient (of by ). We also identify singleton sets with its elements. And we make use of complexity classes like P, NP, or PSPACE. A trap (or sink) state in a (semi)automaton is a state such that for each . If a synchronizable automaton admits a sink state, then this is the only state to which we could synchronize every other state, as it could only map to itself. For an automaton , we say that two states are connected, if one is reachable from the other, i.e., we have a word such that . A subset of states is called strongly connected, if all pairs from are connected. A maximal strongly connected subset is called a strongly connected component. By combining Proposition 3.2 and Proposition 5.1 from [7], we get the next result.
Lemma 2
For any automaton and any , we have for some regular prefixfree set.
We will also need the following combinatorial lemma from [24].
Lemma 3
[24] Let . If and , then and are powers of a common word.
We will only use the following variant, which has the same complexity.
Proposition 1 ()
The problems SetTransporter and DisjointSetTransporter are equivalent under polynomial time manyone reductions.
To be more specific, we will use Problem 2 for unary input DCSAs. Then it is NPcomplete.
Proposition 2 ()
For unary DCSAs the problem SetTransporter is NPcomplete.
In [8], with Theorem 2.1, a sufficient criterion was given when the constrained synchronization problem is in NP.
Theorem 2.1
Let be a PDFA. Then, if there is a such that for all states , if is infinite, then .
3 Results
First, in Section 3.1, we introduce polycyclic automata and generalize Theorem 2.1, thus widening the class for which the problem is contained in NP. Then, in Section 3.2, we take a closer look at polycyclic automata. We determine their form, show that they admit definitions by partial, complete and by nondeterministic automata and proof various closure properties. In Section 3.3 we state a general criterion that gives a polynomial time solvable problem. Then, in Section 3.4, we give a sufficient criterion for constraint languages that give NPcomplete problems, which could be used to construct polycyclic constraint languages that give NPcomplete problems.
3.1 A Sufficient Criterion for Containment in Np
The main result of this section is Theorem 3.1. But first, let us introduce the class of polycyclic partial automata.
Definition 1
(polycyclic PDFA) A PDFA is called polycyclic, if for all states we have for some .
The results from Section 3.2 will give some justification why we call these automata polycyclic. In Definition 1, languages that are given by automata with a single final state, which equals the start state, occur. Our first Lemma 4 determines the form of these languages, under the restriction in question, more precisely. Note that in any PDFA we have either that is infinite or .
Lemma 4
Let be a PDFA. Suppose we have a state such that for some . Then for some .
Proof
By Lemma 2, we have for some prefix code . But for a prefix code implies for some . ∎
Now, we are ready to state the main result of this section.
Theorem 3.1 ()
Let be a polycyclic partial automaton. Then .
Proof
By Lemma 4, we can assume for some for each such that . Let be all such words. Set . Every word of length greater than must traverse some cycle. Therefore, any word can be partitioned into at most substrings , for some numbers , , and^{1}^{1}1We added the empty word so that we can assume we have a partition into exactly such substrings. for some finite set of words , such that for all . Let be a yesinstance of . Let be a synchronizing word for partitioned as mentioned above.
Claim 1: If for some , , then we can replace it by some , yielding a word that synchronizes . This could be seen by considering the nonempty subsets
for . If , then some such subsets appears at least twice, but then we can delete the power of between those appearances.
We will now show that we can decide whether is synchronizing with respect to in polynomial time using nondeterminism despite the fact that an actual synchronizing word might be exponentially large. This problem is circumvented by some preprocessing based on modulo arithmetic, and by using a more compact representation for a synchronizing word. We will assume we have some numbering of the states, hence the are numbers. Then, instead of the above form, we will represent a synchronizing word in the form , where is some new symbol that works as a separator, and similar are new symbols to write down the binary number, or the unary presentation of , indicating which word is to be repeated. As by the above claim and is fixed by the problem specification, the length of is polynomially bounded, and we use nondeterminism to guess such a code for a synchronizing word.
Claim 2: For each and , one can compute in polynomial time numbers such that, given some number in binary, based on , one can compute in polynomial time a number such that .
Proof (Proof of Claim 2 of Theorem 2.1)
For each state and , we calculate its orbit , that is, the set
such that all states in are distinct but . Let and be the lengths of the tail and the cycle, respectively; these are nonnegative integers that do not exceed . Observe that includes the cycle . We can use this information to calculate , given a nonnegative integer and a state , as follows: (a) If , we can find . (b) If , then lies on the cycle. Compute . Clearly, . The crucial observation is that this computation can be done in time polynomial in and in . As a consequence, given and (in binary), we can compute in polynomial time.
The NPmachine guesses partbypart, keeping track of the set of active states of and of the current state of . Initially, and . For , when guessing the number in binary, by Claim 1 we guess many bits. By Claim 2, we can update and in polynomial time. After guessing , we can simply update and by simulating this input, as , which is a constant in our setting. Finally, check if and if . ∎
3.2 Properties of Polycyclic Automata
Here, we look closer at polycyclic automata. We find that every strongly connected component of a polycyclic PDFA essentially consists of a single cycle, i.e, for each strongly connected component and we have . Hence, these automata admit a notable simple structure. We then introduce the class of polycyclic languages. In Proposition 4 we show that these languages could be characterized with accepting nondeterministic automata. This result yields closure under union.
Proposition 3 ()
Let be a PDFA. Then every strongly connected component of is a single cycle if and only if is polycyclic.
We transfer our definition from automata to languages.
Definition 2
A language is called polycyclic, if there exists a polycylic PDFA accepting it.
Hence, we have the result that the constraint synchronization problem is in NP if the constrain language is polycyclic. As we can construct from every PDFA accepting a language a complete DFA accepting the same language by addding a nonfinal trap state, the next is implied.
Lemma 5
A language is polycyclic if and only if it is accepted by a complete DFA all of whose strongly connected components form a single cycle.
But, we can also use nondeterministic automata in the definition of polycyclic languages. We need the next lemma to prove this claim.
Lemma 6 ()
Let be a PDFA such that for some state we have . Then for some word .
With Lemma 6 we can prove the next characterization by nondeterministic automata.
Proposition 4
A language is polycyclic if and only if it accepted by a nondeterministic automata such that for all states we have for some .
Proof
If is polycyclic, we have a polycyclic PDFA accepting it. As nondeterministic automata generalize partial automata, one implication is implied. Conversely, let be a nondeterministic automaton with such that for all states we have for some . Let and with
(1) 
i.e., the word labels a cycle in the power set automaton^{2}^{2}2See [13] for the power set construction for conversion of a nondeterministic automaton into an equivalent deterministic automaton.. Construct a sequence for by choosing arbitrary, and then inductively if was chosen, choose some . Note that by Equation (1). As is finite, we find with . But then labels a cycle in . So, by assumption, for some word that only depends on . By Lemma 3, both and are powers of a common word. Let . Then, as is finite, is finite. By the above reasoning, for each which fulfills Equation (1), we have . By Lemma 6 the set of all these words is contained in a language of the form for some .
A useful property, which will be used in Section 3.4 for constructing examples that yield NPcomplete problems, is that the class of polycyclic languages is closed under concatenation. We need the next Lemma to prove this claim, which gives a certain normal form.
Lemma 7 ()
Let be a polycyclic language. Then, there exists an accepting polycyclic PDFA such that is not contained in any cycle, i.e., .
Intuitively, for an automaton that has the form as stated in Lemma 7, we can compute its concatenation with another regular language by identifying the start state with every final state of an automaton for .
Proposition 5 ()
If are polycyclic, then is polycyclic.
We also have further closure properties.
Proposition 6 ()
The polycyclic languages are closed under the boolean operations and quotients.
Without proof, we note that polycyclic automata are a special case of solvable automata as introduced in [22]. Solvable automata are constructed out of commutative automata, and here polycyclic automata are constructed out of cycles in the same manner. Without getting to technical, let us note that in abstract algebra and the theory of groups, a polycyclic group is a group constructed out of cyclic groups in the same manner as a solvable group is constructed out of commutative groups [19]. Hence, the naming supports the analogy to group theory quite well. Also, let us note that polycyclic automata have cycle rank [6] at most one, hence they have star height at most one. But they are properly contained in the languages of star height one, as shown for example by .
3.3 Polynomial Time Solvable Cases
Here, with Proposition 7, we state a sufficient criterion for a polycyclic constraint automaton that gives constrained synchronization problems that are solvable in polynomial time. Please see Figure 1 for an example constraint automaton whose constraint synchronization problem is in P according to Proposition 7.
Proposition 7
Let be a polycyclic PDFA. If for any reachable with we have , then the problem is solvable in polynomial time.
Proof
By Lemma 4, we can assume for some for each such that . Let be all such words. Set . Every word of length greater than must traverse some cycle. Therefore, any word can be partitioned into at most substrings , for some numbers , and^{3}^{3}3We added the empty word so that we can assume we have a partition into exactly such substrings. for some finite set of words , such that for all .
We show that by our assumptions we could choose the numbers to be strictly smaller than .
Claim 1: If for some , , then we can replace it by , yielding a word that synchronizes .
Proof (Proof of Claim 1 of Proposition 7)
Let be arbitrary with and (otherwise we have nothing to prove). Set , and . By choice of the decomposition of , if , we have and . Write . By assumption for some and . Hence, for each we have as every word that has as a suffix maps any state to a state in . Let us assume in the following argument, as this is a fixed parameter of the conclusion would be the same if we replace by in the next argument.
First we show . For we have and as this gives . Now let us show the other inclusion . Let . By the pigeonhole principle
Hence equals for some . Choose such that with . Note that for each as . Set By assumption . Then
So . Hence, regarding our original problem, if , we have , as inductively .
So, to find out if we have any synchronizing word in , we only have to test the finitely many words
for , and . As , and are fixed, we have to test many words. For each test, we have to read in this word from any state, and need to compare the end result. If a unique state results, that this word synchronizes , otherwise not. All these operations could be performed in polynomial time with paramter .
3.4 Npcomplete Cases
In [8] it was shown that for the constraint language and for the languages with the corresponding constraint synchronization problems are NPcomplete. All NPcomplete problems with a state constraint automaton and a binary alphabet where determined in [12]. Here, with Proposition 8, we state a general scheme, involving the concatenation operator, to construct NPhard problems. As, by Proposition 5, the polycyclic languages are closed under concatenation. This gives us a method to construct NPcomplete constraint synchronization problems with polycyclic constraint languages.
Proposition 8
Suppose we find such that we can write for some nonempty language with
Then is NPhard.
Proof
Note that implies , implies and with implies . We show NPhardness by reduction from DisjointSetTransporter for unary automata, which is NPcomplete by Proposition 1 and Proposition 2. Let be an instance of DisjointSetTransporter with unary semiautomaton . Write with for . We construct a new semiautomaton with , where are disjoint copies of and is a new state that will work as a trap state in . Assume for are bijections with . Also, to simplify the formulas, set and the identity map. Next, for and we define
Note that by construction of , we have for and
(2) 

Suppose we have such that in . Because is not a factor of , by construction of , we have , where is reached as . This yields . By construction of , for any , as . Also , as and by the assumption .

Suppose we have that synchronizes . Then, as is a trap state, . Write with . By construction of , we have . Write with . We argue that we must have . For assume we have with , then by construction of . As , and hence , by construction of , this gives , as is not a prefix of and does not contain as a factor. More specifically, to go from to or , in case , we have to read . But does not contain as a factor. But then, by construction of , for any , we have . This gives, that if with and we have as after reading at most symbols of any factor of , starting in a state from , we must return to this state at least once while reading this factor. Note that by the above reasoning we find a prefix of with such that in case . If , then either or . So, in no case could we end up in the state . Hence, we must have have for each .
So, we have a synchronizing word for from if and only if we can map the set into in .
If with , by choosing with we get that gives an NPcomplete problem. This shows that for example yields an NPcomplete problem.
4 Conclusion
We introduced the class of polycyclic automata and showed that for polycyclic constraint automata, the constrained synchronization problem is in NP. For these contraint automata, we have given a sufficient criterion that yields problems in P, and a criterion that yields problems that are NPcomplete. But, both criteria do not cover all cases. Hence, there are still polycyclic constraint automata left for which we do not know the exact computational complexity in NP of the constraint synchronization problem. A dichotomy theorem for our class, i.e, that every problem is either NPcomplete or in P, would be very interesting. But, much more interesting would be if we could find any NPintermediate problems, or at least candidate problems that are neither NPcomplete nor provable in P. Lastly, we took a closer look at polycyclic automata, determined their form and also gave a characterization in terms of nondeterministic automata. We also introduced polycyclic languages and proved basic closure properties for this class.
Acknowledgement. I thank Prof. Dr. Mikhail V. Volkov for suggesting the problem of constrained synchronization during the workshop ‘Modern Complexity Aspects of Formal Languages’ that took place at Trier University 11.–15. February, 2019. The financial support of this workshop by the DFGfunded project FE560/91 is gratefully acknowledged.
References
 [1] (2018) Topological sorting with regular constraints. In 45th International Colloquium on Automata, Languages, and Programming, ICALP 2018, July 913, 2018, Prague, Czech Republic, I. Chatzigiannakis, C. Kaklamanis, D. Marx, and D. Sannella (Eds.), LIPIcs, Vol. 107, pp. 115:1–115:14. Cited by: §1.
 [2] (2016) The complexity of intersecting finite automata having few final states. Comput. Complex. 25 (4), pp. 775–814. Cited by: §2.
 [3] (1964) Poznámka k homogénnym experimentom s konečnými automatmi. Matematickofyzikálny časopis 14 (3), pp. 208–216. Cited by: §1.
 [4] (2005) The existential theory of equations with rational constraints in free groups is PSPACEcomplete. Inf. Comput. 202 (2), pp. 105–140. External Links: Link Cited by: §1.
 [5] (199803) Makanin’s algorithm for solving word equations with regular constraints. Report, Fakultät Informatik, Universität Stuttgart, pp. . Cited by: §1.
 [6] (196312) Transition graphs and the starheight of regular events. The Michigan Mathematical Journal 10 (4), pp. 385–397. Cited by: §3.2.
 [7] (1974) Automata, languages, and machines, volume a. Academic Press, Inc., Orlando, FL, USA. External Links: ISBN 0122340019 Cited by: §2.
 [8] (2019) Computational complexity of synchronization under regular constraints. See 44th international symposium on mathematical foundations of computer science, MFCS 2019, august 2630, 2019, aachen, germany, Rossmanith et al., pp. 63:1–63:14. External Links: Link Cited by: §1, §1, §2, §3.4.
 [9] (2017) Problems on finite automata and the exponential time hypothesis. Algorithms 10 (1), pp. 24. Cited by: §5.2.
 [10] (2012) Synchronizing automata of bounded rank. In Implementation and Application of Automata  17th International Conference, CIAA, N. Moreira and R. Reis (Eds.), LNCS, Vol. 7381, pp. 171–179. Note: Cited by: §1.
 [11] (2020) Computational complexity of synchronization under regular commutative constraints. CoRR abs/2005.04042. External Links: Link, 2005.04042 Cited by: §1.
 [12] (2020) Constraint synchronization with two or three state partial constraint automata. CoRR abs/2005.05907. External Links: Link, 2005.05907 Cited by: §1, §1, §3.4.
 [13] (2001) Introduction to automata theory, languages, and computation. 2nd edition, AddisonWesley. Cited by: §2, §2, footnote 2.
 [14] (1977) Lower bounds for natural proof systems. In 18th Annual Symposium on Foundations of Computer Science, FOCS, pp. 254–266. Cited by: §5.2.
 [15] (1988) Parallel algorithms for solvable permutation groups. J. Comput. Syst. Sci. 37 (1), pp. 39–62. Cited by: §2.
 [16] (2012) Synchronization of automata with one undefined or ambiguous transition. See Implementation and application of automata  17th international conference, CIAA 2012, porto, portugal, july 1720, 2012. proceedings, Moreira and Reis, pp. 278–288. Cited by: §1.
 [17] N. Moreira and R. Reis (Eds.) (2012) Implementation and application of automata  17th international conference, CIAA 2012, porto, portugal, july 1720, 2012. proceedings. LNCS, Vol. 7381, Springer. Cited by: 16.
 [18] (2004) A regular language membership constraint for finite sequences of variables. In Principles and Practice of Constraint Programming  CP 2004, 10th International Conference, CP 2004, Toronto, Canada, September 27  October 1, 2004, Proceedings, M. Wallace (Ed.), Lecture Notes in Computer Science, Vol. 3258, pp. 482–495. Cited by: §1.
 [19] (1995) A course in the theory of groups. 2 edition, Springer. Cited by: §3.2.
 [20] (1988) Shortest path under rational constraint. Inf. Process. Lett. 28 (5), pp. 245–248. External Links: Link Cited by: §1.
 [21] P. Rossmanith, P. Heggernes, and J. Katoen (Eds.) (2019) 44th international symposium on mathematical foundations of computer science, MFCS 2019, august 2630, 2019, aachen, germany. LIPIcs, Vol. 138, Schloss Dagstuhl  LeibnizZentrum für Informatik. External Links: Link, ISBN 9783959771177 Cited by: 8.
 [22] (1996) Exact linear bound for the length of reset words in commutative automata. Publicationes Mathematicae, Debrecen 48 (34), pp. 405–409. Cited by: §3.2.
 [23] (2005) Homing and synchronizing sequences. In ModelBased Testing of Reactive Systems, M. Broy, B. Jonsson, J.P. Katoen, M. Leucker, and A. Pretschner (Eds.), LNCS, Vol. 3472, pp. 5–33. Cited by: §1.
 [24] (1962) The equation aM=bNcP in a free group.. Michigan Mathematical Journal 9 (4), pp. 289–298. Cited by: §2, Lemma 3.
 [25] (2008) Synchronizing automata and the Černý conjecture. In Language and Automata Theory and Applications, 2nd Int. Conference, LATA, C. MartínVide, F. Otto, and H. Fernau (Eds.), LNCS, Vol. 5196, pp. 11–27. Cited by: §1, Fact 1.
5 Appendix
Here, we collect some proofs not given in the main text.
5.1 Proof of Proposition 1 (See page 1)
See 1
Proof
Let be an instance of DisjointSetTransporter, then we can feed it unaltered into an algorithm for SetTransporter. Now assume is an instance of SetTransporter. If , then the empty word maps into and this case can be easily checked. Hence, assume . In this case, any word with must be nonempty. Let be a disjoint copy of with . Construct with and for and , and for and . We claim that maps into in if and only if it maps
Comments
There are no comments yet.