Hi Luigi,

I'm new to graph databases and I have the same question as Georg regarding 
shortestPath restricted to an edge class. I think you're right and it will 
probably spend a few hours preparing a pull request to implement this kind 
of filter in OSQLFunctionShortestPath.java 
<https://github.com/orientechnologies/orientdb/blob/develop/graphdb/src/main/java/com/orientechnologies/orient/graph/sql/functions/OSQLFunctionShortestPath.java>.
 
I have the same issue Georg has : it's been a while since my last Java 
project and, even if it shouldn't be too hard to write the code, I will 
spend countless hours trying to prepare a dev environment :(

But, on short term, would it be a good idea to use Dijkstra algorithm while 
playing with weights. I explain : I have a graph with User and Company 
vertices. One User can be Connected to another User, one User can Follow a 
Company and one Company can have been FoundedBy a User. So, a typical graph 
would be : 

User A -> Connected -> User B -> Connected -> User C -> Connected -> User D

User A -> Follow -> Company B -> FoundedBy -> User D

When I try to get the shortestPath between User A and User D, I would get 
the second path (the one using Company B). I'm using this query to help 
User A to get in touch with User D. User B and User C are real people so 
they can introduce User A to User D. Something that Company B obviously 
can't do :(
Is it a good idea to add a "userConnectionWeight" attribute to Connected 
edges with value 0 and to Follow and FoundedBy edges with value 99999999 so 
that the dijkstra algorithm would return the first path ? It seems like a 
bit of a hack, don't you think ? :(
I'm using OrientDB 2.0.1 BTW.
Thanks !


On Tuesday, February 10, 2015 at 8:53:58 AM UTC+1, Luigi Dell'Aquila wrote:
>
> Hi Georg,
>
> in current implementation it's not possible. Anyway Dijkstra and 
> ShortestPath functions are quite simple (links to the source code below), 
> you could just implement your own version starting from them and (why not?) 
> send a pull request and become OrientDB contributor.
>
>
> https://github.com/orientechnologies/orientdb/blob/develop/graphdb/src/main/java/com/orientechnologies/orient/graph/sql/functions/OSQLFunctionShortestPath.java
>
>
>
> https://github.com/orientechnologies/orientdb/blob/develop/graphdb/src/main/java/com/orientechnologies/orient/graph/sql/functions/OSQLFunctionDijkstra.java
>
> Thanks
>
> Luigi
>
> 2015-02-10 3:20 GMT+01:00 Georg Göttlich <[email protected] 
> <javascript:>>:
>
>> Hello eveyone.
>>
>> I wanted to know if there is a way to restrict path finding 
>> (shortestPath, Dijkstra) to a certain type of Edges?
>>
>> If not, what would be the suggested route to integrate this (and also the 
>> dynamic weight property feature from my other post) myself?
>>
>> Thanks a lot.
>>
>> Cheers
>> Georg
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OrientDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to