PageRank

Table 1. Changes in Configuration
Graph Algorithms v3.5 Graph Data Science v1.0

direction

-

iterations

maxIterations

tolerance

tolerance

dampingFactor

dampingFactor

concurrency

concurrency

readConcurrency

readConcurrency [1]

writeConcurrency

writeConcurrency [2]

writeProperty

writeProperty [2]

weightProperty

relationshipWeightProperty

write

-

graph

-

1. Only when using anonymous graph

2. Only for write mode

Table 2. Changes in YIELD fields
Graph Algorithms v3.5 Graph Data Science v1.0

loadMillis

createMillis

computeMillis

computeMillis

writeMillis

writeMillis

postProcessingMillis

postProcessingMillis

node

nodeId [3]

score

score [3]

nodes

nodePropertiesWritten [4]

iterations

ranIterations

write

-

-

configuration [5]

writeProperty [6]

-

dampingFactor [6]

-

tolerance [6]

-

weightProperty [7]

-

3. Only for stream mode

4. Only for write mode

5. The configuration used to run the algorithm

6. Inlined into configuration

7. Inlined into configuration as relationshipWeightProperty

Table 3. PageRank Stream Mode
Graph Algorithms v3.5 Graph Data Science v1.0

Minimalistic stream over named graph:

CALL algo.pageRank.stream(null, null, {graph: 'myGraph'})
YIELD nodeId, score
CALL gds.pageRank.stream('myGraph')
YIELD nodeId, score

Streaming over named graph with iteration limit:

CALL algo.pageRank.stream(
  null,
  null,
  {
    graph: 'myGraph',
    iterations: 20
  }
)
CALL gds.pageRank.stream(
  'myGraph',
  {
    maxIterations: 20
  }
)

Minimalistic streaming over anonymous graph:

CALL algo.pageRank.stream(
  'MyLabel',
  'MY_RELATIONSHIP_TYPE'
)
CALL gds.pageRank.stream({
  nodeProjection: 'MyLabel',
  relationshipProjection: 'MY_RELATIONSHIP_TYPE'
})

Streaming over anonymous graph with REVERSE relationship orientation:

CALL algo.pageRank.stream(
  'MyLabel',
  'MY_RELATIONSHIP_TYPE',
  { direction: 'INCOMING' }
)
CALL gds.pageRank.stream({
  nodeProjection: 'MyLabel',
  relationshipProjection: {
    MY_RELATIONSHIP_TYPE: {
      orientation: 'REVERSE'
    }
  }
})

Streaming over anonymous graph with relationship weight property, assigning it a default value in case the property doesn’t have value:

CALL algo.pageRank.stream(
  'MyLabel',
  'MY_RELATIONSHIP_TYPE',
  {
    weightProperty: 'myWeightProperty',
    defaultValue: 1.5
  }
)
CALL gds.pageRank.stream({
  nodeProjection: 'MyLabel',
  relationshipProjection: {
    MY_RELATIONSHIP_TYPE: {
      properties: {
        myWeightProperty: {
          defaultValue: 1.5
        }
      }
    }
  }
})
Table 4. PageRank Write Mode
Graph Algorithms v3.5 Graph Data Science v1.0

Running write mode on named graph:

CALL algo.pageRank(
  null,
  null,
  {
    graph: 'myGraph',
    writeProperty: 'myWriteProperty',
    write: true
  }
)
YIELD
  nodes,
  loadMillis,
  iterations,
  p1,
  writeProperty
CALL gds.pageRank.write(
  'myGraph',
  {
    writeProperty: 'myWriteProperty'
  }
)
YIELD
  nodePropertiesWritten,
  createMillis,
  ranIterations,
  configuration AS conf
RETURN
  nodePropertiesWritten,
  writeMillis,
  ranIterations,
  conf.writeProperty AS writeProperty

Memory estimation of the algorithm:

CALL algo.memrec(
  'MyLabel',
  'MY_RELATIONSHIP_TYPE',
  'pageRank',
  {
    writeProperty: 'myWriteProperty',
    write: true
  }
)
CALL gds.pageRank.write.estimate(
  {
    nodeProjection: 'MyLabel',
    relationshipProjection: 'MY_RELATIONSHIP_TYPE',
    writeProperty: 'myWriteProperty'
  }
)