This method calculates the alternative path list using the low level Path objects.
191196
public List<Path> calcPaths(GHRequest request, GHResponse ghRsp) {
        if (ghStorage == null || !fullyLoaded)
            throw new IllegalStateException("Do a successful call to load or importOrLoad before routing");

        if (ghStorage.isClosed())
            throw new IllegalStateException("You need to create a new GraphHopper instance as it is already closed");

        // default handling
        String vehicle = request.getVehicle();
        if (vehicle.isEmpty()) {
            vehicle = getDefaultVehicle().toString();
            request.setVehicle(vehicle);
        }

        Lock readLock = readWriteLock.readLock();
        readLock.lock();
        try {
            if (!encodingManager.hasEncoder(vehicle))
                throw new IllegalArgumentException("Vehicle not supported: " + vehicle + ". Supported are: " + encodingManager.toString());

            HintsMap hints = request.getHints();
            String tModeStr = hints.get("traversal_mode", traversalMode.toString());
            TraversalMode tMode = TraversalMode.fromString(tModeStr);
            if (hints.has(Routing.EDGE_BASED))
                tMode = hints.getBool(Routing.EDGE_BASED, false) ? TraversalMode.EDGE_BASED_2DIR : TraversalMode.NODE_BASED;

            FlagEncoder encoder = encodingManager.getEncoder(vehicle);

            boolean disableCH = hints.getBool(CH.DISABLE, false);
            if (!chFactoryDecorator.isDisablingAllowed() && disableCH)
                throw new IllegalArgumentException("Disabling CH not allowed on the server-side");

            boolean disableLM = hints.getBool(Landmark.DISABLE, false);
            if (!lmFactoryDecorator.isDisablingAllowed() && disableLM)
                throw new IllegalArgumentException("Disabling LM not allowed on the server-side");

            String algoStr = request.getAlgorithm();
            if (algoStr.isEmpty())
                algoStr = chFactoryDecorator.isEnabled() && !disableCH ? DIJKSTRA_BI : ASTAR_BI;

            List<GHPoint> points = request.getPoints();
            // TODO Maybe we should think about a isRequestValid method that checks all that stuff that we could do to fail fast
            // For example see #734
            checkIfPointsAreInBounds(points);

            RoutingTemplate routingTemplate;
            if (ROUND_TRIP.equalsIgnoreCase(algoStr))
                routingTemplate = new RoundTripRoutingTemplate(request, ghRsp, locationIndex, encodingManager, maxRoundTripRetries);
            else if (ALT_ROUTE.equalsIgnoreCase(algoStr))
                routingTemplate = new AlternativeRoutingTemplate(request, ghRsp, locationIndex, encodingManager);
            else
                routingTemplate = new ViaRoutingTemplate(request, ghRsp, locationIndex, encodingManager);

            List<Path> altPaths = null;
            int maxRetries = routingTemplate.getMaxRetries();
            Locale locale = request.getLocale();
            Translation tr = trMap.getWithFallBack(locale);
            for (int i = 0; i < maxRetries; i++) {
                StopWatch sw = new StopWatch().start();
                List<QueryResult> qResults = routingTemplate.lookup(points, encoder);
                ghRsp.addDebugInfo("idLookup:" + sw.stop().getSeconds() + "s");
                if (ghRsp.hasErrors())
                    return Collections.emptyList();

                RoutingAlgorithmFactory tmpAlgoFactory = getAlgorithmFactory(hints);
                Weighting weighting;
                QueryGraph queryGraph;

                if (chFactoryDecorator.isEnabled() && !disableCH) {
                    boolean forceCHHeading = hints.getBool(CH.FORCE_HEADING, false);
                    if (!forceCHHeading && request.hasFavoredHeading(0))
                        throw new IllegalArgumentException("Heading is not (fully) supported for CHGraph. See issue #483");

                    // if LM is enabled we have the LMFactory with the CH algo!
                    RoutingAlgorithmFactory chAlgoFactory = tmpAlgoFactory;
                    if (tmpAlgoFactory instanceof LMAlgoFactoryDecorator.LMRAFactory)
                        chAlgoFactory = ((LMAlgoFactoryDecorator.LMRAFactory) tmpAlgoFactory).getDefaultAlgoFactory();

                    if (chAlgoFactory instanceof PrepareContractionHierarchies)
                        weighting = ((PrepareContractionHierarchies) chAlgoFactory).getWeighting();
                    else
                        throw new IllegalStateException("Although CH was enabled a non-CH algorithm factory was returned " + tmpAlgoFactory);

                    queryGraph = new QueryGraph(ghStorage.getGraph(CHGraph.class, weighting));
                    queryGraph.lookup(qResults);
                } else {
                    checkNonChMaxWaypointDistance(points);
                    queryGraph = new QueryGraph(ghStorage);
                    queryGraph.lookup(qResults);
                    weighting = createWeighting(hints, encoder, queryGraph);
                }
                ghRsp.addDebugInfo("tmode:" + tMode.toString());

                int maxVisitedNodesForRequest = hints.getInt(Routing.MAX_VISITED_NODES, maxVisitedNodes);
                if (maxVisitedNodesForRequest > maxVisitedNodes)
                    throw new IllegalArgumentException("The max_visited_nodes parameter has to be below or equal to:" + maxVisitedNodes);

                weighting = createTurnWeighting(queryGraph, weighting, tMode);

                AlgorithmOptions algoOpts = AlgorithmOptions.start().
                        algorithm(algoStr).traversalMode(tMode).weighting(weighting).
                        maxVisitedNodes(maxVisitedNodesForRequest).
                        hints(hints).
                        build();

                // do the actual route calculation !
                altPaths = routingTemplate.calcPaths(queryGraph, tmpAlgoFactory, algoOpts);

                boolean tmpEnableInstructions = hints.getBool(Routing.INSTRUCTIONS, getEncodingManager().isEnableInstructions());
                boolean tmpCalcPoints = hints.getBool(Routing.CALC_POINTS, calcPoints);
                double wayPointMaxDistance = hints.getDouble(Routing.WAY_POINT_MAX_DISTANCE, 1d);

                DouglasPeucker peucker = new DouglasPeucker().setMaxDistance(wayPointMaxDistance);
                PathMerger pathMerger = new PathMerger().
                        setCalcPoints(tmpCalcPoints).
                        setDouglasPeucker(peucker).
                        setEnableInstructions(tmpEnableInstructions).
                        setPathDetailsBuilders(pathBuilderFactory, request.getPathDetails()).
                        setSimplifyResponse(simplifyResponse && wayPointMaxDistance > 0);

                if (request.hasFavoredHeading(0))
                    pathMerger.setFavoredHeading(request.getFavoredHeading(0));

                if (routingTemplate.isReady(pathMerger, tr))
                    break;
            }

            return altPaths;

        } catch (IllegalArgumentException ex) {
            ghRsp.addError(ex);
            return Collections.emptyList();
        } finally {
            readLock.unlock();
        }
    }
