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.

Recursive query with relationship weights

I am building a tool that enables users to recommend sequences of online courses to other users.

Off the back of the data generated from that, I would like to generate insights on what the most recommended sequences of courses are. Here's a slice of the model:

2X_2_2c792011f89fe7a003342ebd7a8ed4aae72bbc6b.png

In this graph, the numbers in green are weights that show how many people have recommended one course after the other (ex: 655 people recommend taking Stanford's ML after Intro to Prob)

The recs field in nodes is the absolute number of recommendations that course has (ex: Stanford ML has been featured by 1000 users in sequences)

What I would like to do, is starting from an end goal, finding out the most recommended pre-requisites.

The algorithm might work something like this:

Function fancy_algo (node, graph)
    If (no prereqs OR prereq weight is very low)
        Return graph
    Get all incoming nodes
    For each incoming node subject
        MR = most recommended pre-req
        Append MR to graph
        fancy_algo(MR, graph)

The end state for someone looking to do Stanford's Machine Learning might look something like this:

2X_e_ed544b80e01416ebba8d204823e63f8a14ee430f.png

Note how after "Intro to CS" we haven't included "Algebra", because its prereq weight was very low (20 out of 4567).

Is this something that can be managed with Cypher? How would I get started?

0 REPLIES 0