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

Test if bounded path lengths get correct results #67

Open
Dtenwolde opened this issue Jan 12, 2024 · 3 comments
Open

Test if bounded path lengths get correct results #67

Dtenwolde opened this issue Jan 12, 2024 · 3 comments
Assignees
Labels
bug Something isn't working path-finding Issues related to path-finding, such as the path mode or path prefix.

Comments

@Dtenwolde
Copy link
Contributor

The way bounded paths are currently checked is with a post-op filter:
iterativelength(0, (select count(*) from Person), a.rowid, b.rowid) between 2 and 3
In this case, if the shortest path length is found to be between 2 and 3 hops, it evaluates to true. However, there might be cases in the graph where the shortest path is 1 (a), and a path with length 2 or 3 (b) does exist. In this case, that result (b) should then be returned to the user. However, since the shortest path was found to be 1, and is below the lower bound, it is left out.

The goal of this issue is to verify that this is indeed the case. This can be done by creating a toy graph example with this case present.
If it does exist, we should probably push the bound filter to the UDF, to ensure the paths with proper length are correctly evaluated.

@Dtenwolde Dtenwolde added bug Something isn't working path-finding Issues related to path-finding, such as the path mode or path prefix. labels Jan 12, 2024
@SiberiaWolfP SiberiaWolfP self-assigned this Feb 5, 2024
@SiberiaWolfP
Copy link
Collaborator

The issue does exist.

Reproduce test case:

CREATE TABLE Point(id BIGINT); INSERT INTO Point VALUES (0), (1), (2), (3);
CREATE TABLE know(src BIGINT, dst BIGINT); INSERT INTO know VALUES (0, 1), (0, 2), (2, 3), (3, 1);
-CREATE PROPERTY GRAPH pg
VERTEX TABLES (
    Point PROPERTIES ( id ) LABEL Pnt
    )
EDGE TABLES (
    know    SOURCE KEY ( src ) REFERENCES Point ( id )
            DESTINATION KEY ( dst ) REFERENCES Point ( id )
            LABEL Knows
    );
-FROM GRAPH_TABLE (pg
    MATCH
    p = ANY SHORTEST (a:Pnt WHERE a.id = 0)-[k:knows]->{2,3}(b:Pnt WHERE b.id = 1)
    COLUMNS (element_id(p))
    ) x;

Expected output:
[0, 0, 1]
Troubled output:
0 rows

Copy link

github-actions bot commented Sep 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Sep 4, 2024
@Dtenwolde Dtenwolde removed the stale label Sep 4, 2024
Copy link

github-actions bot commented Dec 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 4, 2024
@Dtenwolde Dtenwolde removed the stale label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working path-finding Issues related to path-finding, such as the path mode or path prefix.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants