1// Copyright 2010-2024 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
6// http://www.apache.org/licenses/LICENSE-2.0
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
14// Protocol buffer used to parametrize an iterated local search (ILS) approach.
15// ILS is an iterative metaheuristic in which every iteration consists in
16// performing a perturbation followed by an improvement step on a reference
17// solution to generate a neighbor solution.
18// The neighbor solution is accepted as the new reference solution according
19// to an acceptance criterion.
20// The best found solution is eventually returned.
24import "ortools/constraint_solver/routing_enums.proto";
26package operations_research;
28// Ruin strategies, used in perturbation based on ruin and recreate approaches.
34 // Removes a number of spatially close routes.
35 SPATIALLY_CLOSE_ROUTES_REMOVAL = 1;
39// Parameters to configure a perturbation based on a ruin and recreate approach.
40message RuinRecreateParameters {
41 // Strategy defining how a reference solution is ruined.
42 RuinStrategy.Value ruin_strategy = 1;
44 // Strategy defining how a reference solution is recreated.
45 FirstSolutionStrategy.Value recreate_strategy = 2;
47 // Number of routes removed during a ruin application defined on routes.
48 uint32 num_ruined_routes = 3;
51// Defines how a reference solution is perturbed.
52message PerturbationStrategy {
57 // Performs a perturbation in a ruin and recreate fashion.
58 RUIN_AND_RECREATE = 1;
62// Determines when a neighbor solution, obtained by the application of a
63// perturbation and improvement step to a reference solution, is used to
64// replace the reference solution.
65message AcceptanceStrategy {
70 // Accept only solutions that are improving with respect to the reference
76// Specifies the behavior of a search based on ILS.
77message IteratedLocalSearchParameters {
78 // Determines how a reference solution S is perturbed to obtain a neighbor
80 PerturbationStrategy.Value perturbation_strategy = 1;
82 // Parameters to customize a ruin and recreate perturbation.
83 RuinRecreateParameters ruin_recreate_parameters = 2;
85 // Determines whether solution S', obtained from the perturbation, should be
86 // optimized with a local search application.
87 bool improve_perturbed_solution = 3;
89 // Determines when the neighbor solution S', possibly improved if
90 // `improve_perturbed_solution` is true, replaces the reference solution S.
91 AcceptanceStrategy.Value acceptance_strategy = 4;