[Neo] JUNG algos in Neo4j

Marko A. Rodriguez marko at lanl.gov
Sat Feb 6 18:25:07 CET 2010


Hey guys,

> This is not going to have super
> performance, but might be interesting for people to play with?

I don't know why Peter keeps saying this. See below:

I was talking with Peter a bit ago and I wanted to make sure everyone is
clear on the JUNG connector. The connector DOES NOT create a replica of
the Gremlin property graph in memory. I do not use any of the provided
JUNG graph implementations. Instead, I implement their Graph.java
interface. As such, only a single graph exists. Thus, JUNG over a large
Neo4j graph will work---however, there are some areas where optimization
will be needed. Something along the lines of:

if(graph instanceof Neo4jGraph) {
  // do something more optimal than what is done just using the property
graph model interfaces...
}

However, these are things that can be worked out as we move forward. To
get people excited about the JUNG/Gremlin connector that was so
thoughtfully inspired by Seth (S.H. on our mailing list), I added three
new algorithms:

PageRank: http://paste.pocoo.org/show/174483/
DjikstrasShortestPath: http://paste.pocoo.org/show/174484/
EdgeBetweeneessClusterer: http://paste.pocoo.org/show/174486/

PageRank returns a map of vertex-to-number (the probability-rank of each
vertex in the graph).
DjikstrasShortestPath returns an ordered list of edges from a source
vertex to a destination vertex that defines the shortest path.
EdgeBetweeneessClusterer: returns a map of lists, where each key is a
cluster and each value is the vertices in that cluster as a list.

These are not finalized as there are some things we need to add like
transformers to get edge weights if desired, etc. However, its a start and
worth moving forward with. Just looking at the JUNG algorithms, there are
about 10 that I think are good to have and then, as needed, we can add
more.

Take care,
Marko.


More information about the User mailing list