if (!(this.traversal.getSteps().get(0) instanceof GraphStep))
throw new UnsupportedOperationException("TraversalVertexProgram currently only supports GraphStep starts on vertices or edges");
final GraphStep<Element> startStep = (GraphStep<Element>) this.traversal.getSteps().get(0); // TODO: make this generic to Traversal
final TraverserGenerator traverserGenerator = TraversalStrategies.GlobalCache.getStrategies(this.traversal.getClass()).getTraverserGenerator(this.traversal, TraversalEngine.COMPUTER);
final String future = startStep.getNextStep() instanceof EmptyStep ? Traverser.Admin.HALT : startStep.getNextStep().getLabel();
final AtomicBoolean voteToHalt = new AtomicBoolean(true);
final Iterator<? extends Element> starts = startStep.returnsVertices() ? new SingleIterator<>(vertex) : vertex.iterators().edgeIterator(Direction.OUT);
starts.forEachRemaining(element -> {
final Traverser.Admin<Element> traverser = traverserGenerator.generate(element, startStep);
traverser.setFuture(future);
traverser.detach();
if (traverser.isHalted())
haltedTraversers.add((Traverser.Admin) traverser);
else {