# Space Complexity of Reachability Testing in Labelled Graphs

• Vidhya Ramaswamy
• Jayalal Sarma
• K. S. Sunil
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10168)

## Abstract

Fix an algebraic structure $$(\mathcal {A}, *)$$. Given a graph $$G =(V, E)$$ and the labelling function $$\phi$$ ($$\phi : E \rightarrow \mathcal {A}$$) for the edges, two nodes s, $$t \in V$$, and a subset $$F \subseteq \mathcal {A}$$, the $$\mathcal {A}$$-Reach problem asks if there is a path p (need not be simple) from s to t whose yield (result of the operation in the ordered set of the labels of the edges constituting the path) is in F. On the complexity frontier of this problem, we show the following results.

• When $$\mathcal {A}$$ is a group whose size is polynomially bounded in the size of the graph (hence equivalently presented as a multiplication table at the input), and the graph is undirected, the $$\mathcal {A}$$-Reach problem is in $$\mathsf {L}$$. Building on this, using a decomposition in [4], we show that, when $$\mathcal {A}$$ is a fixed quasi-group, and the graph is undirected, the $$\mathcal {A}$$-Reach problem is in $$\mathsf {L}$$. In contrast, we show $$\mathsf {NL}$$-hardness of the problem over bidirected graphs, when $$\mathcal {A}$$ is a matrix group over $$\mathbb {Q}$$. When $$\mathcal {A}$$ is a fixed aperiodic monoid, we show that the problem is $$\mathsf {NL}$$-complete.

• As our main theorem, we prove a dichotomy for graphs labelled with fixed aperiodic monoids by showing that for every fixed aperiodic monoid $$\mathcal {A}$$, $$\mathcal {A}$$-Reach problem is either in $$\mathsf {L}$$ or is $$\mathsf {NL}$$-complete.

• We show that there exists a monoid M, such that the reachability problem in general DAGs can be reduced to $$\mathcal {A}$$-Reach problem for planar non-bipartite DAGs labelled with M. In contrast, we show that if the planar DAGs that we obtain above are bipartite, the problem can be further reduced to reachability testing in planar DAGs and hence is in $$\mathsf {UL}$$.

## References

1. 1.
Allender, E.: Reachability problems: an update. In: Cooper, S.B., Löwe, B., Sorbi, A. (eds.) CiE 2007. LNCS, vol. 4497, pp. 25–27. Springer, Heidelberg (2007). doi:
2. 2.
Arora, S., Barak, B.: Computational Complexity: A Modern Approach. Cambridge University Press, Cambridge (2009)
3. 3.
David, A., Barrington, M., Thérien, D.: Finite monoids and the fine structure of NC$${}^{\text{1 }}$$. J. ACM 35(4), 941–952 (1988)
4. 4.
Beaudry, M., Lemieux, F., Thérien, D.: Finite loops recognize exactly the regular open languages. In: Degano, P., Gorrieri, R., Marchetti-Spaccamela, A. (eds.) ICALP 1997. LNCS, vol. 1256, pp. 110–120. Springer, Heidelberg (1997). doi:
5. 5.
Beaudry, M., McKenzie, P., Pladeau, P., Thérien, D.: Finite monoids: from word to circuit evaluation. SIAM J. Comput. 26(1), 138–152 (1997)
6. 6.
Bédard, F., Lemieux, F., McKenzie, P.: Extensions to Barrington’s M-program model. In: Proceedings Fifth Annual Structure in Complexity Theory Conference, pp. 200–209 (1990)Google Scholar
7. 7.
Bourke, C., Tewari, R., Vinodchandran, N.V.: Directed planar reachability is in unambiguous log-space. ACM Trans. Comput. Theory 1(1), 4 (2009)Google Scholar
8. 8.
Caussinus, H., Lemieux, F.: The complexity of computing over quasigroups. In: Thiagarajan, P.S. (ed.) FSTTCS 1994. LNCS, vol. 880, pp. 36–47. Springer, Heidelberg (1994). doi:
9. 9.
Chandra, A.K., Fortune, S., Lipton, R.J.: Unbounded fan-in circuits and associative functions. J. Comput. Syst. Sci. 30(2), 222–234 (1985)
10. 10.
Das, B., Datta, S., Nimbhorkar, P.: Log-space algorithms for paths and matchings in k-trees. In: 27th STACS, pp. 215–226 (2010)Google Scholar
11. 11.
Geelen, J., Gerards, B.: Excluding a group-labelled graph. J. Comb. Theory Ser. B 99(1), 247–253 (2009)
12. 12.
Horwitz, S., Reps, T.W., Binkley, D.: Interprocedural slicing using dependence graphs. ACM Trans. Program. Lang. Syst. 12(1), 26–60 (1990)
13. 13.
Huynh, T.C.T.: The linkage problem for group-labelled graphs. Ph.D. thesis, University of Waterloo (2009)Google Scholar
14. 14.
Kawase, Y., Kobayashi, Y., Yamaguchi, Y.: Finding a path in group-labeled graphs with two labels forbidden. In: Halldórsson, M.M., Iwama, K., Kobayashi, N., Speckmann, B. (eds.) ICALP 2015. LNCS, vol. 9134, pp. 797–809. Springer, Heidelberg (2015). doi: Google Scholar
15. 15.
Komarath, B., Sarma, J., Sunil, K.S.: On the complexity of L-reachability. Fundam. Inform. 145(4), 471–483 (2016)
16. 16.
Pin, J.-E., Straubing, H., Therien, D.: Locally trivial categories and unambiguous concatenation. J. Pure Appl. Algebra 52(3), 297–311 (1988)
17. 17.
Raymond, J.-F.Ç., Tesson, P., Thérien, D.: An algebraic approach to communication complexity. In: Larsen, K.G., Skyum, S., Winskel, G. (eds.) ICALP 1998. LNCS, vol. 1443, pp. 29–40. Springer, Heidelberg (1998). doi:
18. 18.
Reingold, O.: Undirected connectivity in log-space. J. ACM 55(4), 17 (2008)Google Scholar
19. 19.
Reingold, O., Trevisan, L., Vadhan, S.: Pseudorandom walks on regular digraphs and the RL vs. L problem. In: Proceedings of STOC, pp. 457–466 (2006)Google Scholar
20. 20.
Reps, T.W.: On the sequential nature of interprocedural program-analysis problems. Acta Inform. 33(8), 739–757 (1996)
21. 21.
Reps, T.W.: Program analysis via graph reachability. Inf. Softw. Technol. 40(11–12), 701–726 (1998)
22. 22.
Tesson, P.: An algebraic approach to communication complexity. Masters thesis, McGill University, Montreal (1998)Google Scholar
23. 23.
Yannakakis, M.: Graph-theoretic methods in database theory. In: Proceedings of the 9th ACM PODS, pp. 230–242 (1990)Google Scholar