Random Walk on Bipartite Graph with Gremlin
I would like to rank items according to a given users preference (items liked by the user) based on a random walk on a directed bipartite graph using gremlin in groovy. The graph has the following basic structure: [User1] ---'likes'---> [ItemA] <---'likes'--- [User2] ---'likes'---> [ItemB] Hereafter the query that I came up with: def runRankQuery(def userVertex) { def m = [:] def c = 0 while (c < 1000) { userVertex .out('likes') // get all liked items of current or similar user .shuffle[0] // select randomly one liked item .groupCount(m) // update counts for selected item .in('likes') // get