@SuppressWarnings("unchecked") public Path calcLeastCostPath(final Map<Node, InitialNode> fromNodes, final Map<Node, InitialNode> toNodes, final Person person) { Map<Node, InitialNode> swapedToNodes = swapNodes(toNodes); TransitLeastCostPathTree tree = new TransitLeastCostPathTree(network, costFunction, timeFunction, swapNodes(fromNodes), swapedToNodes, person); return tree.getPath(swapedToNodes); }