778808
private static ImmutableList<String> computePathPrefixes(String path) {
    List<String> pieces = Q_NAME_SPLITTER.splitToList(path);
    ImmutableList.Builder<String> pathPrefixes = ImmutableList.builder();

    String partial = pieces.get(0); // There will always be at least 1.
    pathPrefixes.add(partial);
    for (int i = 1; i < pieces.size(); i++) {
      partial = Q_NAME_JOINER.join(partial, pieces.get(i));
      pathPrefixes.add(partial);
    }

    return pathPrefixes.build();
  }
239511
private static String matchPathLists(List<String> basePath, List<String> filePath) {
        // start at the beginning of the lists
        // iterate while both lists are equal
        final StringBuilder relativePath = new StringBuilder();
        final ListIterator<String> basePathItr = basePath.listIterator(basePath.size() - 1);
        final ListIterator<String> filePathItr = filePath.listIterator(filePath.size() - 1);
        
        // first eliminate common root elements
        while (basePathItr.hasPrevious() && filePathItr.hasPrevious()) {
            if (!basePathItr.previous().equals(filePathItr.previous())) {
                basePathItr.next();
                filePathItr.next();
                break;
            }
        }

        // for each remaining level in the home path, add a ..
        for (; basePathItr.hasPrevious(); basePathItr.previous()) {
            relativePath.append("..").append(File.separator);
        }

        // for each level in the file path, add the path
        while (filePathItr.hasPrevious()) {
            relativePath.append(filePathItr.previous());
            if (filePathItr.hasPrevious()) {
                relativePath.append(File.separator);
            }
        }

        return relativePath.toString();
    }
