Hi All, I have created a graph which i have attached in the chat.
So my graph has one EntryPoint node, then TransferPoint node, then WareHouse node , Delivery node and last is Destination node.
all these nodes are connected via CONNECTED_TO relationships with a weightted property like cost.
The problem is when i am trying to load the full graph via graph projection, i am unable to project the graph.
The query which i am trying to project graph is
MATCH (source:EntryPoint)-[r:CONNECTED_TO]->(target:Destination)
RETURN gds.graph.project(
'myGraph1',
source,
target,
{
relationshipProperties: r{.cost}
}
)
and its returning an error like
gds.graph.project( 'myGraph1', source, target, { relationshipProperties: r{.cost} } )
null
I was basically trying to use Yen's algorithm to find 3 shortest path, but since my node names are different , hence my query is giving null as output.
Can anyone help me how can i project my whole graph and can use Yen''s algorithm to find shortest paths??
Match (source:EntryPoint{name:'Factory1'}),(target:Destination{name:'Recipent1'})
CALL gds.shortestPath.yens.stream('myGraph1', {
sourceNode: source,
targetNode: target,
k: 3,
relationshipWeightProperty: 'cost'
})
YIELD index, sourceNode, targetNode, totalCost, nodeIds, costs, path
RETURN
index,
gds.util.asNode(sourceNode).name AS sourceNodeName,
gds.util.asNode(targetNode).name AS targetNodeName,
totalCost,
[nodeId IN nodeIds | gds.util.asNode(nodeId).name] AS nodeNames,
costs,
nodes(path) as path
ORDER BY index
Now i am using this query and i am getting results as null.
i don't understand why algorithm can't find shortest path with this query whereas graph has data from Soruce to target.