Updating in-memory gds projected graph

Hello there,
So far i am trying to build a song recommendation engine. I have completed like this

  1. creating a projected graph from original graph
  2. run label propagation algorithm on projected graph and got the community ID
  3. After getting community id i have run recommendation queries and provides suggeston list to those who didnt listen specific song in community but listened or liked other song

Here is my question
If i add new node song and user who didnt listen any other song . and dont have community id yet or listend song first time .
do i need to project graph again after droping previous projected graph ? and then rerun communitity detection algorithm for creating updated community id .

is there any other solution if i want to keep my projected graph and update it .
Please help me. my neo4j version is 5.3.0 and 2.3 gds version

Hello @kalyan_b_aninda ,
the short answer is yes, you need to reproject the graph and rerun the community detection algorithm.

Now you likely dont want to do this for every single new song but run it periodically.
As when several songs are added the graph structure could change a lot and lead to fully new communities. Maybe you already saw the seedProperty which you are interested in for later runs.

If you want to estimate the community of a new song, you could also gather the communities from its neighbors directly in Cypher and assign most common neighbor.

Hope I could help you :slight_smile:

Thanks florentin for the suggestion. the seededProperty seems nice trick which will actualy help me to update the communityId if my nodes have previous community_id .but if there are several new nodes and dont belong any communityID . is seedProperty sets new communityId to them iteratively ? if so i could not run label propagation without creating the projected graph. so will i project graph every time and run label propagation with seedProperty every time to update community . basically i dont want to project graph every time if my original graph gets updated in real time. so could i do this process after a fixed interval time

Many thanks to Florentin for the advice. If my nodes had a previous community_id, the seededProperty approach appears to be a wonderful one that will actually assist me in updating the communityId.however, if multiple new nodes appear and they do not belong to any communityID. Is seedProperty repeatedly assigning new communityIds to them? In that case, I would be unable to conduct label propagation without first building the projected graph. As a result, I will always project the graph and always conduct label propagation using seedProperty to update the community. Basically, if my original graph is updated in real time, I don't want to project the graph every time. Could I then perform this process at a set interval of time?

For Label Propagation, new nodes will get an initial id of maxSeedCommunityId + id(node) + 1L.

I think I dont fully understand your question.
As already written above, I would also recommend to use a fixed interval time to compute communities for the new nodes. To achieve this, I would use probably the Python driver and write a small script. Alternatively you could look into apoc.periodic.repeat - APOC Documentation

@ma7403595 Your question sounds very similar to the above. Could you clarify how they differ?