Hi, my suggestion is: - declare the edge class - define "out" and "in" link properties on it - create an index on these properties then you can just query the edge class with
SELECT FROM YourEdgeClass WHERE out = ? AND in = ? passing the two vertices as query parameters. You will have a result in milliseconds Luigi 2015-05-21 13:02 GMT+02:00 <[email protected]>: > Hi, > there are two vertexs:v1 and v2,how can I judge the two nodes is connected > by one edge?My own codes is as follows: > for(Vertex v:v1.getVertices(Direction.BOTH)){ > if(v2.equals(v)){ > System.out.println("the two nodes are connected"); > break; > } > } > but I need to determine whether two nodes is connected in a big > dataset,if in my own judgement,it is very slow. so I want to konw whether > exists a corresponding API can achieve the same function.Thanks very mush ! > > -- > > --- > 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. > -- --- 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.
