Open vikramsubramanian opened 9 months ago
To retrieve all possible paths between two nodes nA
and nC
in Kùzu, you can use a Cypher-like query that does not limit the path length or specify the shortest path. However, the error you encountered (RuntimeError: Buffer manager exception: Failed to claim a frame.
) suggests that the query might be causing a resource exhaustion issue, likely due to the generation of a large number of paths or a memory management problem within Kùzu.
Here is a general approach to retrieve all paths between two nodes, but please note that this may need to be adapted based on the specific capabilities and limitations of Kùzu:
MATCH p = (s:Vertex {name:"nA"})-[r:Relation*]-(t:Vertex {name: "nC"})
RETURN properties(nodes(p), 'name') AS name, properties(rels(p), 'info') AS info;
This query attempts to find all paths (r:Relation*
) between the start node s
with name nA
and the target node t
with name nC
. However, if this query is causing the buffer manager exception, you may need to:
If Kùzu supports a way to limit the recursion depth, you could try something like this:
MATCH p = (s:Vertex {name:"nA"})-[r:Relation*1..5]-(t:Vertex {name: "nC"})
RETURN properties(nodes(p), 'name') AS name, properties(rels(p), 'info') AS info;
This query limits the path length to a maximum of 5 hops, which might help avoid the buffer manager exception by reducing the number of paths generated. Adjust the maximum length according to the specifics of your graph and the capabilities of Kùzu.
Hello,
I have a question on how to get all possible paths between two nodes. I have the following graph:
I want to get all possible paths between nodes
nA
andnC
which are:nA - nB - nC
nA - nG - nE - nF - nC
Based on the documentation, I found how to get the shortest path (path 1):
I thought that by removing
ALL SHORTEST
I would get all possible paths (path 1 and path 2):but this query raises the exception:
You have an example in the documentation on how to parse all direct and indirect paths, but I find that example too complicated. Could you provide some guidelines on how to parse all paths between nodes
nA
andnC
in this simple example?Thank you in advance.
)