how to traverse with constaint

56 views
Skip to first unread message

RW

unread,
Jun 19, 2015, 6:51:01 PM6/19/15
to orient-...@googlegroups.com
Hi All,

I want to restrict on traversing because i have several hubs in my graph, which connect with almost half of the vertices. each time I want to find some path, it consumes a lot of time. In my graph, there are several directed edge classes extending E. for example 'FriendTo', 'FamilyWith', 'ColleagueWith', 'TeacherTo', 'dontVisit'

right now, the traverse query without constraint is e.g

traverse both() from #9:0 while $depth<=5 strategy breadth_first

However, I don't want traverse through the edges in class 'dontVisit', How to do that?
if it is not feasible, then how to add a blacklist such that the huge number of vertices in the neighborhood of blacklisted vertices will not be visited, to save traverse time. I tried 

select ID from (traverse both(@rid!='#9:1') from #9:0 while $depth<=5 strategy breadth_first)

Is that the correct way?

Thanks!

Colin

unread,
Jun 19, 2015, 10:00:03 PM6/19/15
to orient-...@googlegroups.com
Hi RW,

How many edges do you need to traverse?

Could you specify the name of the edge in your traverse to limit them?

-Colin

Orient Technologies

The Company behind OrientDB

Ru Wang

unread,
Jun 19, 2015, 10:23:56 PM6/19/15
to orient-...@googlegroups.com
Hi Colin, 

In reality, my problem is given a vertex, and I want to find paths on graph from it to a set of vertices (a fix set of vertices,e.g.100). Because some vertices are hubs, they have a lot of edges attaching to it, for example 100,000. I dont' want to visits these hubs to search 100,000 vertices every time. could it be solved if I set a special class of edge to its edges and traverse any edges but this class of edges, or add these hubs to blacklist and traverse any neighbors but these hubs' neighbors. Is that possible? Thanks,

RW


--

---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

light

unread,
Jul 13, 2017, 11:24:10 AM7/13/17
to OrientDB
hace you find a way to solve your problem? i have the same problem, thanks

在 2015年6月20日星期六 UTC+8上午10:23:56,RW写道:
Reply all
Reply to author
Forward
0 new messages