Hi,
I am new to Titan and Gremlin.
I am doing a depth first search on the graph which is a DAG from root to leafs( loaded from the JSON file ) using the GremlinePipeline java class. I am getting the BFS results instead of DFS.
the code is as follows -->
GremlinPipeline<Vertex, Vertex> pipe = new GremlinPipeline<Vertex, Vertex>();
pipe = pipe.start(g.getVertex(v.getId())).as("x").outE("manages").inV().loop("x", whileFunction, emitFunction);
//the whileFunction is -->
PipeFunction<LoopBundle<Vertex>, Boolean> whileFunction = new PipeFunction<LoopBundle<Vertex>, Boolean>() {
@Override
public Boolean compute(LoopBundle<Vertex> bundle) {
// System.out.println("looping vertex---------"
// + bundle.getObject().getProperty("name"));
bundle.getLoops();
Iterable<Edge> itr = bundle.getObject().getEdges(
Direction.OUT, "manages");
if (itr.iterator().next() == null)
return false;
else
return true;
}
}
Is is a right way to configure a DFS pipe?
Is there any issue with Titan 0.5.4?
Regards
Negi