You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
algo.personalizedPageRank has no direction or weightProperty, unlike algo.pagerank: a record with only outgoing edges always scores 0 #11146
algo.pagerank takes direction and weightProperty. algo.personalizedPageRank takes neither: it walks OUT only, and its docs do not say so.
So a vertex with no incoming edge scores 0 from any source. That is the shape of any record just written, which points at what already exists and has nothing pointing at it yet. For recommendation and classification, the newest record is usually the one being asked about.
Found while trying 26.11.1-SNAPSHOT before the release, as asked.
Measured
On 26.11.1-SNAPSHOT (build d6e16a35e, sha256:2852f6fb00d2), the graph in -> source -> out, with source as the source vertex:
Vertex
Score
in
0.0
source
0.558
out
0.442
Asking for the other direction:
Call
Result
algo.pagerank({direction: 'BOTH'})
works, in scores 0.26
algo.personalizedPageRank(s, {direction: 'BOTH'})
refused, the second argument must be the relationship types
The refusals are clear, and they are not the problem. There is simply no way to ask.
To reproduce
CREATE VERTEX TYPE N;
CREATE EDGE TYPE E;
CREATE (:N{k:'in'}), (:N{k:'source'}), (:N{k:'out'});
MATCH (a:N{k:'in'}), (s:N{k:'source'}), (b:N{k:'out'})
CREATE (a)-[:E]->(s), (s)-[:E]->(b);
MATCH (s:N{k:'source'})
CALLalgo.personalizedPageRank(s) YIELDnodeId, scoreRETURNnodeId, score;
What it cost
In our graph every new record linked to existing ones, so all of them scored 0 from every source, and each one fell through to the caller's default. There was no error, and the result looked like a very poor model. Reading AlgoPersonalizedPageRank.java is what showed it.
The workaround is to write every edge twice, once each way, which doubles the edge count of the graph.
What would close it
direction, with the name and the values algo.pagerank already uses, defaulting to OUT so nothing changes for current callers.
weightProperty, same name again. Weights today apply to the source vertices only, while a similarity graph keeps its score on the edge. algo.pagerank and algo.louvain already read it.
Until then, one line in reference/graph-algorithms/centrality.adoc saying the walk is OUT only.
The arguments are positional and already five, so an options map like algo.pagerank's may fit better than a sixth and a seventh.
algo.personalizedPageRank now accepts a config map as second argument, with the same names algo.pagerank uses:
MATCH (s:N{k:'source'})
CALLalgo.personalizedPageRank(s, {direction:'BOTH',weightProperty:'score'})
YIELDnodeId, scoreRETURNnodeId, score
direction: OUT (default, unchanged behaviour), IN or BOTH. With BOTH, a record that only links to existing ones is reached, so no need to write every edge twice.
weightProperty: edge property used as weight; a vertex passes its score to its neighbours in proportion to the edge weights.
relTypes, dampingFactor, maxIterations, tolerance can go in the same map.
The positional form keeps working as before, and the docs now state the default walk is OUT.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Activity
fix(#11145, #11146, #11051, #11029): labelpropagation seeds, personal…
lvca commentedon Nov 2, 2026
Fixed in #11148, available from 26.11.1.
algo.personalizedPageRanknow accepts a config map as second argument, with the same namesalgo.pagerankuses:direction:OUT(default, unchanged behaviour),INorBOTH. WithBOTH, a record that only links to existing ones is reached, so no need to write every edge twice.weightProperty: edge property used as weight; a vertex passes its score to its neighbours in proportion to the edge weights.relTypes,dampingFactor,maxIterations,tolerancecan go in the same map.The positional form keeps working as before, and the docs now state the default walk is
OUT.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(#11145, #11146, #11051, #11029): labelpropagation seeds, personal…
test: consolidate the Issue*Test classes of the other openCypher sub-…
test: consolidate the Issue*Test classes of the other openCypher sub-…