Tested on version v26.5.1-SNAPSHOT
Minimal data created with:
CREATE VERTEX Type Node;
CREATE EDGE Type Road;
CREATE VERTEX Node SET name = 'Start'
CREATE VERTEX Node SET name = 'Middle'
CREATE VERTEX Node SET name = 'Finish'
CREATE EDGE Road FROM
(SELECT FROM Node WHERE name = 'Start')
TO
(SELECT FROM Node WHERE name = 'Middle')
SET distance = 2;
CREATE EDGE Road FROM
(SELECT FROM Node WHERE name = 'Middle')
TO
(SELECT FROM Node WHERE name = 'Finish')
SET distance = 3;
Then, a call to the Dijkstra function:
MATCH (src:Node {name:'Start'}),(dst:Node {name:'Finish'})
CALL algo.dijkstra(src, dst, 'Road', 'distance')
YIELD path, weight
RETURN weight
results in weight: 0 (expected 5)
Conversely, kShortestPaths:
MATCH (src:Node {name:'Start'}),(dst:Node {name:'Finish'})
CALL algo.kShortestPaths(src, dst, 1, 'Road', 'distance')
YIELD path, weight
RETURN weight
returns the correct value
Also, as a side question, I don't understand why these path-finding functions return the vertices but not the edges. It returns them in ArcadeDB Studio, but not when calling them from the API. I can't find how I would retrieve them, am I missing something here?
Tested on version v26.5.1-SNAPSHOT
Minimal data created with:
Then, a call to the Dijkstra function:
results in
weight: 0(expected 5)Conversely, kShortestPaths:
returns the correct value
Also, as a side question, I don't understand why these path-finding functions return the vertices but not the edges. It returns them in ArcadeDB Studio, but not when calling them from the API. I can't find how I would retrieve them, am I missing something here?