The topological sorting problem (TOP for short) is a problem computing a topological order of a given acyclic digraph G, where a topological order of G is a sequence of all nodes in G such that for every nodes u and u, if (u, U) is an edge in G, then u precedes u in this sequence. This problem has been investigated in some earlier works. For example, Dekel, Nassimi and Sahni [3] have shown that a function solving TOP is in NC’, Ruzzo (see [l]) has shown that a function solving TOP is in NL*, and further, Shodai [8] has found a function in FLNL that solves TOP, where NL* (FLNL) is the class of functions computable in NC’ (respectively deterministic log space) that can consult a set in NL as an oracle. However, the precise complexity of this problem was previously unknown. In particular, it is an open question in Cook [l] whether the problem is as hard as any NL-complete set. When discussing the problem as a decision problem, one can define it as a set LTOP of all three-tuples (G, U, a) satisfying the condition that G is an acyclic digraph and there exists a topological order of G in which u precedes u. On the other hand, since the problem deciding whether a given digraph is acyclic or not is well known to be NL-hard, we know that L,,, is also NL-hard. However, this argument tells us nothing about the essential complexity of the topological sorting problem. Thus, this setting leads us to a wrong goal, and hence, we need to avoid this boring argument in order to know the essential complexity of the topological sorting problem. In the next section, we prepare a framework for discussing the essential complexity of TOP. We pose a question in this framework, and observe that the question precisely corresponds to Cook’s original question. We settle our question affirmatively. Hence, we will observe that TOP is essentially as hard as any NL-complete set. We next consider a subproblem of TOP, which will be called DTOP. Our purpose is to find a natural subproblem of TOP that has the same complexity as any DL-complete set. The subproblem we consider is informally stated as follows: Given a digraph G = (V, E) whose underlying graph has no cycle, compute a topological order of G. The underlying graph of G is an undirected graph with the same node set such that, for every pair of nodes U, u, {u, u} is an edge of the underlying graph if and only if either (u, u) or (u, U) is an edge of G. We show that this problem can be solved within deterministic log space. Then we pose a question similar to the above one. The question is whether this problem is as hard as any DL-complete set. But we meet here the same difficulty as in the case of TOP. It was shown by Cook and McKenzie [2] that deciding whether a given undirected graph has a cycle is DL-complete under < EC’ -
[1]
Neil Immerman.
Nondeterministic Space is Closed Under Complementation
,
1988,
SIAM J. Comput..
[2]
Hong Jia-wei.
On some deterministic space complexity problems
,
1980,
STOC '80.
[3]
Neil D. Jones,et al.
Space-Bounded Reducibility among Combinatorial Problems
,
1975,
J. Comput. Syst. Sci..
[4]
Sartaj Sahni,et al.
Parallel Matrix and Graph Algorithms
,
1981,
SIAM J. Comput..
[5]
Takayoshi Shoudai.
The Lexicographically First Topological Order Problem is NLOG-Complete
,
1989,
Inf. Process. Lett..
[6]
Stephen A. Cook,et al.
A Taxonomy of Problems with Fast Parallel Algorithms
,
1985,
Inf. Control..
[7]
Stephen A. Cook,et al.
Problems Complete for Deterministic Logarithmic Space
,
1987,
J. Algorithms.