822457
public List<String> getPaths() {
        final List<String> resourcePaths = new ArrayList<>(this.size());
        for (final Resource resource : this) {
            resourcePaths.add(resource.getPath());
        }
        return resourcePaths;
    }
673149
def update_paths(self):
        
        new_paths = []
        with self.lock:
            for path in expand_source_paths(iter_module_paths()):
                if path not in self.paths:
                    self.paths.add(path)
                    new_paths.append(path)
        if new_paths:
            self.watch_paths(new_paths)
1313872
public List<Alternatives<Beans<T>>> getAllAlternatives()
   {
      List<Alternatives<Beans<T>>> list = new ArrayList<Alternatives<Beans<T>>>();
      List<Node> nodeList = childNode.get("alternatives");
      for(Node node: nodeList)
      {
         Alternatives<Beans<T>>  type = new AlternativesImpl<Beans<T>>(this, "alternatives", childNode, node);
         list.add(type);
      }
      return list;
   }
807300
function movePaths(paths, x, y) {
            var bound = computeBoundingBox.computePath.apply(null, paths);
            paths.forEach(function (path) {
                pathAdjust(path, 1, 1, x - bound.x, y - bound.y);
            });

            return paths;
        }
904886
def alternates=(alts)
      alts.each do |alt|
        unless File.exist?(alt)
          raise "Could not set alternates. Alternate path #{alt} must exist"
        end
      end

      if alts.empty?
        self.git.fs_write('objects/info/alternates', '')
      else
        self.git.fs_write('objects/info/alternates', alts.join("\n"))
      end
    end
1194335
def key_paths
      trees.reduce(Set.new) { |result, tree| result.merge(tree.key_paths) }
    end
1249173
def paths2edges(paths):
    
    edges_all = set()
    for path in paths:
        for edge in path2edges(path):
            edges_all.add(edge)
    return edges_all
1191028
def visit_alternative(alternativeNd)
      broadcast(:before_alternative, alternativeNd)
      unless alternativeNd.signature_exist?
        alternativeNd.add_edge_signatures(prime_enum)
      end

      traverse_children(alternativeNd)
      broadcast(:after_alternative, alternativeNd)
    end
754313
def path_args(self):
        """"""
        self._path_args = []
        path = self.path
        path_args = list(filter(None, path.split('/')))
        return path_args
164905
private Map<Path, FileStatus> listEligibleFiles(FileSystem fileSystem, Path path) throws IOException {

		final FileStatus[] statuses;
		try {
			statuses = fileSystem.listStatus(path);
		} catch (IOException e) {
			// we may run into an IOException if files are moved while listing their status
			// delay the check for eligible files in this case
			return Collections.emptyMap();
		}

		if (statuses == null) {
			LOG.warn("Path does not exist: {}", path);
			return Collections.emptyMap();
		} else {
			Map<Path, FileStatus> files = new HashMap<>();
			// handle the new files
			for (FileStatus status : statuses) {
				if (!status.isDir()) {
					Path filePath = status.getPath();
					long modificationTime = status.getModificationTime();
					if (!shouldIgnore(filePath, modificationTime)) {
						files.put(filePath, status);
					}
				} else if (format.getNestedFileEnumeration() && format.acceptFile(status)){
					files.putAll(listEligibleFiles(fileSystem, status.getPath()));
				}
			}
			return files;
		}
	}
