I'm creating my first Neo4j (4.0.4) application and I'm trying to order results based on the weighted ArticleRank algorithm. Everything has been intuitive so far but I can't figure out why relationship weights do not affect the ArticleRank score.
Given the schema:
MERGE (paper0:Paper {name:'Paper 0'})
MERGE (paper1:Paper {name:'Paper 1'})
MERGE (paper2:Paper {name:'Paper 2'})
MERGE (paper3:Paper {name:'Paper 3'})
MERGE (paper4:Paper {name:'Paper 4'})
MERGE (paper5:Paper {name:'Paper 5'})
MERGE (paper6:Paper {name:'Paper 6'})
MERGE (paper1)-[:CITES {weight: 10.0}]->(paper0)
MERGE (paper2)-[:CITES {weight: 1.0}]->(paper0)
MERGE (paper2)-[:CITES {weight: 100.0}]->(paper1)
MERGE (paper3)-[:CITES {weight: 10.0}]->(paper0)
MERGE (paper3)-[:CITES {weight: 1.0}]->(paper1)
MERGE (paper3)-[:CITES {weight: 100.0}]->(paper2)
MERGE (paper4)-[:CITES {weight: 10.0}]->(paper0)
MERGE (paper4)-[:CITES {weight: 1.0}]->(paper1)
MERGE (paper4)-[:CITES {weight: 100.0}]->(paper2)
MERGE (paper4)-[:CITES {weight: 10.0}]->(paper3)
MERGE (paper5)-[:CITES {weight: 100.0}]->(paper1)
MERGE (paper5)-[:CITES {weight: 1.0}]->(paper4)
MERGE (paper6)-[:CITES {weight: 10.0}]->(paper1)
MERGE (paper6)-[:CITES {weight: 100.0}]->(paper4)
When I run this query:
CALL gds.alpha.articleRank.stream({
nodeProjection: 'Paper',
relationshipProjection: {
CITES: {
properties: 'weight'
}
},
relationshipWeightProperty: 'weight'
})
YIELD nodeId, score
RETURN gds.util.asNode(nodeId).name AS page, score
ORDER BY score DESC
I get the same result as when I run this query:
CALL gds.alpha.articleRank.stream({
nodeProjection: 'Paper',
relationshipProjection: 'CITES'
})
YIELD nodeId, score
RETURN gds.util.asNode(nodeId).name AS page, score
ORDER BY score DESC
The result, which is:
╒═════════╤═══════════════════╕
│"page" │"score" │
╞═════════╪═══════════════════╡
│"Paper 0"│0.3462769146633946 │
├─────────┼───────────────────┤
│"Paper 1"│0.31950147982279303│
├─────────┼───────────────────┤
│"Paper 4"│0.21375000253319743│
├─────────┼───────────────────┤
│"Paper 2"│0.21092906260164457│
├─────────┼───────────────────┤
│"Paper 3"│0.18028125041164458│
├─────────┼───────────────────┤
│"Paper 5"│0.15000000000000002│
├─────────┼───────────────────┤
│"Paper 6"│0.15000000000000002│
└─────────┴───────────────────┘
Given the relationships have different weights, how is it that running the ArticleRank algorithm while utilizing weights results in the same scores as when the weights aren't used?