Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Gremlin makes these type of graph algorithms easy (https://github.com/tinkerpop/gremlin/wiki):

  g = new Neo4jGraph('/tmp/neo4j')

  // calculate basic collaborative filtering for vertex 1
  m = [:]
  g.v(1).out('likes').in('likes').out('likes').groupCount(m)
  m.sort{a,b -> a.value <=> b.value}

  // calculate the primary eigenvector (eigenvector  centrality) of a graph
  m = [:]; c = 0;
  g.V.out.groupCount(m).loop(2){c++ < 1000}
  m.sort{a,b -> a.value <=> b.value}
And Bulbs allows you to run Gremlin scripts from Python (http://bulbflow.com/).


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: