Abstract
Pattern matching in directed graphs is a natural extension of pattern matching in trees and has many applications to different areas. In this paper, we study several pattern matching problems in ordered labeled directed graphs. For the rooted directed graph pattern matching problem, we present an efficient algorithm which runs in time and space O(¦E(P)¦×¦V(T)¦+¦E(T)¦), where ¦E(P)¦, ¦V(T)¦ and ¦E(T)¦ are the number of edges in the pattern graph P, the number of nodes in the target graph T and the number of edges in the pattern graph T, respectively. It is by far the fastest algorithm for this problem. This algorithm can also solve the directed graph pattern matching problem without increasing time or space complexity. Our solution to this problem outperforms the best existing method by Katzenelson, Pinter and Schenfeld by a factor of at least ¦V(P)¦. We also present an algorithm for the directed graph topological embedding problem which runs in time O(¦V(P)¦×¦E(T)¦+¦E(P)¦) and space O(¦V(P)¦×¦V(T)¦+¦E(P)¦+¦E(T)¦), where ¦V(P)¦ is the number of nodes in the pattern graph P. To our knowledge, this algorithm is the first one for this problem.
Preview
Unable to display preview. Download preview PDF.
References
A.V. Aho, R. Sethi, and J. D. Ullman. Compilers — Principles, Techniques, and Tools, chapter 6.7. Addison Wesley, 1986.
Alexander Aiken and Brian R. Murphy. Implementing regular tree expressions. In Proceedings of 5th ACM Conference on Functional Programming Languages and Computer Architecture, pages 427–447, 1991.
Alexander Aiken and Brian R. Murphy. Static type inference in a dynamically typed language. In Proceedings of Eighteenth Annual ACM Symposium on Principles of Programming Languages, pages 279–290, 1991.
S. A. Cook. The complexity of theorem-proving procedures. In Proceedings of the 3rd Annual Symposium on the Theory of Computing, pages 151–158, 1971.
Andrea Corradini. Term rewriting in 77-01. In Proceedings of International Joint Conference on Theory and Practice of Software Development, pages 468–484, 1993.
Nachum Dershowitz and Stéphane Kaplan. Rewrite, rewrite, rewrite, rewrite, rewrite ... In Proceedings of Sixteenth Annual Symposium on Principles of Programming Languages, pages 250–259, 1989.
J. R. W. Glauert, J. R. Kennaway, and M. R. Sleep. Dactl: An experimental graph rewriting language. In Proceedings of Fourth International Workshop on Graph Grammars and Their Application to Computer Science, pages 378–395, 1990.
N. Heintze and J. Jaffar. A finite presentation theorem for approximating logic programs. In Proceedings of Seventeenth Annual ACM Symposium on Principles of Programming Languages, pages 197–209, 1990.
Christoph M. Hoffmann and Michael J. O'Donnell. Pattern matching in trees. Journal of ACM, 29(1):68–95, 1982.
Kristoffer H. Holm. Graph matching in operational semantics and typing. In Proceedings of Colloquium on Trees in Algebra and Programming, pages 191–205, 1990.
Jacob Katzenelson, Shlomit S. Pinter, and Eugen Schenfeld. Type matching, type-graphs, and the Schanuel conjecture. ACM Transactions on Programming Languages and Systems, 14(4):574–588, Oct. 1992.
Jan Willem Klop. Term rewriting systems. Technical Report CS-R9073, Free University, Department of Mathematics and Computer Science, 1990.
R. Tarjan. Depth first search and linear graph algorithms. SIAM Journal on Computing, 1(2):146–160, 1972.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1995 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Fu, J. (1995). Pattern matching in directed graphs. In: Galil, Z., Ukkonen, E. (eds) Combinatorial Pattern Matching. CPM 1995. Lecture Notes in Computer Science, vol 937. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-60044-2_35
Download citation
DOI: https://doi.org/10.1007/3-540-60044-2_35
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-60044-2
Online ISBN: 978-3-540-49412-6
eBook Packages: Springer Book Archive