Hi Todd!

Todd Stavish:
> I tried to use the Dijkstra algorithm first. It is looking for a
> property that is not defined. This seems unrelated to any of my
> properties.  Any advice?
It tries to evaluate the costs of the relationships along the path. The 
example code uses the property "cost" for this and expects it to be a 
double.

There are two implementations in the package that assume an unweighted 
network:

http://components.neo4j.org/graph-algo/apidocs/org/neo4j/graphalgo/shortestpath/FindSinglePath.html
http://components.neo4j.org/graph-algo/apidocs/org/neo4j/graphalgo/shortestpath/FindPath.html

/anders


>  I am going to try the SimplePathFinder
> instead, it seems easier to digest.
>
> -Todd
>
>
> Exception in thread "main" org.neo4j.api.core.NotFoundException: cost
> property not found for RelationshipImpl #4396111 of type KNOWS between
> Node[1439740] and Node[1331693].
>       at 
> org.neo4j.impl.core.NeoPrimitive.newPropertyNotFoundException(NeoPrimitive.java:172)
>       at org.neo4j.impl.core.NeoPrimitive.getProperty(NeoPrimitive.java:167)
>       at 
> org.neo4j.impl.core.RelationshipProxy.getProperty(RelationshipProxy.java:84)
>       at 
> org.neo4j.graphalgo.shortestpath.std.DoubleEvaluator.getCost(DoubleEvaluator.java:37)
>       at 
> org.neo4j.graphalgo.shortestpath.std.DoubleEvaluator.getCost(DoubleEvaluator.java:22)
>       at 
> org.neo4j.graphalgo.shortestpath.Dijkstra$DijstraIterator.next(Dijkstra.java:309)
>       at 
> org.neo4j.graphalgo.shortestpath.Dijkstra.calculate(Dijkstra.java:475)
>       at org.neo4j.graphalgo.shortestpath.Dijkstra.getPath(Dijkstra.java:639)
>       at todd.stavish.pathfind.GraphTraverse.pathFind(GraphTraverse.java:68)
>       at todd.stavish.pathfind.GraphTraverse.main(GraphTraverse.java:23)
>
>
>
>
>
> On Tue, Sep 15, 2009 at 4:59 PM, Anders Nawroth
> <and...@neotechnology.com> wrote:
>   
>> HI Todd!
>>
>> Todd Stavish:
>>     
>>> Does anybody have traversal code that shows if two nodes are
>>> connected, and if so the nodes that connect them?
>>>
>>>       
>> Have a look at the graph-algo component:
>> http://components.neo4j.org/graph-algo/
>>
>> There's a link to the source code on the page as well.
>>
>> Then there's the pathfinder of the IMDB example:
>> http://wiki.neo4j.org/content/IMDB_Finding_the_Path
>> https://svn.neo4j.org/examples/imdb/trunk/src/main/java/org/neo4j/examples/imdb/util/SimplePathFinder.java
>>
>>
>> /anders
>>
>> --
>> Anders Nawroth [and...@neotechnology.com]
>> GTalk, Skype: anders.nawroth
>> Phone: +46 737 894 163
>> http://twitter.com/nawroth
>> http://blog.nawroth.com/
>>
>> _______________________________________________
>> Neo mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
>>     
> _______________________________________________
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>   


-- 
Anders Nawroth [and...@neotechnology.com]
GTalk, Skype: anders.nawroth
Phone: +46 737 894 163
http://twitter.com/nawroth
http://blog.nawroth.com/

_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to