Dijsktra and Neo4j :: Rails

37 views
Skip to first unread message

Manolo Velduque

unread,
Feb 11, 2015, 12:04:32 PM2/11/15
to neo...@googlegroups.com
Hello! How is it possible to use Dijsktra in
Neo4j :: Rails ?, is used in the same way?

Neo4j::Algo.dijkstra_path(@x,@y).cost_evaluator{|rel,*| rel[:weight]}

Thank You!

Brian Underwood

unread,
Feb 11, 2015, 2:12:40 PM2/11/15
to neo...@googlegroups.com
We haven't been focusing on algorithms for a bit in the gem (though
it's not something that we're opposed to). I think you have two
options:

You can work in embedded more and use the java APIs directly:
http://neo4j.com/api_docs/2.0.3/org/neo4j/graphalgo/GraphAlgoFactory.html

Also see the neo4j-core API for how we support neo4j java objects in Ruby:
https://github.com/neo4jrb/neo4j-core/wiki

Secondly, you can hit the REST endpoint:
http://neo4j.com/docs/stable/rest-api-graph-algos.html#rest-api-execute-a-dijkstra-algorithm-and-get-a-single-path

The neo4j and neo4j-core gems don't currently support these endpoints,
but you can use a library like Faraday or httparty (maybe even
neography, not sure). It would probably be cool if we could support
hitting arbitrary endpoints in neo4j and returning node/relationship
objects.

Brian
;p
> --
> You received this message because you are subscribed to the Google Groups
> "neo4jrb" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to neo4jrb+u...@googlegroups.com.
> To post to this group, send email to neo...@googlegroups.com.
> Visit this group at http://groups.google.com/group/neo4jrb.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages