Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <routing_search.h>
Public Member Functions | |
ChristofidesFilteredHeuristic (RoutingModel *model, std::function< bool()> stop_search, LocalSearchFilterManager *filter_manager, bool use_minimum_matching) | |
ChristofidesFilteredHeuristic. | |
~ChristofidesFilteredHeuristic () override | |
bool | BuildSolutionInternal () override |
std::string | DebugString () const override |
Public Member Functions inherited from operations_research::RoutingFilteredHeuristic | |
RoutingFilteredHeuristic (RoutingModel *model, std::function< bool()> stop_search, LocalSearchFilterManager *filter_manager) | |
RoutingFilteredHeuristic. | |
~RoutingFilteredHeuristic () override | |
Assignment * | BuildSolutionFromRoutes (const std::function< int64_t(int64_t)> &next_accessor) |
Builds a solution starting from the routes formed by the next accessor. | |
RoutingModel * | model () const |
int | GetStartChainEnd (int vehicle) const |
Returns the end of the start chain of vehicle,. | |
int | GetEndChainStart (int vehicle) const |
Returns the start of the end chain of vehicle,. | |
void | MakeDisjunctionNodesUnperformed (int64_t node) |
bool | MakeUnassignedNodesUnperformed () |
Make all unassigned nodes unperformed, always returns true. | |
void | MakePartiallyPerformedPairsUnperformed () |
Public Member Functions inherited from operations_research::IntVarFilteredHeuristic | |
IntVarFilteredHeuristic (Solver *solver, const std::vector< IntVar * > &vars, const std::vector< IntVar * > &secondary_vars, LocalSearchFilterManager *filter_manager) | |
— First solution heuristics — | |
virtual | ~IntVarFilteredHeuristic () |
Assignment * | BuildSolution () |
int64_t | number_of_decisions () const |
int64_t | number_of_rejects () const |
Additional Inherited Members | |
Protected Member Functions inherited from operations_research::RoutingFilteredHeuristic | |
bool | StopSearch () override |
Returns true if the search must be stopped. | |
virtual void | SetVehicleIndex (int64_t, int) |
virtual void | ResetVehicleIndices () |
bool | VehicleIsEmpty (int vehicle) const |
void | SetNext (int64_t node, int64_t next, int vehicle) |
Protected Member Functions inherited from operations_research::IntVarFilteredHeuristic | |
void | ResetSolution () |
Resets the data members for a new solution. | |
virtual void | Initialize () |
Initialize the heuristic; called before starting to build a new solution. | |
std::optional< int64_t > | Evaluate (bool commit) |
void | SetValue (int64_t index, int64_t value) |
const std::vector< int > & | delta_indices () const |
Returns the indices of the nodes currently in the insertion delta. | |
int64_t | Value (int64_t index) const |
bool | Contains (int64_t index) const |
Returns true if the variable of index 'index' is in the current solution. | |
IntVar * | Var (int64_t index) const |
Returns the variable of index 'index'. | |
int64_t | SecondaryVarIndex (int64_t index) const |
Returns the index of a secondary var. | |
bool | HasSecondaryVars () const |
Returns true if there are secondary variables. | |
bool | IsSecondaryVar (int64_t index) const |
Returns true if 'index' is a secondary variable index. | |
void | SynchronizeFilters () |
Synchronizes filters with an assignment (the current solution). | |
Protected Attributes inherited from operations_research::IntVarFilteredHeuristic | |
Assignment *const | assignment_ |
Christofides addition heuristic. Initially created to solve TSPs, extended to support any model by extending routes as much as possible following the path found by the heuristic, before starting a new route.
Definition at line 1413 of file routing_search.h.
operations_research::ChristofidesFilteredHeuristic::ChristofidesFilteredHeuristic | ( | RoutingModel * | model, |
std::function< bool()> | stop_search, | ||
LocalSearchFilterManager * | filter_manager, | ||
bool | use_minimum_matching ) |
ChristofidesFilteredHeuristic.
Definition at line 4075 of file routing_search.cc.
|
inlineoverride |
Definition at line 1419 of file routing_search.h.
|
overridevirtual |
Node indices for Christofides solver. 0: start/end node >0: non start/end nodes
To avoid overflow issues, capping costs at kint64max/2, the maximum value supported by MinCostPerfectMatching.
Extend route from start.
Implements operations_research::IntVarFilteredHeuristic.
Definition at line 4082 of file routing_search.cc.
|
inlineoverridevirtual |
Reimplemented from operations_research::IntVarFilteredHeuristic.
Definition at line 1421 of file routing_search.h.