-1

Show that the problem of the existence of a cycle in a directed graph is a $NL-complete$ problem.

I have already successfully demonstrated that this problem $\in NL$. But I'm stuck on how to take it apart that it's $NL-hard$.

To show that the problem is $NL-hard$, we can start from problem $s; t-connectivity$ ($s$ = source and $t$ = target ) and as an intermediate step, create a acyclic graph $G^a$ which is $s’; t’- connected$ if and only if the original graph $G$ is $s; t- connected$. Using the length of the paths of a vertex $x$ at a vertex $y$.

Thank you for your help​

  • Previous version: https://cs.stackexchange.com/questions/123720/nondeterministic-logarithmic-space-in-directed-graph – Yuval Filmus Apr 07 '20 at 18:24

1 Answers1

1

Briefly, you create $n$ copies $(v,1),\ldots,(v,n)$ of each vertex $v$, adding an edge $(a,i)\to(b,i+1)$ for every original edge $a\to b$. So far the graph is a DAG. Now you add edges $(t,i)\to(s,0)$ for all $i$. I'll let you figure out why that works.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503