Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regular path query algorithm #2

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Add regular path query algorithm #2

merged 1 commit into from
Dec 16, 2024

Conversation

georgiy-belyanin
Copy link

@georgiy-belyanin georgiy-belyanin commented Nov 10, 2024

This patch 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.

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

@georgiy-belyanin
Copy link
Author

Points for discussion:

  • I suppose the paper should be published somewhere, like on Arxiv, to add it to the algorithm description
  • Probably, I'll add more tests/change the format of the matrices in it.

Thus, the PR is draft yet.

experimental/algorithm/LAGraph_RegularReachability.c Outdated Show resolved Hide resolved
experimental/algorithm/LAGraph_RegularReachability.c Outdated Show resolved Hide resolved
experimental/algorithm/LAGraph_RegularReachability.c Outdated Show resolved Hide resolved
experimental/algorithm/LAGraph_RegularReachability.c Outdated Show resolved Hide resolved
experimental/algorithm/LAGraph_RegularReachability.c Outdated Show resolved Hide resolved
experimental/algorithm/LAGraph_RegularReachability.c Outdated Show resolved Hide resolved
experimental/test/test_RegularReachability.c Outdated Show resolved Hide resolved
experimental/test/test_RegularReachability.c Outdated Show resolved Hide resolved
include/LAGraphX.h Outdated Show resolved Hide resolved
include/LAGraphX.h Outdated Show resolved Hide resolved
@georgiy-belyanin
Copy link
Author

georgiy-belyanin commented Nov 30, 2024

Currently, I am working on a benching utility for the algorithm. It's WIP.

I guess we can add it to the organization when it's ready.

See: https://github.com/georgiy-belyanin/RPQ-bench/pulls.

@georgiy-belyanin georgiy-belyanin force-pushed the rpq branch 3 times, most recently from 1cb4810 to 32f8a6f Compare November 30, 2024 19:41
@georgiy-belyanin georgiy-belyanin changed the title Add regular reachability algorithm Add regular path query algorithm Nov 30, 2024
@georgiy-belyanin georgiy-belyanin marked this pull request as ready for review November 30, 2024 19:44
@georgiy-belyanin
Copy link
Author

georgiy-belyanin commented Nov 30, 2024

@gsvgit Thank you for reviewing! I appreciate the details you've mentioned.

@vkutuev please, take a look on the details of the implementation when you can.

@georgiy-belyanin
Copy link
Author

The patch is almost OK except it lacks of Arxiv paper.

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
@georgiy-belyanin
Copy link
Author

Merged to stable and opened GraphBLAS#261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants