14#ifndef OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_UTILS_H_
15#define OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_UTILS_H_
22#include "absl/types/span.h"
31 : num_bins_(num_bins),
32 load_per_bin_(num_bins),
33 load_limits_per_bin_(num_bins),
50 std::function<int64_t(
int,
int)> load_demand_of_item_for_bin,
51 std::vector<LoadLimit> load_limit_per_bin);
52 int NumDimensions()
const {
return load_demands_per_dimension_.size(); }
72 std::vector<std::vector<int64_t>> load_per_bin_;
74 std::vector<std::vector<LoadLimit>> load_limits_per_bin_;
76 std::vector<std::function<int64_t(
int,
int)>> load_demands_per_dimension_;
84 int num_arcs, int64_t start,
85 const std::function<int64_t(int64_t)>& next_accessor,
86 const std::function<
bool(int64_t)>& is_end,
87 const std::function<int64_t(int64_t, int64_t, int64_t)>&
88 arc_cost_for_route_start,
89 std::vector<std::pair<int64_t, int>>* most_expensive_arc_starts_and_ranks,
90 std::pair<int, int>* first_expensive_arc_indices);
BinCapacities(int num_bins)
void ClearItems()
Removes all items from all bins.
bool RemoveItemFromBin(int item, int bin)
Removes item from bin, return whether the bin is feasible.
void AddDimension(std::function< int64_t(int, int)> load_demand_of_item_for_bin, std::vector< LoadLimit > load_limit_per_bin)
void ClearItemsOfBin(int bin)
Removes all items from given bin, resets the total cost.
bool CheckAdditionFeasibility(int item, int bin) const
Checks whether adding item(s) is feasible w.r.t. dimensions.
int64_t TotalCost() const
Returns the total cost incurred by violating soft costs.
int NumDimensions() const
bool AddItemToBin(int item, int bin)
bool CheckAdditionsFeasibility(absl::Span< const int > items, int bin) const
In SWIG mode, we don't want anything besides these top-level includes.
bool FindMostExpensiveArcsOnRoute(int num_arcs, int64_t start, const std::function< int64_t(int64_t)> &next_accessor, const std::function< bool(int64_t)> &is_end, const std::function< int64_t(int64_t, int64_t, int64_t)> &arc_cost_for_route_start, std::vector< std::pair< int64_t, int > > *most_expensive_arc_starts_and_ranks, std::pair< int, int > *first_expensive_arc_indices)
int64_t cost_above_soft_max_load