cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Does gds.graph.create(..) create something or is it more like saving the query

admin3
Node Clone

I am planning on using the Personalised Page Rank algorithm for proving personalised recommendations.

The docs provide this query

MATCH (siteA:Page {name: 'Site A'})
CALL gds.pageRank.stream('myGraph', {
  maxIterations: 20,
  dampingFactor: 0.85,
  sourceNodes: [siteA]
})
YIELD nodeId, score
RETURN gds.util.asNode(nodeId).name AS name, score
ORDER BY score DESC, name ASC

where myGraph is created with something like this

CALL gds.graph.create(
    'myGraph',
    'Page',
    'LINKS',
    {
        relationshipProperties: 'weight'
    }
)

My question id what does really creating the graph means? Is it something that is constantly being updated as my database is updated? Or is it more like a query that is run every time I call an algo?

What mode is the best usage for personalised recommendations on users based on stuff they follow (like every social network site)? How do you manage this as users and pages become millions?

2 REPLIES 2

Creating a graph like this creates a new named graph in memory, separate from your main graph, so it will not be changed as your main graph is updated.

If you use gds algo procedures that reference a named graph, then it will be run on that in-memory graph.

When you are done with that graph, make sure to delete it with gds.graph.drop(). See the graph management section of the documentation for more detail.

Thanks. Glad that point is sorted out.

So I am thinking I have two options:

  1. Use an anonymous graph that is created on the spot with my algo.
  2. Create a graph and update it every 12h or something.

Am I correct?