Synchronization Problems in Automata without Non-trivial Cycles
Andrew Ryzhikov

TL;DR
This paper explores the computational complexity of synchronization problems in weakly acyclic automata, providing bounds, hardness results, and NP-completeness proofs for various synchronization-related tasks.
Contribution
It offers new bounds and complexity results for synchronization problems specifically in weakly acyclic automata, a subclass of aperiodic automata.
Findings
Bounds on shortest synchronizing words established
Approximation of synchronization length shown to be hard
NP-completeness results for recognizing synchronizing subsets
Abstract
We study the computational complexity of various problems related to synchronization of weakly acyclic automata, a subclass of widely studied aperiodic automata. We provide upper and lower bounds on the length of a shortest word synchronizing a weakly acyclic automaton or, more generally, a subset of its states, and show that the problem of approximating this length is hard. We investigate the complexity of finding a synchronizing set of states of maximum size. We also show inapproximability of the problem of computing the rank of a subset of states in a binary weakly acyclic automaton and prove that several problems related to recognizing a synchronizing subset of states in such automata are NP-complete.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Synchronization Problems in Automata
without Non-trivial Cycles
Andrew Ryzhikov1,2
(1Université Grenoble Alpes, Laboratoire G-SCOP, 38031 Grenoble, France
2United Institute of Informatics Problems of NASB, 220012 Minsk, Belarus
Abstract
We study the computational complexity of various problems related to synchronization of weakly acyclic automata, a subclass of widely studied aperiodic automata. We provide upper and lower bounds on the length of a shortest word synchronizing a weakly acyclic automaton or, more generally, a subset of its states, and show that the problem of approximating this length is hard. We investigate the complexity of finding a synchronizing set of states of maximum size. We also show inapproximability of the problem of computing the rank of a subset of states in a binary weakly acyclic automaton and prove that several problems related to recognizing a synchronizing subset of states in such automata are NP-complete.
1 Introduction
The concept of synchronization is widely studied in automata theory and has a lot of different applications in such areas as manufacturing, coding theory, biocomputing, semigroup theory and many others [Vol08]. Let be a complete deterministic finite automaton (which we simply call an automaton in this paper), where is a set of states, is a finite alphabet and is a transition function. Note that our definition of an automaton does not include initial and accepting states. The function can be naturally extended to a mapping , which we also denote as , in the following way: for and we recursively set . An automaton is called synchronizing if there exists a word that maps all its states to a fixed state. Such word is called a synchronizing word. A state is called a sink state if all letters from map to itself.
In this paper synchronization of weakly acyclic automata is studied. A simple cycle in an automaton is a sequence of its states such that all the states in the sequence are different and there exist letters such that for and . A simple cycle is a self-loop if it consists of only one state. An automaton is called weakly acyclic if all its simple cycles are self-loops. In other words, an automaton is weakly acyclic if and only if there exists an ordering of its states such that if for some letter , then (such ordering is called a topological sort). Since a topological sort can be found in polynomial time [CLRS09], this class can be recognized in polynomial time. Weakly acyclic automata are called acyclic in [JM12] and partially ordered in [BF80], where in particular the class of languages recognized by such automata is characterized.
Weakly acyclic automata arise naturally in synchronizing automata theory. Section 3 of this paper shows several examples of existing proofs where weakly acyclic automata appear implicitly in complexity reductions. Surprisingly, most of the computational problems that are hard for general automata remain very hard in this class despite its very simple structure. Thus, investigation of weakly acyclic automata provides good lower bounds on the complexity of many problems for general automata. An automaton is called aperiodic if for any word and any state there exists such that , where is a word obtained by concatenations of [Tra07]. Obviously, weakly acyclic automata form a proper subclass of aperiodic automata, thus all hardness results hold for the class of aperiodic automata.
The concept of synchronization is often used as an abstraction of returning control over an automaton when there is no a priori information about its current state, but the structure of the automaton is known. If the automaton is synchronizing, we can apply a synchronizing word to it, and thus it will transit to a known state. If we want to perform the same operation when the current state is known to belong to some subset of states of the automaton, we come to the definition of a synchronizing set. A set of states of an automaton is called synchronizing if there exists a word and a state such that the word maps each state to the state . The word is said to synchronize the set . It follows from the definition that an automaton is synchronizing if and only if the set of all its states is synchronizing. Consider the problem Sync Set of deciding whether a given set of states of an automaton is synchronizing.
[TABLE]
The Sync Set problem is PSPACE-complete [Rys83, San05], even for binary strongly connected automata [Vor16] (an automaton is called binary if its alphabet has size two, and strongly connected if any state can be mapped to any other state by some word). In [Nat86] it is shown that the Sync Set problem is solvable in polynomial time for orientable automata if the cyclic order respected by the automaton is provided in the input. This problem is also solvable in polynomial time for monotonic automata [RS17]. The problem of deciding whether the whole set of states of an automaton is synchronizing is also solvable in polynomial time [Vol08].
One of the most important questions in synchronizing automata theory is the famous Černý conjecture stating that any -state synchronizing automaton has a synchronizing word of length at most . The conjecture is proved for various special cases, including orientable, Eulerian, aperiodic and other automata (see [Vol08] for references), but is still open in general. For more than 30 years, the best upper bound was , obtained in [Pin83]. Recently, a small improvement on this bound has been reported in [Szy17]: the new bound is still cubic in but improves the coefficient at by .
While there is a simple cubic bound on the length of a synchronizing word for the whole automaton, there exist examples of automata where the length of a shortest word synchronizing a subset of states is exponential in the number of states [Vor16]. For orientable -state automata, a tight upper bound of is known [Epp90], and this bound is also asymptotically tight for monotonic automata [RS17]. On the other hand, a trivial upper bound on the length of a shortest word synchronizing a subset of states in a -state automaton is known [Vor16]. In [Car14] Cardoso considers the length of a shortest word synchronizing a subset of states in a synchronizing automaton.
We assume that the reader is familiar with the notions of an NP-complete problem (refer to the book by Sipser [Sip12]), an approximation algorithm and a gap-preserving reduction (for reference, see the book by Vazirani [Vaz01]).
Given an automaton , the rank of a word with respect to is the number , i.e., the size of the image of under the mapping defined in by . More generally, the rank of a word with respect to a subset of states of is the number . The rank of an automaton (resp. of a subset of states) is the minimum among the ranks of all words with respect to the automaton (resp. to the subset of states).
In this paper we provide various results concerning computational complexity and approximability of the problems related to subset synchronization in weakly acyclic automata. In Section 2 we prove some lower and upper bounds on the length of a shortest word synchronizing a weakly acyclic automaton or, more generally, a subset of its states. In Section 3 we investigate the computational complexity of finding such words. In Section 4 we study inapproximability of the problem of finding a subset of states of maximum size. In Section 5 we give strong inapproximability results for computing the rank of a subset of states in binary weakly acyclic automata. In Section 6 we show that several other problems related to recognizing a synchronizing set in a weakly acyclic automaton are hard.
A preliminary conference version of this paper was published in [Ryz17].
2 Bounds on the Length of Shortest Synchronizing Words
Each synchronizing weakly acyclic automaton is a [math]-automaton (i.e., an automaton with exactly one sink state), which gives an upper bound on the length of a shortest synchronizing word [Rys97]. The same bound can be deduced from the fact that each weakly acyclic automaton is aperiodic [Tra07]. However, for weakly acyclic automata a more accurate result can be obtained, showing that weakly acyclic automata of rank behave in a way similar to monotonic automata of rank (see [AV04]).
Proposition 1**.**
Let be a -state weakly acyclic automaton, such that there exists a word of rank with respect to . Then there exists a word of length at most and rank at most with respect to .
Proof.
Observe that the rank of a weakly acyclic automaton is equal to the number of sink states in it. The conditions of the theorem imply that has at most sink states.
Consider the sets constructed in the following way. Let be the state in with the smallest index in the topological sort such that is not a sink state. Let , be a letter mapping the state to some other state, where , and . Since has at most sink states, the word exists for any and has rank at most with respect to . ∎
The following simple example shows that the bound is tight. Consider an automaton with states . Let each letter except some letter map each state to itself. For the letter define the transition function for and for . Obviously, has rank and shortest words of rank with respect to have length .
Proposition 2**.**
Let be a synchronizing set of states of size in a weakly acyclic -state automaton . Then the length of a shortest word synchronizing is at most .
Proof.
Consider a topological sort of the set . Let be a state such that all states in can be mapped to it by a shortest word . We can assume that the images of all words , , are pairwise distinct, otherwise some letter in this word can be removed. Then a letter maps at least one state of the set to some other state. Thus the maximum total number of letters in sending all states in to is at most , since application of each letter of increases the sum of the indices of reached states by at least one. ∎
Consider a binary automaton with states , , , where . Define , for , . Define also for , for . Define both transitions for and as self-loops. Set . The shortest word synchronizing is of length . The automaton in this example is binary weakly acyclic, and even has rank . Figure 1 gives the idea of the described construction.
As was noted by an anonymous reviewer, for alphabet of size , a better lower bound of can be shown as follows. Let , ,
[TABLE]
If and , then it is easy to see that the shortest word synchronizing has length . For each and , this is less than the upper bound of Proposition 2 by only.
3 Complexity of Finding Shortest Synchronizing Words
Now we proceed to the computational complexity of some problems, related to finding a shortest synchronizing word for an automaton. Consider first the following problem.
[TABLE]
First, we note that the automaton showing inapproximability of Shortest Sync Word in the construction of Berlinkov [Ber14] is weakly acyclic.
Proposition 3**.**
For any , the Shortest Sync Word problem for -state weakly acyclic automata with alphabet of size at most cannot be approximated in polynomial time within a factor of for any unless P = NP, where is some constant.
In Berlinkov’s reduction to the binary case, the automaton is no longer weakly acyclic. However, the binary automaton showing NP-hardness of Shortest Sync Word in Eppstein’s construction [Epp90] is weakly acyclic.
Proposition 4**.**
Shortest Sync Word* is NP-hard for binary weakly acyclic automata.*
Consider now the following more general problem.
[TABLE]
It follows from Proposition 2 that the decision version of this problem (asking whether there exists a word of length at most synchronizing ) is in NP for weakly acyclic automata, so it is reasonable to investigate its approximability.
Theorem 1**.**
The Shortest Set Sync Word problem for -state binary weakly acyclic automata cannot be approximated in polynomial time within a factor of for any unless P = NP.
Proof.
To prove this theorem, we construct a gap-preserving reduction from the Shortest Sync Word problem in -state binary automata, which cannot be approximated in polynomial time within a factor of for any unless P = NP [GS15]. Let a binary automaton be the input of Shortest Sync Word. Let . Construct a binary automaton with the set of states . Define for , , , where is such that . Define for and . Take .
Observe that any word synchronizing in is a synchronizing word for because of the definition of . In the other direction, we note that a shortest synchronizing word for a -state automaton in the construction of Gawrychowski and Straszak [GS15] has length at most . Hence, a shortest synchronizing word for also synchronizes in . Thus, the length of a shortest synchronizing word for is equal to the length of a shortest word synchronizing in , and we get a gap-preserving reduction with gap , as has states. Finally, it is easy to see that is binary weakly acyclic. ∎
4 Finding a Synchronizing Set of Maximum Size
One possible approach to measure and reduce initial state uncertainty in an automaton is to find a subset of states of maximum size where the uncertainty can be resolved, i.e., to find a synchronizing set of maximum size. This is captured by the following problem.
[TABLE]
Türker and Yenigün [TY15] study a variation of this problem, which is to find a set of states of maximum size that can be mapped by some word to a subset of a given set of states in a given monotonic automaton. They reduce the N-Queens Puzzle problem [BS09] to this problem to prove its NP-hardness. However, their proof is unclear, since the input has size , and the output size is polynomial in . Also, the N-Queens Puzzle problem is solvable in polynomial time [BS09].
First we investigate the PSPACE-completeness of the decision version of the Max Sync Set problem, which we shall denote as Max Sync Set-D. Its formulation is the following: given an automaton and a number , decide whether there is a synchronizing set of states of cardinality at least in .
Theorem 2**.**
The Max Sync Set-D problem is PSPACE-complete for binary automata.
Proof.
The Sync Set problem is in PSPACE [San05]. Thus, the Max Sync Set-D problem is also in PSPACE, as we can sequentially check whether each subset of states is synchronizing and compare the size of a maximum synchronizing set to .
To prove that the Max Sync Set-D problem is PSPACE-hard for binary automata, we shall reduce a PSPACE-complete Sync Set problem for binary automata to it [Vor14]. Let an automaton and a subset of its states be an input to Sync Set. Let be the number of states of . Construct a new automaton by initially taking a copy of . For each state , add new states to and define all the transitions from these new states to map to , regardless of the input letter. Define the set to be a union of all new states and take .
Let be a maximum synchronizing set in not containing at least one new state . As is maximum, it does not contain other new states that can be mapped to the same state as . Thus, the size of is at most . Hence, each synchronizing set of size at least in contains . The set is synchronizing in if and only if is synchronizing in , as each word synchronizing in corresponds to a word synchronizing in , where is an arbitrary letter. Thus, has a synchronizing set of size at least if and only if is synchronizing in . ∎
Now we proceed to inapproximability results for the Max Sync Set problem in several classes of automata. We shall need some results from graph theory. An independent set in a graph is a set of its vertices such that no two vertices in share an edge. The size of a maximum independent set in is denoted . The Independent Set problem is defined as follows.
[TABLE]
Zuckerman [Zuc07] has proved that, unless P = NP, there is no polynomial -approximation algorithm for the Independent Set problem for any , where is the number of vertices in .
Theorem 3**.**
The problem Max Sync Set for weakly acyclic -state automata over an alphabet of cardinality cannot be approximated in polynomial time within a factor of for any unless P = NP.
Proof.
We shall prove this theorem by constructing a gap-preserving reduction from the Independent Set problem. Given a graph , , we construct an automaton as follows. For each , we construct two states in . We also add a state to . Thus, . The alphabet consists of letters corresponding to the vertices of .
The transition function is defined in the following way. For each , the state is mapped to by the letter . For each the state is mapped to by the letter , and the state is mapped to by the letter . All yet undefined transitions map a state to itself.
Lemma 1**.**
Let be a maximum independent set in . Then the set is a synchronizing set of maximum cardinality (of size ) in the automaton .
Proof.
Let be a word obtained by concatenating the letters corresponding to in arbitrary order. Then synchronizes the set of states of cardinality . Thus, has a synchronizing set of size at least .
In other direction, let be a word synchronizing a set of states of maximum size in . We can assume that after reading all the states in are mapped to , as all the sets of states that are mapped to any other state have cardinality at most two. Then by construction there are no edges in between any pair of vertices in , so is an independent set of size in . Thus the maximum size of a synchronizing set in is equal to . ∎
Thus we have a gap-preserving reduction from the Independent Set problem to the Max Sync Set problem with a gap for any . It is easy to see that and is weakly acyclic, which concludes the proof of the theorem. ∎
Next we move to a slightly weaker inapproximability result for binary automata.
Theorem 4**.**
The problem Max Sync Set for binary -state automata cannot be approximated in polynomial time within a factor of for any unless P = NP.
Proof.
Again, we construct a gap-preserving reduction from the Independent Set problem extending the proof of Theorem 3. Given a graph , we construct an automaton in the following way. Let . First we construct the main gadget having a synchronizing set of states of size . For each vertex , we construct a set of new states in , where . We call the th layer of . We also add a state to . For each , , the transition function imitates choosing taking the vertices into an independent set one by one and is defined as:
[TABLE]
[TABLE]
Here all , coincide with . For each state , the transitions for both letters [math] and lead to the originating state (i.e. they are self-loops).
We also add an -state cycle attached to . It is a set of states , mapping to and to regardless of the input symbol. Finally, we set to coincide with . Thus we get the automaton . Figure 2 presents an example of for a graph with three vertices and one edge .
The main property of is claimed by the following lemma.
Lemma 2**.**
The size of a maximum synchronizing set of states from the first layer in equals .
Proof.
Let be a maximum independent set in . Consider a word of length such that its th letter is equal to [math] if and to if . By the construction of , this word synchronizes the set . Conversely, a synchronizing set of at least three states from the first layer can be mapped only to some vertex of , and the corresponding set of vertices in is an independent set. ∎
Some layer in the described construction can contain a synchronizing subset of size larger than the maximum synchronizing subset of the first layer. To avoid that, we modify by repeating each state (with all transitions) of the first layer times. More formally, we replace each pair of states , with different pairs of states such that in each pair all the transitions repeat the transitions between , , and all the other states of the automaton. We denote the automaton thus constructed as .
The following lemma claims that the described procedure of constructing from is a gap-preserving reduction from the Independent Set problem in graphs to the Max Sync Set problem in binary automata.
Lemma 3**.**
If , then the maximum size of a synchronizing set in is equal to .
Proof.
Note that due to the construction of , each synchronizing set of is either a subset of a single layer of together with a state in or a subset of a set for some and , together with new states that replaced . Consider the first case. If some maximum synchronizing set contains a state from the th layer of and , then its size is at most . A maximum synchronizing set containing some states from the first layer of consists of states from this layer (according to Lemma 2) and some state of , so this set has size . In the second case, the maximum size of a synchronizing set is at most . ∎
It is easy to see that the constructed reduction is gap-preserving with a gap , where is the number of states in , as . Thus the Max Sync Set for -state binary automata cannot be approximated in polynomial time within a factor of for any unless P = NP, which concludes the proof of the theorem. ∎
Theorem 4 can also be proved by using Theorem 3 and a slight modification of the technique used in [Vor16] for decreasing the size of the alphabet. However, in this case the resulting automaton is far from being weakly acyclic, while the automaton in the proof of Theorem 3 has only one cycle. The next theorem shows how to modify our technique to prove an inapproximability bound for Max Sync Set in binary weakly acyclic automata.
Theorem 5**.**
The Max Sync Set problem for binary weakly acyclic -state automata cannot be approximated in polynomial time within a factor of for any unless P = NP.
Proof.
We modify the construction of the automaton from Theorem 4 in the following way. We repeat each state (with all transitions) of the first layer times in the same way as it is done in the proof of Theorem 4. Thus we get a weakly acyclic automaton with states, where is the number of vertices in the graph . Furthermore, similar to Lemma 3, the size of the maximum synchronizing set of states in is between and , because some of the states from the layers other than the first can be also mapped to . Both of the values are of order , thus we have an gap-preserving reduction providing the inapproximability within a factor of for any , where is the number of states in .∎
We finish by noting that for two classes of automata the Max Sync Set problem is solvable in polynomial time.
Proposition 5**.**
The problem Max Sync Set can be solved in polynomial time for unary automata.
Proof.
Consider the digraph induced by states and transitions of an unary automaton . By definition, each vertex of has outdegree . Thus, the set of the vertices of can be partitioned into directed cycles and a set of vertices not belonging to any cycle, but lying on a directed path leading to some cycle. Let be the number of states in . It is easy to see that after performing transitions, each state of is mapped into a state in some cycle, and all further transitions will not map any two different states to the same state. Thus, it is enough to perform transitions and select such state that the maximum number of states are mapped to .∎
A more interesting case is covered by the following proposition. An automaton is called Eulerian if there exists such that for each state there are exactly pairs , , , such that .
Proposition 6**.**
The problem Max Sync Set can be solved in polynomial time for Eulerian automata.
Proof.
According to Theorem 2.1 in [Fri90] (see also [Kar03] for the discussion of the Eulerian case), each word of minimum rank with respect to an Eulerian automaton synchronizes the sets forming a partition of the states of the automaton into inclusion-maximal synchronizing sets. Moreover, according to this theorem all inclusion-maximal synchronizing sets in an Eulerian automaton are of the same size, thus each inclusion-maximal synchronizing set has maximum cardinality. A word of minimum rank with respect to an automaton can be found in polynomial time [Rys92], which concludes the proof. ∎
5 Computing the Rank of a Subset of States
Assume that we know that the current state of the automaton belongs to a subset of its states. Even if it is not possible to synchronize , it can be reasonable to minimize the size of the set of possible states of , reducing the uncertainty of the current state as much as possible. One way to do it is to map to a set of smaller size by applying some word to . Recall that the size of the smallest such set is called the rank of . Consider the following problem of finding the rank of a subset of states in a given automaton.
[TABLE]
The rank of an automaton, that is, the rank of the set of its states, can be computed in polynomial time [Rys92]. However, since the automaton in the proof of PSPACE-completeness of Sync Set in [Rys83] has rank (and thus each subset of states in this automaton has rank either or ), it follows immediately that there is no polynomial -approximation algorithm for the Set Rank problem for any unless P = PSPACE. It also follows that checking whether the rank of a subset of states equals the rank of the whole automaton is PSPACE-complete. For monotonic weakly acyclic automata, this problem is hard to approximate within a factor of for any [RS17]. For general weakly acyclic automata it is possible to get much stronger bounds, as it is shown by the results of this section.
We shall need the Chromatic Number problem. A proper coloring of a graph is a coloring of the set in such a way that no two adjacent vertices have the same color. The chromatic number of , denoted , is the minimum number of colors in a proper coloring of . Recall that a set of vertices in a graph is called independent if no two vertices in this set are adjacent. A proper coloring of a graph can be also considered as a partition of the set of its vertices into independent sets.
[TABLE]
This problem cannot be approximated within a factor of for any unless P = NP, where is the number of vertices in [Zuc07].
Theorem 6**.**
The Set Rank problem for -state weakly acyclic automata with alphabet of size cannot be approximated within a factor of for any unless P = NP.
Proof.
We shall prove this theorem by constructing a gap-preserving reduction from the Chromatic Number problem, extending the technique in the proof of Theorem 3. Given a graph , , we construct an automaton as follows. The alphabet consists of letters corresponding to the vertices of , together with a switching letter . We use identical synchronizing gadgets , such that each gadget synchronizes a subset of states corresponding to an independent set in . Gadget consists of a set of states.
The transition function is defined as follows. For each gadget , for each , the state is mapped to by the letter . For each the state is mapped to by the letter , and the state is mapped to by the letter . All yet undefined transitions corresponding to the letters map a state to itself.
It remains to define the transitions corresponding to . For each , maps and to , and to itself. Finally, acts on all states in as a self-loop.
Define . We shall prove that the rank of is equal to the chromatic number of . Consider a proper coloring of with the minimum number of colors and let be the partition of into independent sets defined by this coloring. For each , consider a word obtained by concatenating the letters corresponding to the vertices in in some order. Consider now the word . This word maps the set to the set , which proves that the rank of is at most .
In the other direction, note that after each reading of all states except , are mapped to the next synchronizing gadget (except the last gadget which is mapped to itself). By definition of , only a subset of states corresponding to an independent set of vertices can be mapped to some particular , and the image of after reading any word is a subset of the states in some gadget together with some of the states . Hence, the rank of is at least .
Thus we have a gap-preserving reduction from the Chromatic Number problem to the Set Rank problem with gap for any . It is easy to see that , is weakly acyclic and its alphabet has size , which finishes the proof of the theorem. ∎
Using the classical technique of reducing the alphabet size (see [Vor16]), inapproximability can be proved for binary automata. To prove the same bound for binary weakly acyclic automata, we have to refine the technique of the proof of the previous theorem.
Theorem 7**.**
The Set Rank problem for -state binary weakly acyclic automata cannot be approximated within a factor of for any unless P = NP.
Proof.
To prove this theorem we construct a gap-preserving reduction from the Chromatic Number problem, extending the proof of the previous theorem.
Given a graph , we construct an automaton . In our reduction we use two kinds of gadgets: synchronizing gadgets , , and waiting gadgets , . Gadget consists of a set of states, together with a state , and , , consists of the set .
For each , , the transition function is defined as:
[TABLE]
[TABLE]
Here all , coincide with . We set for , , , and for , , . The states are sink states: both letters [math] and act on them as self-loops. Finally, we set . Figure 3 gives an idea of the described construction.
The idea of the presented construction is essentially a combination of the ideas in the proofs of Theorems 4 and 6, so we provide only a sketch of the proof. A synchronizing gadget synchronizes a set of states corresponding to some independent set in . All the states corresponding to the vertices adjacent to vertices corresponding to are mapped to the corresponding waiting gadget , and get to the next synchronizing gadget only after the states of are synchronized (and thus mapped to ). Hence, the minimum size of a partition of into independent sets is equal to the rank of . The number of states in is . Thus, we get inapproximability. ∎
6 Subset Synchronization
In this section, we obtain complexity results for several problems related to subset synchronization in weakly acyclic automata. We adapt Eppstein’s construction from [Epp90], which is a powerful and flexible tool for such proofs. We shall need the following NP-complete SAT problem [Sip12].
[TABLE]
Theorem 8**.**
The Sync Set problem in binary weakly acyclic automata is NP-complete.
Proof.
Because of the polynomial upper bound on the length of a shortest word synchronizing a subset of states proved in Proposition 2, we can use such word as a certificate. Thus, the problem is in NP.
We reduce the SAT problem. Given and , we construct an automaton . For each clause , we construct states , in . We introduce also a state . The transitions from correspond to the occurrence of in in the following way: for , , if the assignment , , satisfies , and otherwise. The transition function also maps to itself for all and both letters [math] and .
Let . The word synchronizes if is the value of in an assignment satisfying , and vice versa. Thus, the set is synchronizing if and only if all clauses in can be satisfied by some assignment of binary values to the variables in . ∎
By identifying the states for and adding to it is also possible to prove that the problem of checking whether the rank of a subset of states equals the rank of an automaton is coNP-complete for binary weakly acyclic automata (cf. the remarks in the beginning of Section 5).
The proof of Theorem 8 can be used to prove the hardness of a special case of the following problem, which is PSPACE-complete in general [Koz77] and NP-complete for weakly acyclic monotonic automata over a three-letter alphabet [RS17].
[TABLE]
Proposition 7**.**
Finite Automata Intersection* is NP-complete when all automata in the input are binary weakly acyclic.*
Proof.
Observe first that if there exists a word which is accepted by all automata, then a shortest such word has length at most linear in the total number of states in all automata. Indeed, for each automaton consider a topological sort of the set of its states. Each letter of maps at least one state in some automaton to some other state, which has larger index in the topological sort of the set of states of this automaton. Thus, the considered problem is in NP.
For the hardness proof, we use the same construction as in Theorem 8. Provided and , define in the same way as in Theorem 8. Define as follows. Take and to be the restriction of to the set . Set to be the input state and to be the only accepting state of . Then there exists a word accepted by automata if and only if all clauses in are satisfiable by some assignment. ∎
To obtain the next results, we shall need a modified construction of the automaton from the proof of Theorem 8, as well as some new definitions. A partial automaton is a triple , where and are the same as in the definition of a finite deterministic automaton, and is a partial transition function (i.e., a transition function which may be undefined for some argument values). Given an instance of the SAT problem, construct a partial automaton as follows. We introduce a state . For each clause , we construct states , in . For each , construct also states for , where is the smallest index of a variable occurring in . The transitions from correspond to the occurrence of in in the following way: for , if the assignment , , satisfies , and otherwise. For , we set for , , . The transition function also maps , , and to for both letters [math] and .
A word is said to carefully synchronize a partial automaton if it maps all its states to the same state , and each mapping corresponding to a prefix of is defined for each state. The automaton is then called carefully synchronizing. We use to prove the hardness of the following problem.
[TABLE]
For binary automata, Careful Synchronization is PSPACE-complete [Mar10]. For monotonic automata over a four-letter alphabet it is NP-hard. We call a partial automaton aperiodic if for any word and any state there exists such that either is undefined, or .
Theorem 9**.**
Careful Synchronization* is NP-hard for aperiodic partial automata over a three-letter alphabet.*
Proof.
We reduce the SAT problem. Given and , we first construct . Then we add an additional letter to the alphabet of and introduce new states . For , , we define , , , . All other transitions are left undefined. Let us call the constructed automaton .
The automaton is carefully synchronizing if and only if all clauses in can be satisfied by some assignment of binary values to the variables in . Moreover, the word , is carefully synchronizing if is the value of in such an assignment.
Indeed, note that the first letter of is necessarily , as it is the only letter defined for all the states. Moreover, each word starting with maps to a subset of . The only way for a word to map all states to is to map them first to the set , because there are no transitions defined from any , except the transitions defined by . But this exactly means that there exists an assignment satisfying .
The constructed automaton is aperiodic, because each cycle which is not a self-loop contains exactly one letter . ∎
The complexity of the following problem can be obtained from Theorem 9.
[TABLE]
Corollary 1**.**
Positive Matrix* is NP-hard for two upper-triangular and two lower-triangular matrices.*
Proof.
The proof uses the idea from [GGJ16]. Consider three transition matrices corresponding to the letters of the automaton constructed in the proof of Theorem 9. Add the matrix corresponding to the letter mapping the state to all states and undefined for all other states. Any sequence of matrices resulting in a matrix with only positive elements must contain the new matrix, and before that there must be a sequence of matrices corresponding to a word carefully synhronizing the automaton from the proof of Theorem 9. Thus we get a reduction from Careful Synchronization for aperiodic partial automata over a three-letter alphabet to Positive Matrix. It is easy to see that the reduction uses two upper-triangular and two lower-triangular matrices. ∎
Finally, we show the hardness of the following problem (PSPACE-complete in general [BV16]).
[TABLE]
Theorem 10**.**
Subset Reachability* is NP-complete for weakly acyclic automata.*
Proof.
Consider a topological sort of . Let be a shortest word mapping to some reachable set of states. Then each letter of maps at least one state to a state with a larger index in the topological sort. Thus has length , since the maximum total number of such mappings is . Thus, the considered problem is in NP.
For the NP-hardness proof, we again reduce the SAT problem. Given an instance of SAT, construct first. Next, add a transition for , , resulting in a deterministic automaton .
Similar to the proof of Theorem 9, is satisfiable if and only if the set is reachable in . ∎
7 Conclusions and Open Problems
As shown in this paper, weakly acyclic automata serve as an example of a small class of automata where most of the synchronization problems are still hard. More precisely, switching from general automata to weakly acyclic usually results in changing a PSPACE-complete problem to a NP-complete one.
Some problems for weakly acyclic automata are still open. One of them is to study the approximability of the Shortest Sync Word problem: there is a drastic gap between known inapproximability results and the -approximation algorithm for general automata. Another natural problem is to study the Max Sync Set and Set Rank problems complexity in strongly connected automata. The technique used by Vorel for proving PSPACE-completeness of the Sync Set problem in strongly connected automata seems to fail here.
Acknowledgments
We would like to thank Peter J. Cameron for introducing us to the notion of synchronizing automata, and Vojtěch Vorel, Yury Kartynnik, Vladimir Gusev and Ilia Fridman for very useful discussions. We also thank Mikhail V. Volkov and anonymous reviewers for their great contribution to the improvement of the paper.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[AV 04] D.S. Ananichev and M.V. Volkov. Synchronizing monotonic automata. Theor. Comput. Sci. , 327(3):225–239, 2004.
- 2[Ber 14] Mikhail V. Berlinkov. On two algorithmic problems about synchronizing automata. In Arseny M. Shur and Mikhail V. Volkov, editors, DLT 2014. LNCS, vol. 8633 , pages 61–67. Springer, Cham, 2014.
- 3[BF 80] J.A. Brzozowski and Faith E. Fich. Languages of R-trivial monoids. J. Comput. Syst. Sci , 20(1):32–49, 1980.
- 4[BS 09] Jordan Bell and Brett Stevens. A survey of known results and research areas for N-queens. Discrete Mathematics , 309(1):1 – 31, 2009.
- 5[BV 16] Eugenija A. Bondar and Mikhail V. Volkov. Completely reachable automata. In Cezar Câmpeanu, Florin Manea, and Jeffrey Shallit, editors, DCFS 2016. LNCS, vol. 9777 , pages 1–17. Springer, Cham, 2016.
- 6[Car 14] Angela Cardoso. The Černý Conjecture and Other Synchronization Problems . Ph D thesis, University of Porto, Portugal, 2014.
- 7[CLRS 09] Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms . MIT Press, 3rd edition, 2009.
- 8[Epp 90] David Eppstein. Reset sequences for monotonic automata. SIAM J. Comput , 19(3):500–510, 1990.
