class NearestTraverser extends Traverser {

        public NearestTraverser(HugeTraverser traverser,
                                TraverseStrategy strategy,
                                Collection<Id> sources, Collection<Id> targets,
                                EdgeStep step, int depth, long capacity,
                                long limit, boolean concurrent) {
            super(traverser, strategy, sources, targets, step,
                  depth, capacity, limit, concurrent);
        }

        @Override
        protected void processOneForForward(Id sourceV, Id targetV) {
            Node source = this.sources.get(sourceV).get(0);
            // If have loop, skip target
            if (source.contains(targetV)) {
                return;
            }

            // If cross point exists, path found, concat them
            if (this.targetsAll.containsKey(targetV)) {
                Node node = this.targetsAll.get(targetV).get(0);
                List<Id> path = source.joinPath(node);
                if (!path.isEmpty()) {
                    this.paths.add(new Path(targetV, path));
                    if (this.reachLimit()) {
                        return;
                    }
                }
            }

            // Add node to next start-nodes
            this.addNodeToNewVertices(targetV, new Node(targetV, source));
        }

        @Override
        protected void processOneForBackward(Id sourceV, Id targetV) {<FILL_FUNCTION_BODY>}

        @Override
        protected void reInitCurrentStepIfNeeded(EdgeStep step,
                                                 boolean forward) {
            if (forward) {
                // Re-init targets
                this.sources = this.newVertices;
                // Record all passed vertices
                this.addNewVerticesToAll(this.sourcesAll);
            } else {
                // Re-init targets
                this.targets = this.newVertices;
                // Record all passed vertices
                this.addNewVerticesToAll(this.targetsAll);
            }
        }

        @Override
        public void addNodeToNewVertices(Id id, Node node) {
            this.newVertices.putIfAbsent(id, ImmutableList.of(node));
        }

        @Override
        public void addNewVerticesToAll(Map<Id, List<Node>> targets) {
            for (Map.Entry<Id, List<Node>> entry : this.newVertices.entrySet()) {
                targets.putIfAbsent(entry.getKey(), entry.getValue());
            }
        }

        @Override
        protected int accessedNodes() {
            return this.sourcesAll.size() + this.targetsAll.size();
        }
    }

            Node sourcee = this.targets.get(sourceV).get(0);
            // If have loop, skip target
            if (sourcee.contains(targetV)) {
                return;
            }

            // If cross point exists, path found, concat them
            if (this.sourcesAll.containsKey(targetV)) {
                Node node = this.sourcesAll.get(targetV).get(0);
                List<Id> path = sourcee.joinPath(node);
                if (!path.isEmpty()) {
                    Path newPath = new Path(targetV, path);
                    newPath.reverse();
                    this.paths.add(newPath);
                    if (this.reachLimit()) {
                        return;
                    }
                }
            }

            // Add node to next start-nodes
            this.addNodeToNewVertices(targetV, new Node(targetV, sourcee));
        
<methods>public void <init>(org.apache.hugegraph.HugeGraph) ,public static void checkCapacity(long) ,public static void checkCapacity(long, long, java.lang.String) ,public static void checkDegree(long) ,public static void checkLimit(long) ,public static void checkNonNegative(long, java.lang.String) ,public static void checkNonNegativeOrNoLimit(long, java.lang.String) ,public static void checkPositive(long, java.lang.String) ,public static void checkPositiveOrNoLimit(long, java.lang.String) ,public static void checkSkipDegree(long, long, long) ,public static void checkTraverseMode(java.lang.String) ,public Iterator<Edge> createNestedIterator(org.apache.hugegraph.backend.id.Id, org.apache.hugegraph.traversal.algorithm.steps.Steps, int, Set<org.apache.hugegraph.backend.id.Id>, boolean) ,public Iterator<Edge> edgesOfVertex(org.apache.hugegraph.backend.id.Id, org.apache.hugegraph.traversal.algorithm.steps.Steps) ,public org.apache.hugegraph.traversal.algorithm.HugeTraverser.EdgesIterator edgesOfVertices(Iterator<org.apache.hugegraph.backend.id.Id>, org.apache.hugegraph.type.define.Directions, List<org.apache.hugegraph.backend.id.Id>, long) ,public org.apache.hugegraph.HugeGraph graph() ,public static boolean isTraverseModeDFS(java.lang.String) ,public static List<org.apache.hugegraph.structure.HugeEdge> pathEdges(Iterator<Edge>, org.apache.hugegraph.structure.HugeEdge) ,public static Iterator<Edge> skipSuperNodeIfNeeded(Iterator<Edge>, long, long) ,public static Map<K,V> topN(Map<K,V>, boolean, long) <variables>public static final java.lang.String DEFAULT_CAPACITY,public static final java.lang.String DEFAULT_ELEMENTS_LIMIT,public static final java.lang.String DEFAULT_LIMIT,public static final java.lang.String DEFAULT_MAX_DEGREE,public static final int DEFAULT_MAX_DEPTH,public static final java.lang.String DEFAULT_PAGE_LIMIT,public static final java.lang.String DEFAULT_PATHS_LIMIT,public static final java.lang.String DEFAULT_SAMPLE,public static final java.lang.String DEFAULT_SKIP_DEGREE,public static final java.lang.String DEFAULT_WEIGHT,protected static final Logger LOG,protected static final int MAX_VERTICES,public static final long NO_LIMIT,public static final java.lang.String TRAVERSE_MODE_BFS,public static final java.lang.String TRAVERSE_MODE_DFS,private static org.apache.hugegraph.util.collection.CollectionFactory collectionFactory,public java.util.concurrent.atomic.AtomicLong edgeIterCounter,private final non-sealed org.apache.hugegraph.HugeGraph graph,public java.util.concurrent.atomic.AtomicLong vertexIterCounter