Skip to content

Commit

Permalink
Add regular path query algorithm
Browse files Browse the repository at this point in the history
This commit adds an implementation of the regular path query algorithm
based on linear-algebra graph processing approach. The algorithm finds a
set of nodes in a edge-labelled directed graph. These nodes are
reachable by paths starting from one of source nodes and having edges
labels conform a word from the specified regular language.

This algorithm is based on the bread-first-search algorithm over the
adjacency matrices. Regular languages are defined by non-deterministic
finite automaton. The algorithm considers the paths on which
"label words" are accepted by the specified NFA.

The algorithm is used with the following inputs:
* A regular automaton adjacency matrix decomposition.
* A graph adjacency matrix decomposition.
* An array of the starting node indices.

It results with a vector, having v[i] = 1 iff the node is reachable by a
path satisfying the provided regular constraints.

Full description of the algorithm is available at:
  https://arxiv.org/abs/2412.10287
  • Loading branch information
georgiy-belyanin committed Dec 16, 2024
1 parent afeb9df commit 040c020
Show file tree
Hide file tree
Showing 19 changed files with 643 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/rpq_data/1_a.mtx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
%%MatrixMarket matrix coordinate pattern general
%%GraphBLAS type bool
2 2 2
1 2
2 2
2 changes: 2 additions & 0 deletions data/rpq_data/1_meta.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 1
1 2
1 change: 1 addition & 0 deletions data/rpq_data/1_sources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
4 changes: 4 additions & 0 deletions data/rpq_data/2_a.mtx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
%%MatrixMarket matrix coordinate pattern general
%%GraphBLAS type bool
2 2 1
2 1
4 changes: 4 additions & 0 deletions data/rpq_data/2_b.mtx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
%%MatrixMarket matrix coordinate pattern general
%%GraphBLAS type bool
2 2 1
1 2
2 changes: 2 additions & 0 deletions data/rpq_data/2_meta.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 1
1 1
1 change: 1 addition & 0 deletions data/rpq_data/2_sources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2
4 changes: 4 additions & 0 deletions data/rpq_data/3_a.mtx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
%%MatrixMarket matrix coordinate pattern general
%%GraphBLAS type bool
2 2 1
1 1
4 changes: 4 additions & 0 deletions data/rpq_data/3_b.mtx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
%%MatrixMarket matrix coordinate pattern general
%%GraphBLAS type bool
2 2 1
1 1
2 changes: 2 additions & 0 deletions data/rpq_data/3_meta.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1 1
1 1
1 change: 1 addition & 0 deletions data/rpq_data/3_sources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3 6
8 changes: 8 additions & 0 deletions data/rpq_data/4_b.mtx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%%MatrixMarket matrix coordinate pattern general
%%GraphBLAS type bool
6 6 5
1 2
2 3
3 4
4 5
5 6
2 changes: 2 additions & 0 deletions data/rpq_data/4_meta.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
2 1 3
1 6
1 change: 1 addition & 0 deletions data/rpq_data/4_sources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2 4
9 changes: 9 additions & 0 deletions data/rpq_data/a.mtx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
%%MatrixMarket matrix coordinate pattern general$
%%GraphBLAS type bool$
8 8 6
1 2
1 7
2 4
3 6
5 8
7 6
10 changes: 10 additions & 0 deletions data/rpq_data/b.mtx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%%MatrixMarket matrix coordinate pattern general$
%%GraphBLAS type bool$
8 8 7
1 3
2 5
2 7
4 4
4 6
5 1
6 3
Loading

0 comments on commit 040c020

Please sign in to comment.