我使用neo4j数据库来计算节点之间的最短路径。整个图包括400K节点。当我使用加法运算计算权重时,我可以使用如下所示的shortestPath算法,但是如果我想使用乘法运算应该怎么做节点的权重?
MATCH (sourceNode:entity{name: $name})
CALL gds.alpha.shortestPath.deltaStepping.stream({
startNode: sourceNode,
nodeProjection: "*",
relationshipProjection: {
all: {
type: "*",
properties: "weight",
orientation: "UNDIRECTED"
}
},
relationshipWeightProperty: "weight",
delta: 1.0
})
YIELD nodeId, distance
WHERE gds.util.isFinite(distance)
RETURN sourceNode.name,
gds.util.asNode(nodeId).name AS aim_entity,
distance
ORDER BY distance;