views:

122

answers:

1

I would like to store the following graph data in the database,

graph.makeEdge( "s", "c", "cost", (double) 7 );
graph.makeEdge( "c", "e", "cost", (double) 7 );
graph.makeEdge( "s", "a", "cost", (double) 2 );
graph.makeEdge( "a", "b", "cost", (double) 7 );
graph.makeEdge( "b", "e", "cost", (double) 2 );

Then run the Dijskra algorighm from a web servlet, to find shortest path calculations using the stored graph data. Then I will print the path to a html file from the servlet.

Dijkstra<Double> dijkstra = getDijkstra( graph, 0.0, "s", "e" );
+1  A: 

I'm not sure what the actual question or problem is, could you clarify a bit?

There's a getting started guide that shows basic API usage for Neo4j. If you use it from Java, there's javadocs online. You probably want to index some property on the nodes to find them again, see indexing and indexing with batchinserter. Graph algorithms like Dijkstra are documented on the wiki. Does that help?

Update: I created a full example inspired by this question, located here: http://github.com/neo4j-examples/java-dijkstra. The example includes common Neo4j components and javadocs so it can be used as a starting point for learning more.

nawroth
hi nawroth, i have edited the question, thanks
paddydub
hi paddydub, I finally think I found out what you want. stay tuned for an update of my answer in a while!
nawroth
thanks nawroth !!
paddydub