I want to calculate the total probability of graph by multiplying probabilities of nodes. but the multiplication changes according to connection of nodes. For example, the calculation for above graph should be like: The probability of that the ...
Can somone please correct this qury;
MATCH p = (startNode:Label1)-[*]->(endNode:Label2)
WITH nodes(p) AS pathNodes
WITH pathNodes,
REDUCE(prob = 1, i in RANGE(0, LENGTH(pathNodes) - 2) |
CASE WHEN (pathNodes[i])-[:DIRECT]->(pathNodes[i+1]) THEN prob ...
I've tried this, but it only handles nodes connected in series, not in loop.
MATCH path = (start:Node {name: "start"})-[:TO*]->(end:Node {name: "end"})
WITH nodes(path) as nodes_in_path
RETURN reduce(probability = 1.0, node in nodes_in_path | probabi...