Neo4j Wiki から
This is a component that offers implementations of common graph algorithms on top of Neo4j. It is mostly focused around finding paths, like finding the shortest path between two nodes, but it also contains a few different centrality measures, like betweenness centrality for nodes. The initial implementation was part of a master thesis project, so for a more advanced theoretical background the report should be available.
 Including it into your project
You need to make sure that the jar file for this component is in your classpath (just like Neo4j). The easiest way to achieve this is to use Maven. Just add this to your pom.xml:
<dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-graph-algo</artifactId> <version>1.3</version> </dependency>
...and it should be available, ready to use!
There exists a number of algorithms and more are being added. To get a complete overview including the latest changes and documentation of algorithm complexities please see the API. Also, if we don't have the algorithm you would like, feel free to contact us.
 Path finding algorithms
The Neo4j Graph Algorithms package contains the following algorithms for finding paths:
- Find all paths between two nodes, limited by a specified path length.
- Find all simple paths between two nodes. Similar to finding all paths, except the same node is not allowed multiple times in the same path.
- Find the shortest path between two nodes.
- Dijkstras algorithm for finding the paths with lowest cost between two nodes.
- The A* search algorithm for finding the paths with lowest cost between two nodes in a graph where the cost from each node to the target can be estimated.
 Centrality algorithms and graph measures
In this family of algorithms we have:
- Network diameter
- Network radius
- Stress centrality
- Closeness centrality
- Betweenness centrality
- Eigenvector centrality
Further, some of these might be done in parallel.
All of these compute measures of centrality, computing a value for each node. The exceptions are diameter and radius, since they give one value/measure for an entire network.
 Other algorithms
There also exists an algorithm to find all simple paths between two nodes.