Promise Problems And TWOPATHS
A promise problem with an interesting upper bound
Shimon Even was one of the greats of theory, especially algorithms on graphs—his book Graph Algorithms is a classic. Unfortunately, he passed away in 2004 and will always be missed. His legacy includes many great results, many strong Ph.D. students, and among many other ideas the notion of a promise problem. He invented the latter in 1984 in joint work with Alan Selman and Yacov Yacobi. See the beautiful survey by Oded Goldreich on Even and the importance of promise problems.
Today I want to raise an interesting “promise problem” that is related to some earlier discussions we have had.
I knew Shimon, but never had the pleasure to write a paper with him. He had a wonderful way about him, he was full of energy, and was a joy to talk to on any topic.
I have a story about Even and me that happened when I was at Berkeley and he was visiting there—this was in 1979.
One fall day Shimon came into my office with a big smile on his face. I asked him to sit down, and he proceeded to explain what he found so amusing. The previous spring I had taught the undergraduate automata theory—at the level of Mike Sipser’s book—except that Mike was taking my class at the time. Not only did Mike take the class but a number of other graduate students did too. One I will call student X. He did okay in my class, and Shimon reminded me that I gave him a B. At Berkeley B was “passing” for a graduate student so I thought nothing much about giving him this grade.
Shimon smiled and told me:
You were the first teacher ever to give him a B. Ever. He had gotten A’s for every class he took since first grade.
I started to say something—but Shimon broke in and said that I had done a great thing. The student was so upset about the B that he was working extremely hard to get his research going. He even had considered leaving Berkeley to go to another department, but decided to stay. In a sense X wanted to prove me wrong.
Shimon thanked me. He said X was probably going to do terrific work and my giving him that single B may have been the spark he needed. I do not recall saying anything back to Shimon, but today X is a superstar. I would like to think that I helped in some small way. Perhaps I should give out more B’s.
Let’s turn to discuss a simple promise problem that I have been looking at recently.
The Promise Problem
I will call the problem . A function is given that is computable in polynomial time on bit strings of length . The function is 1-1 but can be “undefined” on some strings, and we also stipulate for all . Let’s use to denote that . In a natural way the function defines a directed graph with as the edge relationship. Every node has out-degree at most because is a function, and in-degree at most because is injective. It also has no self-loops because . Hence the graph is a disjoint union of paths and cycles.
We further stipulate that there are two special start nodes and two special end nodes , which are given as part of the input. The promise is the resulting graph has exactly two paths, each starting from an and ending in an .Thus, either
The task is to determine the end point of the paths: does the path from end in or ?
Notice that the property of being sinks is not part of the “promise.” It does not have to be because it is already decidable in polynomial time: being able to tell that undefined and undefined is considered part of being computable in polynomial time. The property of being sources is not necessarily as easy, because need not be invertible in polynomial time. However, the property of not being a source node belongs to the complexity class , because then there is a unique such that . The class is a subclass of the class into which we will classify this task, so it is unimportant whether being sources is part of the givens or part of the promise.
The property that the graph consists of exactly two paths, however, is the key. If the graph was allowed to consist of many paths, then the problem is easily shown to be polynomial space complete. This makes it all the more surprising that under the promise of being in the two-path case, the complexity of the task drops down to a class that is commonly believed to be lower than polynomial space.
The Complexity of
I do not know the exact complexity of the problem. The following theorem is the best upper bound that I know:
Theorem: The problem is in .
I find this theorem to be unexpected. The obvious algorithm is to iterate the function on until an end is reached. Since the paths can be exponentially long, this does not run in polynomial time. Yet the problem can be reduced to the counting class . Recall this counts the number of accepting computations modulo .
The proof is based on ideas that I have already discussed, so I will just give a high-level sketch of the proof.
Suppose we are given the graph defined by the function : we know that consists of two paths. The start vertices are and the end vertices are . The key idea is to add the edges and to form the graph . Then there are two cases: If the path staring with ends in we get two cycles; if it ends in we get one cycle. Thus, to solve the problem we need to decide whether consists of one cycle or two.
This we can do by a trick I discussed before. We can view as defining a permutation on the vertices. The number of inversions of a permutation can be used to tell how many cycles the permutation has modulo . But, the number of inversions modulo is easily reduced to a problem that can be computed by .
The number of inversions is defined as follows as follows: for each pair of vertices and they form an inversion provided
Finally, why is this only a promise-problem solution? The predicate for counting inversions yields an implicit odd/even number of witnesses for all kinds of graphs. For graphs that did not arise from the promise, the implication for permutations is null and void. Thus the language arising from this predicate belongs to , but is not restricted to graphs in the promise set . An ordinary language reduces to the promise problem if it reduces to , provided the range of the reduction is entirely within . Thus we can say that promise problems are hard for, and even complete for, ordinary complexity classes.
What is the complexity of ? Can we prove it is complete for some known class? Can the bound of the theorem be improved? It seems hard to believe that the problem is in, for example, NP. How would guessing help “follow” a path that can be exponentially long?
[fixed typo: bad link]