842023
private static String matchPathLists(List<String> r,List<String> f) {
		int i;
		int j;
		String s;
		// start at the beginning of the lists
		// iterate while both lists are equal
		s = "";
		i = r.size()-1;
		j = f.size()-1;

		// first eliminate common root
		while((i >= 0)&&(j >= 0)&&(r.get(i).equals(f.get(j)))) {
			i--;
			j--;
		}

		// for each remaining level in the home path, add a ..
		for(;i>=0;i--) {
			s += ".." + File.separator;
		}

		// for each level in the file path, add the path
		for(;j>=1;j--) {
			s += f.get(j) + File.separator;
		}

		// file name
		s += f.get(j);
		return s;
	}
1370077
@Override
	public List<PlanNode> getAlternativePlans(CostEstimator estimator) {
		// check if we have a cached version
		if (this.cachedPlans != null) {
			return this.cachedPlans;
		}
		
		// calculate alternative sub-plans for predecessor
		List<? extends PlanNode> subPlans = getPredecessorNode().getAlternativePlans(estimator);
		List<PlanNode> outputPlans = new ArrayList<PlanNode>();
		
		final int dop = getDegreeOfParallelism();
		final int subPerInstance = getSubtasksPerInstance();
		final int inDop = getPredecessorNode().getDegreeOfParallelism();
		final int inSubPerInstance = getPredecessorNode().getSubtasksPerInstance();
		final int numInstances = dop / subPerInstance + (dop % subPerInstance == 0 ? 0 : 1);
		final int inNumInstances = inDop / inSubPerInstance + (inDop % inSubPerInstance == 0 ? 0 : 1);
		
		final boolean globalDopChange = numInstances != inNumInstances;
		final boolean localDopChange = numInstances == inNumInstances & subPerInstance != inSubPerInstance;
		
		InterestingProperties ips = this.input.getInterestingProperties();
		for (PlanNode p : subPlans) {
			for (RequestedGlobalProperties gp : ips.getGlobalProperties()) {
				for (RequestedLocalProperties lp : ips.getLocalProperties()) {
					Channel c = new Channel(p);
					gp.parameterizeChannel(c, globalDopChange, localDopChange);

					if (lp.isMetBy(c.getLocalPropertiesAfterShippingOnly())) {
						c.setLocalStrategy(LocalStrategy.NONE);
					} else {
						lp.parameterizeChannel(c);
					}
					
					// no need to check whether the created properties meet what we need in case
					// of ordering or global ordering, because the only interesting properties we have
					// are what we require
					outputPlans.add(new SinkPlanNode(this, "DataSink("+this.getPactContract().getName()+")" ,c));
				}
			}
		}
		
		// cost and prune the plans
		for (PlanNode node : outputPlans) {
			estimator.costOperator(node);
		}
		prunePlanAlternatives(outputPlans);

		this.cachedPlans = outputPlans;
		return outputPlans;
	}
651160
def calculate_leaf_paths(self):
        
        reverse_xref = {}
        leaves = set()
        for v in self.value.values():
            if v.leaf:
                leaves.add(v)
            for xref in v.value_xref:
                reverse_xref.setdefault(xref, []).append(v.ident)
        for leaf in leaves:
            self.calculate_leaf_path(leaf, reverse_xref)
22225
public List<AlternativeInfo> calcAlternatives(int from, int to) {
        AlternativeBidirSearch altBidirDijktra = new AlternativeBidirSearch(
                graph, weighting, traversalMode, maxExplorationFactor * 2);
        altBidirDijktra.setMaxVisitedNodes(maxVisitedNodes);
        if (weightApproximator != null) {
            altBidirDijktra.setApproximation(weightApproximator);
        }

        altBidirDijktra.searchBest(from, to);
        visitedNodes = altBidirDijktra.getVisitedNodes();

        List<AlternativeInfo> alternatives = altBidirDijktra.
                calcAlternatives(maxPaths, maxWeightFactor, 7, maxShareFactor, 0.8, minPlateauFactor, -0.2);
        return alternatives;
    }