41 absl::Span<const ArcWithLengthAndResources> arcs_with_length_and_resources,
42 int source,
int destination,
const std::vector<double>& max_resources) {
45 using ArcIndex = GraphType::ArcIndex;
47 const int num_arcs = arcs_with_length_and_resources.
size();
48 GraphType
graph(num_nodes, num_arcs);
51 std::vector<std::vector<double>> arc_resources(max_resources.size());
52 for (
int i = 0; i < max_resources.size(); ++i) {
53 arc_resources[i].reserve(num_arcs);
55 for (
const auto&
arc : arcs_with_length_and_resources) {
58 for (
int i = 0; i <
arc.resources.size(); ++i) {
59 arc_resources[i].push_back(
arc.resources[i]);
63 std::vector<ArcIndex> permutation;
64 graph.Build(&permutation);
66 for (
int i = 0; i < max_resources.size(); ++i) {
70 std::vector<ArcIndex> inverse_permutation =
77 std::vector<NodeIndex> sources = {source};
78 std::vector<NodeIndex> destinations = {destination};
82 destinations, &max_resources);
87 ApplyMapping(inverse_permutation, path_with_length.
arc_path);
89 return path_with_length;