Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pattern matching in graphs

I'm trying to find tool/algorithm for searching sections that corresponds to specified pattern in oriented graph, e.g.:

A->B->C or or A<->B->C

Please, suggest me direction of my searches.

I mean pattern matching. I need to find all group of nodes and edges, that matching specified pattern

like image 927
Jamal Avatar asked May 01 '11 12:05

Jamal


People also ask

What is graph pattern matching?

In the context of searching a single graph G, graph pattern matching is to find all the occurrences of a query graph Q in a given data graph G, specified by a matching function.

How do you find matching on a graph?

Given an undirected graph, a matching is a set of edges, such that no two edges share the same vertex. In other words, matching of a graph is a subgraph where each node of the subgraph has either zero or one edge incident to it. A vertex is said to be matched if an edge is incident to it, free otherwise.

What is pattern matching technique?

In computer science, pattern matching is the act of checking a given sequence of tokens for the presence of the constituents of some pattern.

What is pattern matching give an example?

For example, x* matches any number of x characters, [0-9]* matches any number of digits, and . * matches any number of anything. A regular expression pattern match succeeds if the pattern matches anywhere in the value being tested.


2 Answers

Isn't this the Subgraph isomorphism problem? If yes, the Wikipedia page contains a section on algorithms.

like image 176
MarcoS Avatar answered Nov 15 '22 16:11

MarcoS


Graph pattern matching is the functionality at the core of graph rewrite tools, they offer it pre-implemented.

In e.g. GrGen you write down your example pattern as a:A --> b:B --> c:C, the tool then generates a pattern matcher for it, one that is adapted to the characteristics of the host graph (optimized by taking statistics about the graph into account).

like image 25
Visitor Avatar answered Nov 15 '22 17:11

Visitor