@Override
    public TraversalVertexProgram generateProgram(final Graph graph, final Memory memory) {
        final Traversal.Admin<?, ?> computerSpecificTraversal = this.computerTraversal.getPure();
        final TraversalStrategies computerSpecificStrategies = this.getTraversal().getStrategies().clone();

        IteratorUtils.filter(TraversalStrategies.GlobalCache.getStrategies(graph.getClass()),
                s -> s instanceof TraversalStrategy.ProviderOptimizationStrategy).forEach(computerSpecificStrategies::addStrategies);

        computerSpecificTraversal.setStrategies(computerSpecificStrategies);
        computerSpecificTraversal.setSideEffects(new MemoryTraversalSideEffects(this.getTraversal().getSideEffects()));
        computerSpecificTraversal.setParent(this);
        final TraversalVertexProgram.Builder builder = TraversalVertexProgram.build().traversal(computerSpecificTraversal);
        if (memory.exists(TraversalVertexProgram.HALTED_TRAVERSERS))
            builder.haltedTraversers(memory.get(TraversalVertexProgram.HALTED_TRAVERSERS));
        return builder.create(graph);
    }
@author Marko A. Rodriguez (http://markorodriguez.com)
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/TraversalVertexProgramStep.java