Hello! I’m working on a project where I need to find the route between two nodes, but this path must contains several nodes. For example:
{
set {
_:1 <name> "test1" .
_:1 <next> _:2 .
_:1 <next> _:5 .
_:2 <name> "test2" .
_:2 <next> _:3 .
_:2 <next> _:4 .
_2 <next> _:5 .
_:3 <name> "test3" .
_:3 <next> _:5 .
_:4 <name> "test4" .
_:4 <next> _:5 .
_:5 <name> "test5" .
_:6 <name> "test6" .
}
}
function(from "test1", to "test5", contains = ["test2", "test4"]) = [["test1" ,"test2" , "test4", "test5"], ["test1" ,"test2", "test3" , "test4", "test5"] ]
function(from "test1", to "test5", contains = ["test2"]) = [ ["test1" ,"test2", "test5"], ["test1" ,"test2" , "test3", "test5"], ["test1" ,"test2" , "test4", "test5"], ["test1" ,"test2", "test3" , "test4", "test5"] ]
function(from "test1", to "test5", contains = []) = [ ["test1", "test5"], ["test1" ,"test2", "test5"], ["test1" ,"test2" , "test3", "test5"], ["test1" ,"test2" , "test4", "test5"], ["test1" ,"test2", "test3" , "test4", "test5"] ]
function(from "test1", to "test5", contains = [ "test6"]) = []
So I’m wondering is dgraph a good solution? And if it is how would you do that? I watched on function “K Shortest Path Query”. It gives me the shortest path between a source ( from
) node and destination ( to
) node. But I can’t influence on this way.