Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
routing_parameters.proto
Go to the documentation of this file.
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
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
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.
13
14// Protocol buffer used to parametrize the routing library, in particular the
15// search parameters such as first solution heuristics and local search
16// neighborhoods.
17
18syntax = "proto3";
19
20option java_package = "com.google.ortools.constraintsolver";
21option java_multiple_files = true;
22option csharp_namespace = "Google.OrTools.ConstraintSolver";
23
24import "google/protobuf/duration.proto";
25import "ortools/constraint_solver/routing_enums.proto";
26import "ortools/constraint_solver/routing_ils.proto";
27import "ortools/constraint_solver/solver_parameters.proto";
28import "ortools/sat/sat_parameters.proto";
29import "ortools/util/optional_boolean.proto";
30
31package operations_research;
32
33// Parameters defining the search used to solve vehicle routing problems.
34//
35// If a parameter is unset (or, equivalently, set to its default value),
36// then the routing library will pick its preferred value for that parameter
37// automatically: this should be the case for most parameters.
38// To see those "default" parameters, call GetDefaultRoutingSearchParameters().
39// Next ID: 61
40message RoutingSearchParameters {
41 // First solution strategies, used as starting point of local search.
42 FirstSolutionStrategy.Value first_solution_strategy = 1;
43
44 // --- Advanced first solutions strategy settings ---
45 // Don't touch these unless you know what you are doing.
46 //
47 // Use filtered version of first solution strategy if available.
48 bool use_unfiltered_first_solution_strategy = 2;
49 // Parameters specific to the Savings first solution heuristic.
50 // Ratio (in ]0, 1]) of neighbors to consider for each node when constructing
51 // the savings. If unspecified, its value is considered to be 1.0.
52 double savings_neighbors_ratio = 14;
53 // The number of neighbors considered for each node in the Savings heuristic
54 // is chosen so that the space used to store the savings doesn't exceed
55 // savings_max_memory_usage_bytes, which must be in ]0, 1e10].
56 // NOTE: If both savings_neighbors_ratio and savings_max_memory_usage_bytes
57 // are specified, the number of neighbors considered for each node will be the
58 // minimum of the two numbers determined by these parameters.
59 double savings_max_memory_usage_bytes = 23;
60 // Add savings related to reverse arcs when finding the nearest neighbors
61 // of the nodes.
62 bool savings_add_reverse_arcs = 15;
63 // Coefficient of the cost of the arc for which the saving value is being
64 // computed:
65 // Saving(a-->b) = Cost(a-->end) + Cost(start-->b)
66 // - savings_arc_coefficient * Cost(a-->b)
67 // This parameter must be greater than 0, and its default value is 1.
68 double savings_arc_coefficient = 18;
69 // When true, the routes are built in parallel, sequentially otherwise.
70 bool savings_parallel_routes = 19;
71
72 // Ratio (between 0 and 1) of available vehicles in the model on which
73 // farthest nodes of the model are inserted as seeds in the
74 // GlobalCheapestInsertion first solution heuristic.
75 double cheapest_insertion_farthest_seeds_ratio = 16;
76
77 // Ratio (in ]0, 1]) of closest non start/end nodes to consider as neighbors
78 // for each node when creating new insertions in the parallel/sequential
79 // cheapest insertion heuristic.
80 // If not overridden, its default value is 1, meaning all neighbors will be
81 // considered.
82 // The neighborhood ratio is coupled with the corresponding min_neighbors
83 // integer, indicating the minimum number of neighbors to consider for each
84 // node:
85 // num_closest_neighbors =
86 // max(min_neighbors, neighbors_ratio * NUM_NON_START_END_NODES)
87 // This minimum number of neighbors must be greater or equal to 1, its
88 // default value.
89 //
90 // Neighbors ratio and minimum number of neighbors for the first solution
91 // heuristic.
92 double cheapest_insertion_first_solution_neighbors_ratio = 21;
93 int32 cheapest_insertion_first_solution_min_neighbors = 44;
94 // Neighbors ratio and minimum number of neighbors for the heuristic when used
95 // in a local search operator (see
96 // local_search_operators.use_global_cheapest_insertion_path_lns and
97 // local_search_operators.use_global_cheapest_insertion_chain_lns below).
98 double cheapest_insertion_ls_operator_neighbors_ratio = 31;
99 int32 cheapest_insertion_ls_operator_min_neighbors = 45;
100
101 // Whether or not to only consider closest neighbors when initializing the
102 // assignment for the first solution.
103 bool
104 cheapest_insertion_first_solution_use_neighbors_ratio_for_initialization =
105 46;
106 // Whether or not to consider entries making the nodes/pairs unperformed in
107 // the GlobalCheapestInsertion heuristic.
108 bool cheapest_insertion_add_unperformed_entries = 40;
109
110 // In insertion-based heuristics, describes what positions must be considered
111 // when inserting a pickup/delivery pair, and in what order they are
112 // considered.
113 enum PairInsertionStrategy {
114 // Let the solver decide the set of positions and its ordering.
115 AUTOMATIC = 0;
116 // Consider all positions, by increasing (cost(pickup), cost(delivery)).
117 BEST_PICKUP_THEN_BEST_DELIVERY = 1;
118 // Consider all positions, by increasing by cost(pickup) + cost(delivery).
119 BEST_PICKUP_DELIVERY_PAIR = 2;
120 // Only consider insertion positions that are compatible with the multitour
121 // property, meaning a series of pickups may only start when the vehicle
122 // is not carrying any delivery. This setting is designed to explore much
123 // less possibilities than the full BEST_PICKUP_DELIVERY_PAIR.
124 // Order by increasing by cost(pickup) + cost(delivery).
125 BEST_PICKUP_DELIVERY_PAIR_MULTITOUR = 3;
126 }
127 // Choice of insertion strategy for pickup/delivery pairs, used in local
128 // cheapest insertion, both first solution heuristic and LNS.
129 PairInsertionStrategy local_cheapest_insertion_pickup_delivery_strategy = 49;
130 // Choice of insertion strategy for pickup/delivery pairs, used in local
131 // cheapest cost insertion, both first solution heuristic and LNS.
132 PairInsertionStrategy local_cheapest_cost_insertion_pickup_delivery_strategy =
133 55;
134
135 // If true use minimum matching instead of minimal matching in the
136 // Christofides algorithm.
137 bool christofides_use_minimum_matching = 30;
138
139 // If non zero, a period p indicates that every p node insertions or additions
140 // to a path, an optimization of the current partial solution will be
141 // performed. As of 12/2023:
142 // - this requires that a secondary routing model has been passed to the main
143 // one,
144 // - this is only supported by LOCAL_CHEAPEST_INSERTION and
145 // LOCAL_CHEAPEST_COST_INSERTION.
146 int32 first_solution_optimization_period = 59;
147
148 // Local search neighborhood operators used to build a solutions neighborhood.
149 // Next ID: 35
150 message LocalSearchNeighborhoodOperators {
151 // --- Inter-route operators ---
152 // Operator which moves a single node to another position.
153 // Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5
154 // (where (1, 5) are first and last nodes of the path and can therefore not
155 // be moved):
156 // 1 -> 3 -> [2] -> 4 -> 5
157 // 1 -> 3 -> 4 -> [2] -> 5
158 // 1 -> 2 -> 4 -> [3] -> 5
159 // 1 -> [4] -> 2 -> 3 -> 5
160 OptionalBoolean use_relocate = 1;
161 // Operator which moves a pair of pickup and delivery nodes to another
162 // position where the first node of the pair must be before the second node
163 // on the same path. Compared to the light_relocate_pair operator, tries all
164 // possible positions of insertion of a pair (not only after another pair).
165 // Possible neighbors for the path 1 -> A -> B -> 2 -> 3 (where (1, 3) are
166 // first and last nodes of the path and can therefore not be moved, and
167 // (A, B) is a pair of nodes):
168 // 1 -> [A] -> 2 -> [B] -> 3
169 // 1 -> 2 -> [A] -> [B] -> 3
170 OptionalBoolean use_relocate_pair = 2;
171 // Operator which moves a pair of pickup and delivery nodes after another
172 // pair.
173 // Possible neighbors for paths 1 -> A -> B -> 2, 3 -> C -> D -> 4 (where
174 // (1, 2) and (3, 4) are first and last nodes of paths and can therefore not
175 // be moved, and (A, B) and (C, D) are pair of nodes):
176 // 1 -> 2, 3 -> C -> [A] -> D -> [B] -> 4
177 // 1 -> A -> [C] -> B -> [D] -> 2, 3 -> 4
178 OptionalBoolean use_light_relocate_pair = 24;
179 // Relocate neighborhood which moves chains of neighbors.
180 // The operator starts by relocating a node n after a node m, then continues
181 // moving nodes which were after n as long as the "cost" added is less than
182 // the "cost" of the arc (m, n). If the new chain doesn't respect the domain
183 // of next variables, it will try reordering the nodes until it finds a
184 // valid path.
185 // Possible neighbors for path 1 -> A -> B -> C -> D -> E -> 2 (where (1, 2)
186 // are first and last nodes of the path and can therefore not be moved, A
187 // must be performed before B, and A, D and E are located at the same
188 // place):
189 // 1 -> A -> C -> [B] -> D -> E -> 2
190 // 1 -> A -> C -> D -> [B] -> E -> 2
191 // 1 -> A -> C -> D -> E -> [B] -> 2
192 // 1 -> A -> B -> D -> [C] -> E -> 2
193 // 1 -> A -> B -> D -> E -> [C] -> 2
194 // 1 -> A -> [D] -> [E] -> B -> C -> 2
195 // 1 -> A -> B -> [D] -> [E] -> C -> 2
196 // 1 -> A -> [E] -> B -> C -> D -> 2
197 // 1 -> A -> B -> [E] -> C -> D -> 2
198 // 1 -> A -> B -> C -> [E] -> D -> 2
199 // This operator is extremely useful to move chains of nodes which are
200 // located at the same place (for instance nodes part of a same stop).
201 OptionalBoolean use_relocate_neighbors = 3;
202 // Relocate neighborhood that moves subpaths all pickup and delivery
203 // pairs have both pickup and delivery inside the subpath or both outside
204 // the subpath. For instance, for given paths:
205 // 0 -> A -> B -> A' -> B' -> 5 -> 6 -> 8
206 // 7 -> 9
207 // Pairs (A,A') and (B,B') are interleaved, so the expected neighbors are:
208 // 0 -> 5 -> A -> B -> A' -> B' -> 6 -> 8
209 // 7 -> 9
210 //
211 // 0 -> 5 -> 6 -> A -> B -> A' -> B' -> 8
212 // 7 -> 9
213 //
214 // 0 -> 5 -> 6 -> 8
215 // 7 -> A -> B -> A' -> B' -> 9
216 OptionalBoolean use_relocate_subtrip = 25;
217 // Operator which exchanges the positions of two nodes.
218 // Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5
219 // (where (1, 5) are first and last nodes of the path and can therefore not
220 // be moved):
221 // 1 -> [3] -> [2] -> 4 -> 5
222 // 1 -> [4] -> 3 -> [2] -> 5
223 // 1 -> 2 -> [4] -> [3] -> 5
224 OptionalBoolean use_exchange = 4;
225 // Operator which exchanges the positions of two pair of nodes. Pairs
226 // correspond to the pickup and delivery pairs defined in the routing model.
227 // Possible neighbor for the paths
228 // 1 -> A -> B -> 2 -> 3 and 4 -> C -> D -> 5
229 // (where (1, 3) and (4, 5) are first and last nodes of the paths and can
230 // therefore not be moved, and (A, B) and (C,D) are pairs of nodes):
231 // 1 -> [C] -> [D] -> 2 -> 3, 4 -> [A] -> [B] -> 5
232 OptionalBoolean use_exchange_pair = 22;
233 // Operator which exchanges subtrips associated to two pairs of nodes,
234 // see use_relocate_subtrip for a definition of subtrips.
235 OptionalBoolean use_exchange_subtrip = 26;
236 // Operator which cross exchanges the starting chains of 2 paths, including
237 // exchanging the whole paths.
238 // First and last nodes are not moved.
239 // Possible neighbors for the paths 1 -> 2 -> 3 -> 4 -> 5 and 6 -> 7 -> 8
240 // (where (1, 5) and (6, 8) are first and last nodes of the paths and can
241 // therefore not be moved):
242 // 1 -> [7] -> 3 -> 4 -> 5 6 -> [2] -> 8
243 // 1 -> [7] -> 4 -> 5 6 -> [2 -> 3] -> 8
244 // 1 -> [7] -> 5 6 -> [2 -> 3 -> 4] -> 8
245 OptionalBoolean use_cross = 5;
246 // Not implemented yet. TODO(b/68128619): Implement.
247 OptionalBoolean use_cross_exchange = 6;
248 // Operator which detects the relocate_expensive_chain_num_arcs_to_consider
249 // most expensive arcs on a path, and moves the chain resulting from cutting
250 // pairs of arcs among these to another position.
251 // Possible neighbors for paths 1 -> 2 (empty) and
252 // 3 -> A ------> B --> C -----> D -> 4 (where A -> B and C -> D are the 2
253 // most expensive arcs, and the chain resulting from breaking them is
254 // B -> C):
255 // 1 -> [B -> C] -> 2 3 -> A -> D -> 4
256 // 1 -> 2 3 -> [B -> C] -> A -> D -> 4
257 // 1 -> 2 3 -> A -> D -> [B -> C] -> 4
258 OptionalBoolean use_relocate_expensive_chain = 23;
259 // --- Intra-route operators ---
260 // Operator which reverses a subchain of a path. It is called TwoOpt
261 // because it breaks two arcs on the path; resulting paths are called
262 // two-optimal.
263 // Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5
264 // (where (1, 5) are first and last nodes of the path and can therefore not
265 // be moved):
266 // 1 -> [3 -> 2] -> 4 -> 5
267 // 1 -> [4 -> 3 -> 2] -> 5
268 // 1 -> 2 -> [4 -> 3] -> 5
269 OptionalBoolean use_two_opt = 7;
270 // Operator which moves sub-chains of a path of length 1, 2 and 3 to another
271 // position in the same path.
272 // When the length of the sub-chain is 1, the operator simply moves a node
273 // to another position.
274 // Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5, for a sub-chain
275 // length of 2 (where (1, 5) are first and last nodes of the path and can
276 // therefore not be moved):
277 // 1 -> 4 -> [2 -> 3] -> 5
278 // 1 -> [3 -> 4] -> 2 -> 5
279 // The OR_OPT operator is a limited version of 3-Opt (breaks 3 arcs on a
280 // path).
281 OptionalBoolean use_or_opt = 8;
282 // Lin-Kernighan operator.
283 // While the accumulated local gain is positive, performs a 2-OPT or a 3-OPT
284 // move followed by a series of 2-OPT moves. Returns a neighbor for which
285 // the global gain is positive.
286 OptionalBoolean use_lin_kernighan = 9;
287 // Sliding TSP operator.
288 // Uses an exact dynamic programming algorithm to solve the TSP
289 // corresponding to path sub-chains.
290 // For a subchain 1 -> 2 -> 3 -> 4 -> 5 -> 6, solves the TSP on
291 // nodes A, 2, 3, 4, 5, where A is a merger of nodes 1 and 6 such that
292 // cost(A,i) = cost(1,i) and cost(i,A) = cost(i,6).
293 OptionalBoolean use_tsp_opt = 10;
294 // --- Operators on inactive nodes ---
295 // Operator which inserts an inactive node into a path.
296 // Possible neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive
297 // (where 1 and 4 are first and last nodes of the path) are:
298 // 1 -> [5] -> 2 -> 3 -> 4
299 // 1 -> 2 -> [5] -> 3 -> 4
300 // 1 -> 2 -> 3 -> [5] -> 4
301 OptionalBoolean use_make_active = 11;
302 // Operator which relocates a node while making an inactive one active.
303 // As of 3/2017, the operator is limited to two kinds of moves:
304 // - Relocating a node and replacing it by an inactive node.
305 // Possible neighbor for path 1 -> 5, 2 -> 3 -> 6 and 4 inactive
306 // (where 1,2 and 5,6 are first and last nodes of paths) is:
307 // 1 -> 3 -> 5, 2 -> 4 -> 6.
308 // - Relocating a node and inserting an inactive node next to it.
309 // Possible neighbor for path 1 -> 5, 2 -> 3 -> 6 and 4 inactive
310 // (where 1,2 and 5,6 are first and last nodes of paths) is:
311 // 1 -> 4 -> 3 -> 5, 2 -> 6.
312 OptionalBoolean use_relocate_and_make_active = 21;
313 // Operator which makes path nodes inactive.
314 // Possible neighbors for the path 1 -> 2 -> 3 -> 4 (where 1 and 4 are first
315 // and last nodes of the path) are:
316 // 1 -> 3 -> 4 with 2 inactive
317 // 1 -> 2 -> 4 with 3 inactive
318 OptionalBoolean use_make_inactive = 12;
319 // Operator which makes a "chain" of path nodes inactive.
320 // Possible neighbors for the path 1 -> 2 -> 3 -> 4 (where 1 and 4 are first
321 // and last nodes of the path) are:
322 // 1 -> 3 -> 4 with 2 inactive
323 // 1 -> 2 -> 4 with 3 inactive
324 // 1 -> 4 with 2 and 3 inactive
325 OptionalBoolean use_make_chain_inactive = 13;
326 // Operator which replaces an active node by an inactive one.
327 // Possible neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive
328 // (where 1 and 4 are first and last nodes of the path) are:
329 // 1 -> [5] -> 3 -> 4 with 2 inactive
330 // 1 -> 2 -> [5] -> 4 with 3 inactive
331 OptionalBoolean use_swap_active = 14;
332 // Operator which makes an inactive node active and an active one inactive.
333 // It is similar to SwapActiveOperator excepts that it tries to insert the
334 // inactive node in all possible positions instead of just the position of
335 // the node made inactive.
336 // Possible neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive
337 // (where 1 and 4 are first and last nodes of the path) are:
338 // 1 -> [5] -> 3 -> 4 with 2 inactive
339 // 1 -> 3 -> [5] -> 4 with 2 inactive
340 // 1 -> [5] -> 2 -> 4 with 3 inactive
341 // 1 -> 2 -> [5] -> 4 with 3 inactive
342 OptionalBoolean use_extended_swap_active = 15;
343 // Swaps active nodes from node alternatives in sequence. Considers chains
344 // of nodes with alternatives, builds a DAG from the chain, each "layer" of
345 // the DAG being composed of the set of alternatives of the node at a given
346 // rank in the chain, fully connected to the next layer. A neighbor is built
347 // from the shortest path starting from the node before the chain (source),
348 // through the DAG to the node following the chain.
349 OptionalBoolean use_shortest_path_swap_active = 34;
350 // Operator which makes an inactive node active and an active pair of nodes
351 // inactive OR makes an inactive pair of nodes active and an active node
352 // inactive.
353 // Possible neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive
354 // (where 1 and 4 are first and last nodes of the path and (2,3) is a pair
355 // of nodes) are:
356 // 1 -> [5] -> 4 with (2,3) inactive
357 // Possible neighbors for the path 1 -> 2 -> 3 with (4,5) inactive
358 // (where 1 and 3 are first and last nodes of the path and (4,5) is a pair
359 // of nodes) are:
360 // 1 -> [4] -> [5] -> 3 with 2 inactive
361 OptionalBoolean use_node_pair_swap_active = 20;
362 // --- Large neighborhood search operators ---
363 // Operator which relaxes two sub-chains of three consecutive arcs each.
364 // Each sub-chain is defined by a start node and the next three arcs. Those
365 // six arcs are relaxed to build a new neighbor.
366 // PATH_LNS explores all possible pairs of starting nodes and so defines
367 // n^2 neighbors, n being the number of nodes.
368 // Note that the two sub-chains can be part of the same path; they even may
369 // overlap.
370 OptionalBoolean use_path_lns = 16;
371 // Operator which relaxes one entire path and all inactive nodes.
372 OptionalBoolean use_full_path_lns = 17;
373 // TSP-base LNS.
374 // Randomly merges consecutive nodes until n "meta"-nodes remain and solves
375 // the corresponding TSP.
376 // This defines an "unlimited" neighborhood which must be stopped by search
377 // limits. To force diversification, the operator iteratively forces each
378 // node to serve as base of a meta-node.
379 OptionalBoolean use_tsp_lns = 18;
380 // Operator which relaxes all inactive nodes and one sub-chain of six
381 // consecutive arcs. That way the path can be improved by inserting inactive
382 // nodes or swapping arcs.
383 OptionalBoolean use_inactive_lns = 19;
384 // --- LNS-like large neighborhood search operators using heuristics ---
385 // Operator which makes all nodes on a route unperformed, and reinserts them
386 // using the GlobalCheapestInsertion heuristic.
387 OptionalBoolean use_global_cheapest_insertion_path_lns = 27;
388 // Same as above but using LocalCheapestInsertion as a heuristic.
389 OptionalBoolean use_local_cheapest_insertion_path_lns = 28;
390 // The following operator relocates an entire route to an empty path and
391 // then tries to insert the unperformed nodes using the global cheapest
392 // insertion heuristic.
393 OptionalBoolean
394 use_relocate_path_global_cheapest_insertion_insert_unperformed = 33;
395 // This operator finds heuristic_expensive_chain_lns_num_arcs_to_consider
396 // most expensive arcs on a route, makes the nodes in between pairs of these
397 // expensive arcs unperformed, and reinserts them using the
398 // GlobalCheapestInsertion heuristic.
399 OptionalBoolean use_global_cheapest_insertion_expensive_chain_lns = 29;
400 // Same as above but using LocalCheapestInsertion as a heuristic for
401 // insertion.
402 OptionalBoolean use_local_cheapest_insertion_expensive_chain_lns = 30;
403 // The following operator makes a node and its
404 // heuristic_close_nodes_lns_num_nodes closest neighbors unperformed along
405 // with each of their corresponding performed pickup/delivery pairs, and
406 // then reinserts them using the GlobalCheapestInsertion heuristic.
407 OptionalBoolean use_global_cheapest_insertion_close_nodes_lns = 31;
408 // Same as above, but insertion positions for nodes are determined by the
409 // LocalCheapestInsertion heuristic.
410 OptionalBoolean use_local_cheapest_insertion_close_nodes_lns = 32;
411 }
412 LocalSearchNeighborhoodOperators local_search_operators = 3;
413
414 // Neighbors ratio and minimum number of neighbors considered in local
415 // search operators (see cheapest_insertion_first_solution_neighbors_ratio
416 // and cheapest_insertion_first_solution_min_neighbors for more information).
417 double ls_operator_neighbors_ratio = 53;
418 int32 ls_operator_min_neighbors = 54;
419
420 // If true, the solver will use multi-armed bandit concatenate operators. It
421 // dynamically chooses the next neighbor operator in order to get the best
422 // objective improvement.
423 bool use_multi_armed_bandit_concatenate_operators = 41;
424
425 // Memory coefficient related to the multi-armed bandit compound operator.
426 // Sets how much the objective improvement of previous accepted neighbors
427 // influence the current average improvement.
428 // This parameter should be between 0 and 1.
429 double multi_armed_bandit_compound_operator_memory_coefficient = 42;
430
431 // Positive parameter defining the exploration coefficient of the multi-armed
432 // bandit compound operator. Sets how often we explore rarely used and
433 // unsuccessful in the past operators
434 double multi_armed_bandit_compound_operator_exploration_coefficient = 43;
435
436 // Number of expensive arcs to consider cutting in the RelocateExpensiveChain
437 // neighborhood operator (see
438 // LocalSearchNeighborhoodOperators.use_relocate_expensive_chain()).
439 // This parameter must be greater than 2.
440 // NOTE(user): The number of neighbors generated by the operator for
441 // relocate_expensive_chain_num_arcs_to_consider = K is around
442 // K*(K-1)/2 * number_of_routes * number_of_nodes.
443 int32 relocate_expensive_chain_num_arcs_to_consider = 20;
444
445 // Number of expensive arcs to consider cutting in the
446 // FilteredHeuristicExpensiveChainLNSOperator operator.
447 int32 heuristic_expensive_chain_lns_num_arcs_to_consider = 32;
448
449 // Number of closest nodes to consider for each node during the destruction
450 // phase of the FilteredHeuristicCloseNodesLNSOperator.
451 int32 heuristic_close_nodes_lns_num_nodes = 35;
452
453 // Local search metaheuristics used to guide the search.
454 LocalSearchMetaheuristic.Value local_search_metaheuristic = 4;
455 // These are advanced settings which should not be modified unless you know
456 // what you are doing.
457 // Lambda coefficient used to penalize arc costs when GUIDED_LOCAL_SEARCH is
458 // used. Must be positive.
459 double guided_local_search_lambda_coefficient = 5;
460 // Whether to reset penalties when a new best solution is found. The effect is
461 // that a greedy descent is started before the next penalization phase.
462 bool guided_local_search_reset_penalties_on_new_best_solution = 51;
463
464 // --- Search control ---
465 //
466 // If true, the solver should use depth-first search rather than local search
467 // to solve the problem.
468 bool use_depth_first_search = 6;
469 // If true, use the CP solver to find a solution. Either local or depth-first
470 // search will be used depending on the value of use_depth_first_search. Will
471 // be run before the CP-SAT solver (cf. use_cp_sat).
472 OptionalBoolean use_cp = 28;
473 // If true, use the CP-SAT solver to find a solution. If use_cp is also true,
474 // the CP-SAT solver will be run after the CP solver if there is time
475 // remaining and will use the CP solution as a hint for the CP-SAT search.
476 // As of 5/2019, only TSP models can be solved.
477 OptionalBoolean use_cp_sat = 27;
478 // If true, use the CP-SAT solver to find a solution on generalized routing
479 // model. If use_cp is also true, the CP-SAT solver will be run after the CP
480 // solver if there is time remaining and will use the CP solution as a hint
481 // for the CP-SAT search.
482 OptionalBoolean use_generalized_cp_sat = 47;
483 // If use_cp_sat or use_generalized_cp_sat is true, contains the SAT algorithm
484 // parameters which will be used.
485 sat.SatParameters sat_parameters = 48;
486 // If use_cp_sat or use_generalized_cp_sat is true, will report intermediate
487 // solutions found by CP-SAT to solution listeners.
488 bool report_intermediate_cp_sat_solutions = 56;
489 // If model.Size() is less than the threshold and that no solution has been
490 // found, attempt a pass with CP-SAT.
491 int32 fallback_to_cp_sat_size_threshold = 52;
492 // Underlying solver to use in dimension scheduling, respectively for
493 // continuous and mixed models.
494 enum SchedulingSolver {
495 SCHEDULING_UNSET = 0;
496 SCHEDULING_GLOP = 1;
497 SCHEDULING_CP_SAT = 2;
498 }
499 SchedulingSolver continuous_scheduling_solver = 33;
500 SchedulingSolver mixed_integer_scheduling_solver = 34;
501 // Setting this to true completely disables the LP and MIP scheduling in the
502 // solver. This overrides the 2 SchedulingSolver options above.
503 optional bool disable_scheduling_beware_this_may_degrade_performance = 50;
504 // Minimum step by which the solution must be improved in local search. 0
505 // means "unspecified". If this value is fractional, it will get rounded to
506 // the nearest integer.
507 double optimization_step = 7;
508 // Number of solutions to collect during the search. Corresponds to the best
509 // solutions found during the search. 0 means "unspecified".
510 int32 number_of_solutions_to_collect = 17;
511 // -- Search limits --
512 // Limit to the number of solutions generated during the search. 0 means
513 // "unspecified".
514 int64 solution_limit = 8;
515 // Limit to the time spent in the search.
516 google.protobuf.Duration time_limit = 9;
517 // Limit to the time spent in the completion search for each local search
518 // neighbor.
519 google.protobuf.Duration lns_time_limit = 10;
520 // Ratio of the overall time limit spent in a secondary LS phase with only
521 // intra-route and insertion operators, meant to "cleanup" the current
522 // solution before stopping the search.
523 // TODO(user): Since these operators are very fast, add a parameter to cap
524 // the max time allocated for this second phase (e.g.
525 // Duration max_secondary_ls_time_limit).
526 double secondary_ls_time_limit_ratio = 57;
527
528 // Parameters required for the improvement search limit.
529 message ImprovementSearchLimitParameters {
530 // Parameter that regulates exchange rate between objective improvement and
531 // number of neighbors spent. The smaller the value, the sooner the limit
532 // stops the search. Must be positive.
533 double improvement_rate_coefficient = 38;
534 // Parameter that specifies the distance between improvements taken into
535 // consideration for calculating the improvement rate.
536 // Example: For 5 objective improvements = (10, 8, 6, 4, 2), and the
537 // solutions_distance parameter of 2, then the improvement_rate will be
538 // computed for (10, 6), (8, 4), and (6, 2).
539 int32 improvement_rate_solutions_distance = 39;
540 }
541 // The improvement search limit is added to the solver if the following
542 // parameters are set.
543 ImprovementSearchLimitParameters improvement_limit_parameters = 37;
544
545 // --- Propagation control ---
546 // These are advanced settings which should not be modified unless you know
547 // what you are doing.
548 //
549 // Use constraints with full propagation in routing model (instead of 'light'
550 // propagation only). Full propagation is only necessary when using
551 // depth-first search or for models which require strong propagation to
552 // finalize the value of secondary variables.
553 // Changing this setting to true will slow down the search in most cases and
554 // increase memory consumption in all cases.
555 bool use_full_propagation = 11;
556
557 // --- Miscellaneous ---
558 // Some of these are advanced settings which should not be modified unless you
559 // know what you are doing.
560 //
561 // Activates search logging. For each solution found during the search, the
562 // following will be displayed: its objective value, the maximum objective
563 // value since the beginning of the search, the elapsed time since the
564 // beginning of the search, the number of branches explored in the search
565 // tree, the number of failures in the search tree, the depth of the search
566 // tree, the number of local search neighbors explored, the number of local
567 // search neighbors filtered by local search filters, the number of local
568 // search neighbors accepted, the total memory used and the percentage of the
569 // search done.
570 bool log_search = 13;
571 // In logs, cost values will be scaled and offset by the given values in the
572 // following way: log_cost_scaling_factor * (cost + log_cost_offset)
573 double log_cost_scaling_factor = 22;
574 double log_cost_offset = 29;
575 // In logs, this tag will be appended to each line corresponding to a new
576 // solution. Useful to sort out logs when several solves are run in parallel.
577 string log_tag = 36;
578
579 // Whether the solver should use an Iterated Local Search approach to solve
580 // the problem.
581 bool use_iterated_local_search = 58;
582
583 // Iterated Local Search parameters.
584 IteratedLocalSearchParameters iterated_local_search_parameters = 60;
585}
586
587// Parameters which have to be set when creating a RoutingModel.
588message RoutingModelParameters {
589 // Parameters to use in the underlying constraint solver.
590 ConstraintSolverParameters solver_parameters = 1;
591 // Advanced settings.
592 // If set to true reduction of the underlying constraint model will be
593 // attempted when all vehicles have exactly the same cost structure. This can
594 // result in significant speedups.
595 bool reduce_vehicle_cost_model = 2;
596 // Cache callback calls if the number of nodes in the model is less or equal
597 // to this value.
598 int32 max_callback_cache_size = 3;
599}