cpsat-js 0.1.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +165 -0
  3. package/build/cpsat.cjs +2 -0
  4. package/build/cpsat.wasm +0 -0
  5. package/dist/generated/cp_model_pb.d.ts +1625 -0
  6. package/dist/generated/cp_model_pb.d.ts.map +1 -0
  7. package/dist/generated/cp_model_pb.js +296 -0
  8. package/dist/generated/cp_model_pb.js.map +1 -0
  9. package/dist/generated/sat_parameters_pb.d.ts +2930 -0
  10. package/dist/generated/sat_parameters_pb.d.ts.map +1 -0
  11. package/dist/generated/sat_parameters_pb.js +427 -0
  12. package/dist/generated/sat_parameters_pb.js.map +1 -0
  13. package/dist/index.d.ts +10 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +8 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/model/constraint.d.ts +16 -0
  18. package/dist/model/constraint.d.ts.map +1 -0
  19. package/dist/model/constraint.js +20 -0
  20. package/dist/model/constraint.js.map +1 -0
  21. package/dist/model/cp-model.d.ts +35 -0
  22. package/dist/model/cp-model.d.ts.map +1 -0
  23. package/dist/model/cp-model.js +175 -0
  24. package/dist/model/cp-model.js.map +1 -0
  25. package/dist/model/domain.d.ts +13 -0
  26. package/dist/model/domain.d.ts.map +1 -0
  27. package/dist/model/domain.js +45 -0
  28. package/dist/model/domain.js.map +1 -0
  29. package/dist/model/int-var.d.ts +37 -0
  30. package/dist/model/int-var.d.ts.map +1 -0
  31. package/dist/model/int-var.js +87 -0
  32. package/dist/model/int-var.js.map +1 -0
  33. package/dist/model/interval-var.d.ts +14 -0
  34. package/dist/model/interval-var.d.ts.map +1 -0
  35. package/dist/model/interval-var.js +17 -0
  36. package/dist/model/interval-var.js.map +1 -0
  37. package/dist/model/linear-expr.d.ts +43 -0
  38. package/dist/model/linear-expr.d.ts.map +1 -0
  39. package/dist/model/linear-expr.js +129 -0
  40. package/dist/model/linear-expr.js.map +1 -0
  41. package/dist/solver/cp-solver.d.ts +36 -0
  42. package/dist/solver/cp-solver.d.ts.map +1 -0
  43. package/dist/solver/cp-solver.js +92 -0
  44. package/dist/solver/cp-solver.js.map +1 -0
  45. package/package.json +58 -0
@@ -0,0 +1,1625 @@
1
+ import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
2
+ import type { Message } from "@bufbuild/protobuf";
3
+ /**
4
+ * Describes the file cp_model.proto.
5
+ */
6
+ export declare const file_cp_model: GenFile;
7
+ /**
8
+ * An integer variable.
9
+ *
10
+ * It will be referred to by an int32 corresponding to its index in a
11
+ * CpModelProto variables field.
12
+ *
13
+ * Depending on the context, a reference to a variable whose domain is in [0, 1]
14
+ * can also be seen as a Boolean that will be true if the variable value is 1
15
+ * and false if it is 0. When used in this context, the field name will always
16
+ * contain the word "literal".
17
+ *
18
+ * Negative reference (advanced usage): to simplify the creation of a model and
19
+ * for efficiency reasons, all the "literal" or "variable" fields can also
20
+ * contain a negative index. A negative index i will refer to the negation of
21
+ * the integer variable at index -i -1 or to NOT the literal at the same index.
22
+ *
23
+ * Ex: A variable index 4 will refer to the integer variable model.variables(4)
24
+ * and an index of -5 will refer to the negation of the same variable. A literal
25
+ * index 4 will refer to the logical fact that model.variable(4) == 1 and a
26
+ * literal index of -5 will refer to the logical fact model.variable(4) == 0.
27
+ *
28
+ * @generated from message operations_research.sat.IntegerVariableProto
29
+ */
30
+ export type IntegerVariableProto = Message<"operations_research.sat.IntegerVariableProto"> & {
31
+ /**
32
+ * For debug/logging only. Can be empty.
33
+ *
34
+ * @generated from field: string name = 1;
35
+ */
36
+ name: string;
37
+ /**
38
+ * The variable domain given as a sorted list of n disjoint intervals
39
+ * [min, max] and encoded as [min_0, max_0, ..., min_{n-1}, max_{n-1}].
40
+ *
41
+ * The most common example being just [min, max].
42
+ * If min == max, then this is a constant variable.
43
+ *
44
+ * We have:
45
+ * - domain_size() is always even.
46
+ * - min == domain.front();
47
+ * - max == domain.back();
48
+ * - for all i < n : min_i <= max_i
49
+ * - for all i < n-1 : max_i + 1 < min_{i+1}.
50
+ *
51
+ * Note that we check at validation that a variable domain is small enough so
52
+ * that we don't run into integer overflow in our algorithms. Because of that,
53
+ * you cannot just have "unbounded" variable like [0, kint64max] and should
54
+ * try to specify tighter domains.
55
+ *
56
+ * @generated from field: repeated int64 domain = 2;
57
+ */
58
+ domain: bigint[];
59
+ };
60
+ /**
61
+ * Describes the message operations_research.sat.IntegerVariableProto.
62
+ * Use `create(IntegerVariableProtoSchema)` to create a new message.
63
+ */
64
+ export declare const IntegerVariableProtoSchema: GenMessage<IntegerVariableProto>;
65
+ /**
66
+ * Argument of the constraints of the form OP(literals).
67
+ *
68
+ * @generated from message operations_research.sat.BoolArgumentProto
69
+ */
70
+ export type BoolArgumentProto = Message<"operations_research.sat.BoolArgumentProto"> & {
71
+ /**
72
+ * @generated from field: repeated int32 literals = 1;
73
+ */
74
+ literals: number[];
75
+ };
76
+ /**
77
+ * Describes the message operations_research.sat.BoolArgumentProto.
78
+ * Use `create(BoolArgumentProtoSchema)` to create a new message.
79
+ */
80
+ export declare const BoolArgumentProtoSchema: GenMessage<BoolArgumentProto>;
81
+ /**
82
+ * Some constraints supports linear expression instead of just using a reference
83
+ * to a variable. This is especially useful during presolve to reduce the model
84
+ * size.
85
+ *
86
+ * @generated from message operations_research.sat.LinearExpressionProto
87
+ */
88
+ export type LinearExpressionProto = Message<"operations_research.sat.LinearExpressionProto"> & {
89
+ /**
90
+ * @generated from field: repeated int32 vars = 1;
91
+ */
92
+ vars: number[];
93
+ /**
94
+ * @generated from field: repeated int64 coeffs = 2;
95
+ */
96
+ coeffs: bigint[];
97
+ /**
98
+ * @generated from field: int64 offset = 3;
99
+ */
100
+ offset: bigint;
101
+ };
102
+ /**
103
+ * Describes the message operations_research.sat.LinearExpressionProto.
104
+ * Use `create(LinearExpressionProtoSchema)` to create a new message.
105
+ */
106
+ export declare const LinearExpressionProtoSchema: GenMessage<LinearExpressionProto>;
107
+ /**
108
+ * @generated from message operations_research.sat.LinearArgumentProto
109
+ */
110
+ export type LinearArgumentProto = Message<"operations_research.sat.LinearArgumentProto"> & {
111
+ /**
112
+ * @generated from field: operations_research.sat.LinearExpressionProto target = 1;
113
+ */
114
+ target?: LinearExpressionProto;
115
+ /**
116
+ * @generated from field: repeated operations_research.sat.LinearExpressionProto exprs = 2;
117
+ */
118
+ exprs: LinearExpressionProto[];
119
+ };
120
+ /**
121
+ * Describes the message operations_research.sat.LinearArgumentProto.
122
+ * Use `create(LinearArgumentProtoSchema)` to create a new message.
123
+ */
124
+ export declare const LinearArgumentProtoSchema: GenMessage<LinearArgumentProto>;
125
+ /**
126
+ * All expressions must take different values.
127
+ *
128
+ * @generated from message operations_research.sat.AllDifferentConstraintProto
129
+ */
130
+ export type AllDifferentConstraintProto = Message<"operations_research.sat.AllDifferentConstraintProto"> & {
131
+ /**
132
+ * @generated from field: repeated operations_research.sat.LinearExpressionProto exprs = 1;
133
+ */
134
+ exprs: LinearExpressionProto[];
135
+ };
136
+ /**
137
+ * Describes the message operations_research.sat.AllDifferentConstraintProto.
138
+ * Use `create(AllDifferentConstraintProtoSchema)` to create a new message.
139
+ */
140
+ export declare const AllDifferentConstraintProtoSchema: GenMessage<AllDifferentConstraintProto>;
141
+ /**
142
+ * The linear sum vars[i] * coeffs[i] must fall in the given domain. The domain
143
+ * has the same format as the one in IntegerVariableProto.
144
+ *
145
+ * Note that the validation code currently checks using the domain of the
146
+ * involved variables that the sum can always be computed without integer
147
+ * overflow and throws an error otherwise.
148
+ *
149
+ * @generated from message operations_research.sat.LinearConstraintProto
150
+ */
151
+ export type LinearConstraintProto = Message<"operations_research.sat.LinearConstraintProto"> & {
152
+ /**
153
+ * @generated from field: repeated int32 vars = 1;
154
+ */
155
+ vars: number[];
156
+ /**
157
+ * Same size as vars.
158
+ *
159
+ * @generated from field: repeated int64 coeffs = 2;
160
+ */
161
+ coeffs: bigint[];
162
+ /**
163
+ * @generated from field: repeated int64 domain = 3;
164
+ */
165
+ domain: bigint[];
166
+ };
167
+ /**
168
+ * Describes the message operations_research.sat.LinearConstraintProto.
169
+ * Use `create(LinearConstraintProtoSchema)` to create a new message.
170
+ */
171
+ export declare const LinearConstraintProtoSchema: GenMessage<LinearConstraintProto>;
172
+ /**
173
+ * The constraint linear_target = exprs[linear_index].
174
+ * This enforces that index takes one of the value in [0, vars_size()).
175
+ *
176
+ * @generated from message operations_research.sat.ElementConstraintProto
177
+ */
178
+ export type ElementConstraintProto = Message<"operations_research.sat.ElementConstraintProto"> & {
179
+ /**
180
+ * Legacy field.
181
+ *
182
+ * @generated from field: int32 index = 1;
183
+ */
184
+ index: number;
185
+ /**
186
+ * Legacy field.
187
+ *
188
+ * @generated from field: int32 target = 2;
189
+ */
190
+ target: number;
191
+ /**
192
+ * Legacy field.
193
+ *
194
+ * @generated from field: repeated int32 vars = 3;
195
+ */
196
+ vars: number[];
197
+ /**
198
+ * @generated from field: operations_research.sat.LinearExpressionProto linear_index = 4;
199
+ */
200
+ linearIndex?: LinearExpressionProto;
201
+ /**
202
+ * @generated from field: operations_research.sat.LinearExpressionProto linear_target = 5;
203
+ */
204
+ linearTarget?: LinearExpressionProto;
205
+ /**
206
+ * @generated from field: repeated operations_research.sat.LinearExpressionProto exprs = 6;
207
+ */
208
+ exprs: LinearExpressionProto[];
209
+ };
210
+ /**
211
+ * Describes the message operations_research.sat.ElementConstraintProto.
212
+ * Use `create(ElementConstraintProtoSchema)` to create a new message.
213
+ */
214
+ export declare const ElementConstraintProtoSchema: GenMessage<ElementConstraintProto>;
215
+ /**
216
+ * This is not really a constraint. It is there so it can be referred by other
217
+ * constraints using this "interval" concept.
218
+ *
219
+ * IMPORTANT: For now, this constraint do not enforce any relations on the
220
+ * components, and it is up to the client to add in the model:
221
+ * - enforcement => start + size == end.
222
+ * - enforcement => size >= 0 // Only needed if size is not already >= 0.
223
+ *
224
+ * @generated from message operations_research.sat.IntervalConstraintProto
225
+ */
226
+ export type IntervalConstraintProto = Message<"operations_research.sat.IntervalConstraintProto"> & {
227
+ /**
228
+ * @generated from field: operations_research.sat.LinearExpressionProto start = 4;
229
+ */
230
+ start?: LinearExpressionProto;
231
+ /**
232
+ * @generated from field: operations_research.sat.LinearExpressionProto end = 5;
233
+ */
234
+ end?: LinearExpressionProto;
235
+ /**
236
+ * @generated from field: operations_research.sat.LinearExpressionProto size = 6;
237
+ */
238
+ size?: LinearExpressionProto;
239
+ };
240
+ /**
241
+ * Describes the message operations_research.sat.IntervalConstraintProto.
242
+ * Use `create(IntervalConstraintProtoSchema)` to create a new message.
243
+ */
244
+ export declare const IntervalConstraintProtoSchema: GenMessage<IntervalConstraintProto>;
245
+ /**
246
+ * All the intervals (index of IntervalConstraintProto) must be disjoint. More
247
+ * formally, there must exist a sequence so that for each consecutive intervals,
248
+ * we have end_i <= start_{i+1}. In particular, intervals of size zero do matter
249
+ * for this constraint. This is also known as a disjunctive constraint in
250
+ * scheduling.
251
+ *
252
+ * @generated from message operations_research.sat.NoOverlapConstraintProto
253
+ */
254
+ export type NoOverlapConstraintProto = Message<"operations_research.sat.NoOverlapConstraintProto"> & {
255
+ /**
256
+ * @generated from field: repeated int32 intervals = 1;
257
+ */
258
+ intervals: number[];
259
+ };
260
+ /**
261
+ * Describes the message operations_research.sat.NoOverlapConstraintProto.
262
+ * Use `create(NoOverlapConstraintProtoSchema)` to create a new message.
263
+ */
264
+ export declare const NoOverlapConstraintProtoSchema: GenMessage<NoOverlapConstraintProto>;
265
+ /**
266
+ * The boxes defined by [start_x, end_x) * [start_y, end_y) cannot overlap.
267
+ * Furthermore, one box is optional if at least one of the x or y interval is
268
+ * optional.
269
+ *
270
+ * Note that the case of boxes of size zero is special. The following cases
271
+ * violate the constraint:
272
+ * - a point box inside a box with a non zero area
273
+ * - a line box overlapping a box with a non zero area
274
+ * - one vertical line box crossing an horizontal line box.
275
+ *
276
+ * @generated from message operations_research.sat.NoOverlap2DConstraintProto
277
+ */
278
+ export type NoOverlap2DConstraintProto = Message<"operations_research.sat.NoOverlap2DConstraintProto"> & {
279
+ /**
280
+ * @generated from field: repeated int32 x_intervals = 1;
281
+ */
282
+ xIntervals: number[];
283
+ /**
284
+ * Same size as x_intervals.
285
+ *
286
+ * @generated from field: repeated int32 y_intervals = 2;
287
+ */
288
+ yIntervals: number[];
289
+ };
290
+ /**
291
+ * Describes the message operations_research.sat.NoOverlap2DConstraintProto.
292
+ * Use `create(NoOverlap2DConstraintProtoSchema)` to create a new message.
293
+ */
294
+ export declare const NoOverlap2DConstraintProtoSchema: GenMessage<NoOverlap2DConstraintProto>;
295
+ /**
296
+ * The sum of the demands of the intervals at each interval point cannot exceed
297
+ * a capacity. Note that intervals are interpreted as [start, end) and as
298
+ * such intervals like [2,3) and [3,4) do not overlap for the point of view of
299
+ * this constraint. Moreover, intervals of size zero are ignored.
300
+ *
301
+ * All demands must not contain any negative value in their domains. This is
302
+ * checked at validation. Even if there are no intervals, this constraint
303
+ * implicit enforces capacity >= 0. In other words, a negative capacity is
304
+ * considered valid but always infeasible.
305
+ *
306
+ * @generated from message operations_research.sat.CumulativeConstraintProto
307
+ */
308
+ export type CumulativeConstraintProto = Message<"operations_research.sat.CumulativeConstraintProto"> & {
309
+ /**
310
+ * @generated from field: operations_research.sat.LinearExpressionProto capacity = 1;
311
+ */
312
+ capacity?: LinearExpressionProto;
313
+ /**
314
+ * @generated from field: repeated int32 intervals = 2;
315
+ */
316
+ intervals: number[];
317
+ /**
318
+ * Same size as intervals.
319
+ *
320
+ * @generated from field: repeated operations_research.sat.LinearExpressionProto demands = 3;
321
+ */
322
+ demands: LinearExpressionProto[];
323
+ };
324
+ /**
325
+ * Describes the message operations_research.sat.CumulativeConstraintProto.
326
+ * Use `create(CumulativeConstraintProtoSchema)` to create a new message.
327
+ */
328
+ export declare const CumulativeConstraintProtoSchema: GenMessage<CumulativeConstraintProto>;
329
+ /**
330
+ * Maintain a reservoir level within bounds. The water level starts at 0, and at
331
+ * any time, it must be within [min_level, max_level].
332
+ *
333
+ * If the variable active_literals[i] is true, and if the expression
334
+ * time_exprs[i] is assigned a value t, then the current level changes by
335
+ * level_changes[i] at the time t. Therefore, at any time t:
336
+ *
337
+ * sum(level_changes[i] * active_literals[i] if time_exprs[i] <= t)
338
+ * in [min_level, max_level]
339
+ *
340
+ * Note that min level must be <= 0, and the max level must be >= 0. Please use
341
+ * fixed level_changes to simulate initial state.
342
+ *
343
+ * The array of boolean variables 'actives', if defined, indicates which actions
344
+ * are actually performed. If this array is not defined, then it is assumed that
345
+ * all actions will be performed.
346
+ *
347
+ * @generated from message operations_research.sat.ReservoirConstraintProto
348
+ */
349
+ export type ReservoirConstraintProto = Message<"operations_research.sat.ReservoirConstraintProto"> & {
350
+ /**
351
+ * @generated from field: int64 min_level = 1;
352
+ */
353
+ minLevel: bigint;
354
+ /**
355
+ * @generated from field: int64 max_level = 2;
356
+ */
357
+ maxLevel: bigint;
358
+ /**
359
+ * @generated from field: repeated operations_research.sat.LinearExpressionProto time_exprs = 3;
360
+ */
361
+ timeExprs: LinearExpressionProto[];
362
+ /**
363
+ * @generated from field: repeated operations_research.sat.LinearExpressionProto level_changes = 6;
364
+ */
365
+ levelChanges: LinearExpressionProto[];
366
+ /**
367
+ * @generated from field: repeated int32 active_literals = 5;
368
+ */
369
+ activeLiterals: number[];
370
+ };
371
+ /**
372
+ * Describes the message operations_research.sat.ReservoirConstraintProto.
373
+ * Use `create(ReservoirConstraintProtoSchema)` to create a new message.
374
+ */
375
+ export declare const ReservoirConstraintProtoSchema: GenMessage<ReservoirConstraintProto>;
376
+ /**
377
+ * The circuit constraint is defined on a graph where the arc presence are
378
+ * controlled by literals. Each arc is given by an index in the
379
+ * tails/heads/literals lists that must have the same size.
380
+ *
381
+ * For now, we ignore node indices with no incident arc. All the other nodes
382
+ * must have exactly one incoming and one outgoing selected arc (i.e. literal at
383
+ * true). All the selected arcs that are not self-loops must form a single
384
+ * circuit. Note that multi-arcs are allowed, but only one of them will be true
385
+ * at the same time. Multi-self loop are disallowed though.
386
+ *
387
+ * @generated from message operations_research.sat.CircuitConstraintProto
388
+ */
389
+ export type CircuitConstraintProto = Message<"operations_research.sat.CircuitConstraintProto"> & {
390
+ /**
391
+ * @generated from field: repeated int32 tails = 3;
392
+ */
393
+ tails: number[];
394
+ /**
395
+ * @generated from field: repeated int32 heads = 4;
396
+ */
397
+ heads: number[];
398
+ /**
399
+ * @generated from field: repeated int32 literals = 5;
400
+ */
401
+ literals: number[];
402
+ };
403
+ /**
404
+ * Describes the message operations_research.sat.CircuitConstraintProto.
405
+ * Use `create(CircuitConstraintProtoSchema)` to create a new message.
406
+ */
407
+ export declare const CircuitConstraintProtoSchema: GenMessage<CircuitConstraintProto>;
408
+ /**
409
+ * The "VRP" (Vehicle Routing Problem) constraint.
410
+ *
411
+ * The direct graph where arc #i (from tails[i] to head[i]) is present iff
412
+ * literals[i] is true must satisfy this set of properties:
413
+ * - #incoming arcs == 1 except for node 0.
414
+ * - #outgoing arcs == 1 except for node 0.
415
+ * - for node zero, #incoming arcs == #outgoing arcs.
416
+ * - There are no duplicate arcs.
417
+ * - Self-arcs are allowed except for node 0.
418
+ * - There is no cycle in this graph, except through node 0.
419
+ *
420
+ * Note: Currently this constraint expects all the nodes in [0, num_nodes) to
421
+ * have at least one incident arc. The model will be considered invalid if it
422
+ * is not the case. You can add self-arc fixed to one to ignore some nodes if
423
+ * needed.
424
+ *
425
+ * TODO(user): It is probably possible to generalize this constraint to a
426
+ * no-cycle in a general graph, or a no-cycle with sum incoming <= 1 and sum
427
+ * outgoing <= 1 (more efficient implementation). On the other hand, having this
428
+ * specific constraint allow us to add specific "cuts" to a VRP problem.
429
+ *
430
+ * @generated from message operations_research.sat.RoutesConstraintProto
431
+ */
432
+ export type RoutesConstraintProto = Message<"operations_research.sat.RoutesConstraintProto"> & {
433
+ /**
434
+ * @generated from field: repeated int32 tails = 1;
435
+ */
436
+ tails: number[];
437
+ /**
438
+ * @generated from field: repeated int32 heads = 2;
439
+ */
440
+ heads: number[];
441
+ /**
442
+ * @generated from field: repeated int32 literals = 3;
443
+ */
444
+ literals: number[];
445
+ /**
446
+ * DEPRECATED. These fields are no longer used. The solver ignores them.
447
+ *
448
+ * @generated from field: repeated int32 demands = 4;
449
+ */
450
+ demands: number[];
451
+ /**
452
+ * @generated from field: int64 capacity = 5;
453
+ */
454
+ capacity: bigint;
455
+ /**
456
+ * Expressions associated with the nodes of the graph, such as the load of the
457
+ * vehicle arriving at a node, or the time at which a vehicle arrives at a
458
+ * node. Expressions with the same "dimension" (such as "load" or "time") must
459
+ * be listed together.
460
+ * This field is optional. If it is set, the linear constraints of size 1 or 2
461
+ * between the variables in these expressions will be used to derive cuts for
462
+ * this constraint. If it is not set, the solver will try to automatically
463
+ * derive it, from the linear constraints of size 1 or 2 in the model (this
464
+ * can fail in complex cases).
465
+ *
466
+ * @generated from field: repeated operations_research.sat.RoutesConstraintProto.NodeExpressions dimensions = 6;
467
+ */
468
+ dimensions: RoutesConstraintProto_NodeExpressions[];
469
+ };
470
+ /**
471
+ * Describes the message operations_research.sat.RoutesConstraintProto.
472
+ * Use `create(RoutesConstraintProtoSchema)` to create a new message.
473
+ */
474
+ export declare const RoutesConstraintProtoSchema: GenMessage<RoutesConstraintProto>;
475
+ /**
476
+ * A set of linear expressions associated with the nodes.
477
+ *
478
+ * @generated from message operations_research.sat.RoutesConstraintProto.NodeExpressions
479
+ */
480
+ export type RoutesConstraintProto_NodeExpressions = Message<"operations_research.sat.RoutesConstraintProto.NodeExpressions"> & {
481
+ /**
482
+ * The i-th element is the linear expression associated with the i-th node.
483
+ *
484
+ * @generated from field: repeated operations_research.sat.LinearExpressionProto exprs = 1;
485
+ */
486
+ exprs: LinearExpressionProto[];
487
+ };
488
+ /**
489
+ * Describes the message operations_research.sat.RoutesConstraintProto.NodeExpressions.
490
+ * Use `create(RoutesConstraintProto_NodeExpressionsSchema)` to create a new message.
491
+ */
492
+ export declare const RoutesConstraintProto_NodeExpressionsSchema: GenMessage<RoutesConstraintProto_NodeExpressions>;
493
+ /**
494
+ * The values of the n-tuple formed by the given expression can only be one of
495
+ * the listed n-tuples in values. The n-tuples are encoded in a flattened way:
496
+ * [tuple0_v0, tuple0_v1, ..., tuple0_v{n-1}, tuple1_v0, ...].
497
+ * Corner cases:
498
+ * - If all `vars`, `values` and `exprs` are empty, the constraint is trivially
499
+ * true, irrespective of the value of `negated`.
500
+ * - If `values` is empty but either vars or exprs is not, the constraint is
501
+ * trivially false if `negated` is false, and trivially true if `negated` is
502
+ * true.
503
+ * - If `vars` and `exprs` are empty but `values` is not, the model is invalid.
504
+ *
505
+ * @generated from message operations_research.sat.TableConstraintProto
506
+ */
507
+ export type TableConstraintProto = Message<"operations_research.sat.TableConstraintProto"> & {
508
+ /**
509
+ * Legacy field.
510
+ *
511
+ * @generated from field: repeated int32 vars = 1;
512
+ */
513
+ vars: number[];
514
+ /**
515
+ * @generated from field: repeated int64 values = 2;
516
+ */
517
+ values: bigint[];
518
+ /**
519
+ * @generated from field: repeated operations_research.sat.LinearExpressionProto exprs = 4;
520
+ */
521
+ exprs: LinearExpressionProto[];
522
+ /**
523
+ * If true, the meaning is "negated", that is we forbid any of the given
524
+ * tuple from a feasible assignment.
525
+ *
526
+ * @generated from field: bool negated = 3;
527
+ */
528
+ negated: boolean;
529
+ };
530
+ /**
531
+ * Describes the message operations_research.sat.TableConstraintProto.
532
+ * Use `create(TableConstraintProtoSchema)` to create a new message.
533
+ */
534
+ export declare const TableConstraintProtoSchema: GenMessage<TableConstraintProto>;
535
+ /**
536
+ * The two arrays of variable each represent a function, the second is the
537
+ * inverse of the first: f_direct[i] == j <=> f_inverse[j] == i.
538
+ *
539
+ * @generated from message operations_research.sat.InverseConstraintProto
540
+ */
541
+ export type InverseConstraintProto = Message<"operations_research.sat.InverseConstraintProto"> & {
542
+ /**
543
+ * @generated from field: repeated int32 f_direct = 1;
544
+ */
545
+ fDirect: number[];
546
+ /**
547
+ * @generated from field: repeated int32 f_inverse = 2;
548
+ */
549
+ fInverse: number[];
550
+ };
551
+ /**
552
+ * Describes the message operations_research.sat.InverseConstraintProto.
553
+ * Use `create(InverseConstraintProtoSchema)` to create a new message.
554
+ */
555
+ export declare const InverseConstraintProtoSchema: GenMessage<InverseConstraintProto>;
556
+ /**
557
+ * This constraint forces a sequence of expressions to be accepted by an
558
+ * automaton.
559
+ *
560
+ * @generated from message operations_research.sat.AutomatonConstraintProto
561
+ */
562
+ export type AutomatonConstraintProto = Message<"operations_research.sat.AutomatonConstraintProto"> & {
563
+ /**
564
+ * A state is identified by a non-negative number. It is preferable to keep
565
+ * all the states dense in says [0, num_states). The automaton starts at
566
+ * starting_state and must finish in any of the final states.
567
+ *
568
+ * @generated from field: int64 starting_state = 2;
569
+ */
570
+ startingState: bigint;
571
+ /**
572
+ * @generated from field: repeated int64 final_states = 3;
573
+ */
574
+ finalStates: bigint[];
575
+ /**
576
+ * List of transitions (all 3 vectors have the same size). Both tail and head
577
+ * are states, label is any variable value. No two outgoing transitions from
578
+ * the same state can have the same label.
579
+ *
580
+ * @generated from field: repeated int64 transition_tail = 4;
581
+ */
582
+ transitionTail: bigint[];
583
+ /**
584
+ * @generated from field: repeated int64 transition_head = 5;
585
+ */
586
+ transitionHead: bigint[];
587
+ /**
588
+ * @generated from field: repeated int64 transition_label = 6;
589
+ */
590
+ transitionLabel: bigint[];
591
+ /**
592
+ * Legacy field.
593
+ *
594
+ * @generated from field: repeated int32 vars = 7;
595
+ */
596
+ vars: number[];
597
+ /**
598
+ * The sequence of expressions. The automaton is ran for exprs_size() "steps"
599
+ * and the value of exprs[i] corresponds to the transition label at step i.
600
+ *
601
+ * @generated from field: repeated operations_research.sat.LinearExpressionProto exprs = 8;
602
+ */
603
+ exprs: LinearExpressionProto[];
604
+ };
605
+ /**
606
+ * Describes the message operations_research.sat.AutomatonConstraintProto.
607
+ * Use `create(AutomatonConstraintProtoSchema)` to create a new message.
608
+ */
609
+ export declare const AutomatonConstraintProtoSchema: GenMessage<AutomatonConstraintProto>;
610
+ /**
611
+ * A list of variables, without any semantics.
612
+ *
613
+ * @generated from message operations_research.sat.ListOfVariablesProto
614
+ */
615
+ export type ListOfVariablesProto = Message<"operations_research.sat.ListOfVariablesProto"> & {
616
+ /**
617
+ * @generated from field: repeated int32 vars = 1;
618
+ */
619
+ vars: number[];
620
+ };
621
+ /**
622
+ * Describes the message operations_research.sat.ListOfVariablesProto.
623
+ * Use `create(ListOfVariablesProtoSchema)` to create a new message.
624
+ */
625
+ export declare const ListOfVariablesProtoSchema: GenMessage<ListOfVariablesProto>;
626
+ /**
627
+ * Next id: 31
628
+ *
629
+ * @generated from message operations_research.sat.ConstraintProto
630
+ */
631
+ export type ConstraintProto = Message<"operations_research.sat.ConstraintProto"> & {
632
+ /**
633
+ * For debug/logging only. Can be empty.
634
+ *
635
+ * @generated from field: string name = 1;
636
+ */
637
+ name: string;
638
+ /**
639
+ * The constraint will be enforced iff all literals listed here are true. If
640
+ * this is empty, then the constraint will always be enforced. An enforced
641
+ * constraint must be satisfied, and an un-enforced one will simply be
642
+ * ignored.
643
+ *
644
+ * This is also called half-reification. To have an equivalence between a
645
+ * literal and a constraint (full reification), one must add both a constraint
646
+ * (controlled by a literal l) and its negation (controlled by the negation of
647
+ * l).
648
+ *
649
+ * Important: as of September 2025, some constraints might be less efficient
650
+ * with enforcement than without: circuit, routes, no_overlap, no_overlap_2d,
651
+ * and cumulative. If performance is not great, consider using a model without
652
+ * these constraints enforced.
653
+ *
654
+ * @generated from field: repeated int32 enforcement_literal = 2;
655
+ */
656
+ enforcementLiteral: number[];
657
+ /**
658
+ * The actual constraint with its arguments.
659
+ *
660
+ * @generated from oneof operations_research.sat.ConstraintProto.constraint
661
+ */
662
+ constraint: {
663
+ /**
664
+ * The bool_or constraint forces at least one literal to be true.
665
+ *
666
+ * @generated from field: operations_research.sat.BoolArgumentProto bool_or = 3;
667
+ */
668
+ value: BoolArgumentProto;
669
+ case: "boolOr";
670
+ } | {
671
+ /**
672
+ * The bool_and constraint forces all of the literals to be true.
673
+ *
674
+ * This is a "redundant" constraint in the sense that this can easily be
675
+ * encoded with many bool_or or at_most_one. It is just more space efficient
676
+ * and handled slightly differently internally.
677
+ *
678
+ * @generated from field: operations_research.sat.BoolArgumentProto bool_and = 4;
679
+ */
680
+ value: BoolArgumentProto;
681
+ case: "boolAnd";
682
+ } | {
683
+ /**
684
+ * The at_most_one constraint enforces that no more than one literal is
685
+ * true at the same time.
686
+ *
687
+ * Note that an at most one constraint of length n could be encoded with n
688
+ * bool_and constraint with n-1 term on the right hand side. So in a sense,
689
+ * this constraint contribute directly to the "implication-graph" or the
690
+ * 2-SAT part of the model.
691
+ *
692
+ * @generated from field: operations_research.sat.BoolArgumentProto at_most_one = 26;
693
+ */
694
+ value: BoolArgumentProto;
695
+ case: "atMostOne";
696
+ } | {
697
+ /**
698
+ * The exactly_one constraint force exactly one literal to true and no more.
699
+ *
700
+ * Anytime a bool_or (it could have been called at_least_one) is included
701
+ * into an at_most_one, then the bool_or is actually an exactly one
702
+ * constraint, and the extra literal in the at_most_one can be set to false.
703
+ * So in this sense, this constraint is not really needed. it is just here
704
+ * for a better description of the problem structure and to facilitate some
705
+ * algorithm.
706
+ *
707
+ * @generated from field: operations_research.sat.BoolArgumentProto exactly_one = 29;
708
+ */
709
+ value: BoolArgumentProto;
710
+ case: "exactlyOne";
711
+ } | {
712
+ /**
713
+ * The bool_xor constraint forces an odd number of the literals to be true.
714
+ *
715
+ * @generated from field: operations_research.sat.BoolArgumentProto bool_xor = 5;
716
+ */
717
+ value: BoolArgumentProto;
718
+ case: "boolXor";
719
+ } | {
720
+ /**
721
+ * The int_div constraint forces the target to equal exprs[0] / exprs[1].
722
+ * The division is "rounded" towards zero, so we can have for instance
723
+ * (2 = 12 / 5) or (-3 = -10 / 3). If you only want exact integer division,
724
+ * then you should use instead of t = a / b, the int_prod constraint
725
+ * a = b * t.
726
+ *
727
+ * If 0 belongs to the domain of exprs[1], then the model is deemed invalid.
728
+ *
729
+ * @generated from field: operations_research.sat.LinearArgumentProto int_div = 7;
730
+ */
731
+ value: LinearArgumentProto;
732
+ case: "intDiv";
733
+ } | {
734
+ /**
735
+ * The int_mod constraint forces the target to equal exprs[0] % exprs[1].
736
+ * The domain of exprs[1] must be strictly positive. The sign of the target
737
+ * is the same as the sign of exprs[0].
738
+ *
739
+ * @generated from field: operations_research.sat.LinearArgumentProto int_mod = 8;
740
+ */
741
+ value: LinearArgumentProto;
742
+ case: "intMod";
743
+ } | {
744
+ /**
745
+ * The int_prod constraint forces the target to equal the product of all
746
+ * variables. By convention, because we can just remove term equal to one,
747
+ * the empty product forces the target to be one.
748
+ *
749
+ * Note that the solver checks for potential integer overflow. So the
750
+ * product of the maximum absolute value of all the terms (using the initial
751
+ * domain) should fit on an int64. Otherwise the model will be declared
752
+ * invalid.
753
+ *
754
+ * @generated from field: operations_research.sat.LinearArgumentProto int_prod = 11;
755
+ */
756
+ value: LinearArgumentProto;
757
+ case: "intProd";
758
+ } | {
759
+ /**
760
+ * The lin_max constraint forces the target to equal the maximum of all
761
+ * linear expressions.
762
+ * Note that this can model a minimum simply by negating all expressions.
763
+ *
764
+ * @generated from field: operations_research.sat.LinearArgumentProto lin_max = 27;
765
+ */
766
+ value: LinearArgumentProto;
767
+ case: "linMax";
768
+ } | {
769
+ /**
770
+ * The linear constraint enforces a linear inequality among the variables,
771
+ * such as 0 <= x + 2y <= 10.
772
+ *
773
+ * @generated from field: operations_research.sat.LinearConstraintProto linear = 12;
774
+ */
775
+ value: LinearConstraintProto;
776
+ case: "linear";
777
+ } | {
778
+ /**
779
+ * The all_diff constraint forces all variables to take different values.
780
+ *
781
+ * @generated from field: operations_research.sat.AllDifferentConstraintProto all_diff = 13;
782
+ */
783
+ value: AllDifferentConstraintProto;
784
+ case: "allDiff";
785
+ } | {
786
+ /**
787
+ * The element constraint forces the variable with the given index
788
+ * to be equal to the target.
789
+ *
790
+ * @generated from field: operations_research.sat.ElementConstraintProto element = 14;
791
+ */
792
+ value: ElementConstraintProto;
793
+ case: "element";
794
+ } | {
795
+ /**
796
+ * The circuit constraint takes a graph and forces the arcs present
797
+ * (with arc presence indicated by a literal) to form a unique cycle.
798
+ *
799
+ * @generated from field: operations_research.sat.CircuitConstraintProto circuit = 15;
800
+ */
801
+ value: CircuitConstraintProto;
802
+ case: "circuit";
803
+ } | {
804
+ /**
805
+ * The routes constraint implements the vehicle routing problem.
806
+ *
807
+ * @generated from field: operations_research.sat.RoutesConstraintProto routes = 23;
808
+ */
809
+ value: RoutesConstraintProto;
810
+ case: "routes";
811
+ } | {
812
+ /**
813
+ * The table constraint enforces what values a tuple of variables may
814
+ * take.
815
+ *
816
+ * @generated from field: operations_research.sat.TableConstraintProto table = 16;
817
+ */
818
+ value: TableConstraintProto;
819
+ case: "table";
820
+ } | {
821
+ /**
822
+ * The automaton constraint forces a sequence of variables to be accepted
823
+ * by an automaton.
824
+ *
825
+ * @generated from field: operations_research.sat.AutomatonConstraintProto automaton = 17;
826
+ */
827
+ value: AutomatonConstraintProto;
828
+ case: "automaton";
829
+ } | {
830
+ /**
831
+ * The inverse constraint forces two arrays to be inverses of each other:
832
+ * the values of one are the indices of the other, and vice versa.
833
+ *
834
+ * @generated from field: operations_research.sat.InverseConstraintProto inverse = 18;
835
+ */
836
+ value: InverseConstraintProto;
837
+ case: "inverse";
838
+ } | {
839
+ /**
840
+ * The reservoir constraint forces the sum of a set of active demands
841
+ * to always be between a specified minimum and maximum value during
842
+ * specific times.
843
+ *
844
+ * @generated from field: operations_research.sat.ReservoirConstraintProto reservoir = 24;
845
+ */
846
+ value: ReservoirConstraintProto;
847
+ case: "reservoir";
848
+ } | {
849
+ /**
850
+ * The interval constraint takes a start, end, and size, and forces
851
+ * start + size == end.
852
+ *
853
+ * @generated from field: operations_research.sat.IntervalConstraintProto interval = 19;
854
+ */
855
+ value: IntervalConstraintProto;
856
+ case: "interval";
857
+ } | {
858
+ /**
859
+ * The no_overlap constraint prevents a set of intervals from
860
+ * overlapping; in scheduling, this is called a disjunctive
861
+ * constraint.
862
+ *
863
+ * @generated from field: operations_research.sat.NoOverlapConstraintProto no_overlap = 20;
864
+ */
865
+ value: NoOverlapConstraintProto;
866
+ case: "noOverlap";
867
+ } | {
868
+ /**
869
+ * The no_overlap_2d constraint prevents a set of boxes from overlapping.
870
+ *
871
+ * @generated from field: operations_research.sat.NoOverlap2DConstraintProto no_overlap_2d = 21;
872
+ */
873
+ value: NoOverlap2DConstraintProto;
874
+ case: "noOverlap2d";
875
+ } | {
876
+ /**
877
+ * The cumulative constraint ensures that for any integer point, the sum
878
+ * of the demands of the intervals containing that point does not exceed
879
+ * the capacity.
880
+ *
881
+ * @generated from field: operations_research.sat.CumulativeConstraintProto cumulative = 22;
882
+ */
883
+ value: CumulativeConstraintProto;
884
+ case: "cumulative";
885
+ } | {
886
+ /**
887
+ * This constraint is not meant to be used and will be rejected by the
888
+ * solver. It is meant to mark variable when testing the presolve code.
889
+ *
890
+ * @generated from field: operations_research.sat.ListOfVariablesProto dummy_constraint = 30;
891
+ */
892
+ value: ListOfVariablesProto;
893
+ case: "dummyConstraint";
894
+ } | {
895
+ case: undefined;
896
+ value?: undefined;
897
+ };
898
+ };
899
+ /**
900
+ * Describes the message operations_research.sat.ConstraintProto.
901
+ * Use `create(ConstraintProtoSchema)` to create a new message.
902
+ */
903
+ export declare const ConstraintProtoSchema: GenMessage<ConstraintProto>;
904
+ /**
905
+ * Optimization objective.
906
+ *
907
+ * @generated from message operations_research.sat.CpObjectiveProto
908
+ */
909
+ export type CpObjectiveProto = Message<"operations_research.sat.CpObjectiveProto"> & {
910
+ /**
911
+ * The linear terms of the objective to minimize.
912
+ * For a maximization problem, one can negate all coefficients in the
913
+ * objective and set scaling_factor to -1.
914
+ *
915
+ * @generated from field: repeated int32 vars = 1;
916
+ */
917
+ vars: number[];
918
+ /**
919
+ * @generated from field: repeated int64 coeffs = 4;
920
+ */
921
+ coeffs: bigint[];
922
+ /**
923
+ * The displayed objective is always:
924
+ * scaling_factor * (sum(coefficients[i] * objective_vars[i]) + offset).
925
+ * This is needed to have a consistent objective after presolve or when
926
+ * scaling a double problem to express it with integers.
927
+ *
928
+ * Note that if scaling_factor is zero, then it is assumed to be 1, so that by
929
+ * default these fields have no effect.
930
+ *
931
+ * @generated from field: double offset = 2;
932
+ */
933
+ offset: number;
934
+ /**
935
+ * @generated from field: double scaling_factor = 3;
936
+ */
937
+ scalingFactor: number;
938
+ /**
939
+ * If non-empty, only look for an objective value in the given domain.
940
+ * Note that this does not depend on the offset or scaling factor, it is a
941
+ * domain on the sum of the objective terms only.
942
+ *
943
+ * @generated from field: repeated int64 domain = 5;
944
+ */
945
+ domain: bigint[];
946
+ /**
947
+ * Internal field. Do not set. When we scale a FloatObjectiveProto to a
948
+ * integer version, we set this to true if the scaling was exact (i.e. all
949
+ * original coeff were integer for instance).
950
+ *
951
+ * TODO(user): Put the error bounds we computed instead?
952
+ *
953
+ * @generated from field: bool scaling_was_exact = 6;
954
+ */
955
+ scalingWasExact: boolean;
956
+ /**
957
+ * Internal fields to recover a bound on the original integer objective from
958
+ * the presolved one. Basically, initially the integer objective fit on an
959
+ * int64 and is in [Initial_lb, Initial_ub]. During presolve, we might change
960
+ * the linear expression to have a new domain [Presolved_lb, Presolved_ub]
961
+ * that will also always fit on an int64.
962
+ *
963
+ * The two domain will always be linked with an affine transformation between
964
+ * the two of the form:
965
+ * old = (new + before_offset) * integer_scaling_factor + after_offset.
966
+ * Note that we use both offsets to always be able to do the computation while
967
+ * staying in the int64 domain. In particular, the after_offset will always
968
+ * be in (-integer_scaling_factor, integer_scaling_factor).
969
+ *
970
+ * @generated from field: int64 integer_before_offset = 7;
971
+ */
972
+ integerBeforeOffset: bigint;
973
+ /**
974
+ * @generated from field: int64 integer_after_offset = 9;
975
+ */
976
+ integerAfterOffset: bigint;
977
+ /**
978
+ * @generated from field: int64 integer_scaling_factor = 8;
979
+ */
980
+ integerScalingFactor: bigint;
981
+ };
982
+ /**
983
+ * Describes the message operations_research.sat.CpObjectiveProto.
984
+ * Use `create(CpObjectiveProtoSchema)` to create a new message.
985
+ */
986
+ export declare const CpObjectiveProtoSchema: GenMessage<CpObjectiveProto>;
987
+ /**
988
+ * A linear floating point objective: sum coeffs[i] * vars[i] + offset.
989
+ * Note that the variable can only still take integer value.
990
+ *
991
+ * @generated from message operations_research.sat.FloatObjectiveProto
992
+ */
993
+ export type FloatObjectiveProto = Message<"operations_research.sat.FloatObjectiveProto"> & {
994
+ /**
995
+ * @generated from field: repeated int32 vars = 1;
996
+ */
997
+ vars: number[];
998
+ /**
999
+ * @generated from field: repeated double coeffs = 2;
1000
+ */
1001
+ coeffs: number[];
1002
+ /**
1003
+ * @generated from field: double offset = 3;
1004
+ */
1005
+ offset: number;
1006
+ /**
1007
+ * The optimization direction. The default is to minimize
1008
+ *
1009
+ * @generated from field: bool maximize = 4;
1010
+ */
1011
+ maximize: boolean;
1012
+ };
1013
+ /**
1014
+ * Describes the message operations_research.sat.FloatObjectiveProto.
1015
+ * Use `create(FloatObjectiveProtoSchema)` to create a new message.
1016
+ */
1017
+ export declare const FloatObjectiveProtoSchema: GenMessage<FloatObjectiveProto>;
1018
+ /**
1019
+ * Define the strategy to follow when the solver needs to take a new decision.
1020
+ * Note that this strategy is only defined on a subset of variables.
1021
+ *
1022
+ * @generated from message operations_research.sat.DecisionStrategyProto
1023
+ */
1024
+ export type DecisionStrategyProto = Message<"operations_research.sat.DecisionStrategyProto"> & {
1025
+ /**
1026
+ * The variables to be considered for the next decision. The order matter and
1027
+ * is always used as a tie-breaker after the variable selection strategy
1028
+ * criteria defined below.
1029
+ *
1030
+ * @generated from field: repeated int32 variables = 1;
1031
+ */
1032
+ variables: number[];
1033
+ /**
1034
+ * If this is set, then the variables field must be empty.
1035
+ * We currently only support affine expression.
1036
+ *
1037
+ * Note that this is needed so that if a variable has an affine
1038
+ * representative, we can properly transform a DecisionStrategyProto through
1039
+ * presolve.
1040
+ *
1041
+ * @generated from field: repeated operations_research.sat.LinearExpressionProto exprs = 5;
1042
+ */
1043
+ exprs: LinearExpressionProto[];
1044
+ /**
1045
+ * @generated from field: operations_research.sat.DecisionStrategyProto.VariableSelectionStrategy variable_selection_strategy = 2;
1046
+ */
1047
+ variableSelectionStrategy: DecisionStrategyProto_VariableSelectionStrategy;
1048
+ /**
1049
+ * @generated from field: operations_research.sat.DecisionStrategyProto.DomainReductionStrategy domain_reduction_strategy = 3;
1050
+ */
1051
+ domainReductionStrategy: DecisionStrategyProto_DomainReductionStrategy;
1052
+ };
1053
+ /**
1054
+ * Describes the message operations_research.sat.DecisionStrategyProto.
1055
+ * Use `create(DecisionStrategyProtoSchema)` to create a new message.
1056
+ */
1057
+ export declare const DecisionStrategyProtoSchema: GenMessage<DecisionStrategyProto>;
1058
+ /**
1059
+ * The order in which the variables (resp. affine expression) above should be
1060
+ * considered. Note that only variables that are not already fixed are
1061
+ * considered.
1062
+ *
1063
+ * TODO(user): extend as needed.
1064
+ *
1065
+ * @generated from enum operations_research.sat.DecisionStrategyProto.VariableSelectionStrategy
1066
+ */
1067
+ export declare enum DecisionStrategyProto_VariableSelectionStrategy {
1068
+ /**
1069
+ * @generated from enum value: CHOOSE_FIRST = 0;
1070
+ */
1071
+ CHOOSE_FIRST = 0,
1072
+ /**
1073
+ * @generated from enum value: CHOOSE_LOWEST_MIN = 1;
1074
+ */
1075
+ CHOOSE_LOWEST_MIN = 1,
1076
+ /**
1077
+ * @generated from enum value: CHOOSE_HIGHEST_MAX = 2;
1078
+ */
1079
+ CHOOSE_HIGHEST_MAX = 2,
1080
+ /**
1081
+ * @generated from enum value: CHOOSE_MIN_DOMAIN_SIZE = 3;
1082
+ */
1083
+ CHOOSE_MIN_DOMAIN_SIZE = 3,
1084
+ /**
1085
+ * @generated from enum value: CHOOSE_MAX_DOMAIN_SIZE = 4;
1086
+ */
1087
+ CHOOSE_MAX_DOMAIN_SIZE = 4
1088
+ }
1089
+ /**
1090
+ * Describes the enum operations_research.sat.DecisionStrategyProto.VariableSelectionStrategy.
1091
+ */
1092
+ export declare const DecisionStrategyProto_VariableSelectionStrategySchema: GenEnum<DecisionStrategyProto_VariableSelectionStrategy>;
1093
+ /**
1094
+ * Once a variable (resp. affine expression) has been chosen, this enum
1095
+ * describe what decision is taken on its domain.
1096
+ *
1097
+ * TODO(user): extend as needed.
1098
+ *
1099
+ * @generated from enum operations_research.sat.DecisionStrategyProto.DomainReductionStrategy
1100
+ */
1101
+ export declare enum DecisionStrategyProto_DomainReductionStrategy {
1102
+ /**
1103
+ * @generated from enum value: SELECT_MIN_VALUE = 0;
1104
+ */
1105
+ SELECT_MIN_VALUE = 0,
1106
+ /**
1107
+ * @generated from enum value: SELECT_MAX_VALUE = 1;
1108
+ */
1109
+ SELECT_MAX_VALUE = 1,
1110
+ /**
1111
+ * @generated from enum value: SELECT_LOWER_HALF = 2;
1112
+ */
1113
+ SELECT_LOWER_HALF = 2,
1114
+ /**
1115
+ * @generated from enum value: SELECT_UPPER_HALF = 3;
1116
+ */
1117
+ SELECT_UPPER_HALF = 3,
1118
+ /**
1119
+ * @generated from enum value: SELECT_MEDIAN_VALUE = 4;
1120
+ */
1121
+ SELECT_MEDIAN_VALUE = 4,
1122
+ /**
1123
+ * @generated from enum value: SELECT_RANDOM_HALF = 5;
1124
+ */
1125
+ SELECT_RANDOM_HALF = 5
1126
+ }
1127
+ /**
1128
+ * Describes the enum operations_research.sat.DecisionStrategyProto.DomainReductionStrategy.
1129
+ */
1130
+ export declare const DecisionStrategyProto_DomainReductionStrategySchema: GenEnum<DecisionStrategyProto_DomainReductionStrategy>;
1131
+ /**
1132
+ * This message encodes a partial (or full) assignment of the variables of a
1133
+ * CpModelProto. The variable indices should be unique and valid variable
1134
+ * indices.
1135
+ *
1136
+ * @generated from message operations_research.sat.PartialVariableAssignment
1137
+ */
1138
+ export type PartialVariableAssignment = Message<"operations_research.sat.PartialVariableAssignment"> & {
1139
+ /**
1140
+ * @generated from field: repeated int32 vars = 1;
1141
+ */
1142
+ vars: number[];
1143
+ /**
1144
+ * @generated from field: repeated int64 values = 2;
1145
+ */
1146
+ values: bigint[];
1147
+ };
1148
+ /**
1149
+ * Describes the message operations_research.sat.PartialVariableAssignment.
1150
+ * Use `create(PartialVariableAssignmentSchema)` to create a new message.
1151
+ */
1152
+ export declare const PartialVariableAssignmentSchema: GenMessage<PartialVariableAssignment>;
1153
+ /**
1154
+ * A permutation of integers encoded as a list of cycles, hence the "sparse"
1155
+ * format. The image of an element cycle[i] is cycle[(i + 1) % cycle_length].
1156
+ *
1157
+ * @generated from message operations_research.sat.SparsePermutationProto
1158
+ */
1159
+ export type SparsePermutationProto = Message<"operations_research.sat.SparsePermutationProto"> & {
1160
+ /**
1161
+ * Each cycle is listed one after the other in the support field.
1162
+ * The size of each cycle is given (in order) in the cycle_sizes field.
1163
+ *
1164
+ * @generated from field: repeated int32 support = 1;
1165
+ */
1166
+ support: number[];
1167
+ /**
1168
+ * @generated from field: repeated int32 cycle_sizes = 2;
1169
+ */
1170
+ cycleSizes: number[];
1171
+ };
1172
+ /**
1173
+ * Describes the message operations_research.sat.SparsePermutationProto.
1174
+ * Use `create(SparsePermutationProtoSchema)` to create a new message.
1175
+ */
1176
+ export declare const SparsePermutationProtoSchema: GenMessage<SparsePermutationProto>;
1177
+ /**
1178
+ * A dense matrix of numbers encoded in a flat way, row by row.
1179
+ * That is matrix[i][j] = entries[i * num_cols + j];
1180
+ *
1181
+ * @generated from message operations_research.sat.DenseMatrixProto
1182
+ */
1183
+ export type DenseMatrixProto = Message<"operations_research.sat.DenseMatrixProto"> & {
1184
+ /**
1185
+ * @generated from field: int32 num_rows = 1;
1186
+ */
1187
+ numRows: number;
1188
+ /**
1189
+ * @generated from field: int32 num_cols = 2;
1190
+ */
1191
+ numCols: number;
1192
+ /**
1193
+ * @generated from field: repeated int32 entries = 3;
1194
+ */
1195
+ entries: number[];
1196
+ };
1197
+ /**
1198
+ * Describes the message operations_research.sat.DenseMatrixProto.
1199
+ * Use `create(DenseMatrixProtoSchema)` to create a new message.
1200
+ */
1201
+ export declare const DenseMatrixProtoSchema: GenMessage<DenseMatrixProto>;
1202
+ /**
1203
+ * EXPERIMENTAL. For now, this is meant to be used by the solver and not filled
1204
+ * by clients.
1205
+ *
1206
+ * Hold symmetry information about the set of feasible solutions. If we permute
1207
+ * the variable values of any feasible solution using one of the permutation
1208
+ * described here, we should always get another feasible solution.
1209
+ *
1210
+ * We usually also enforce that the objective of the new solution is the same.
1211
+ *
1212
+ * The group of permutations encoded here is usually computed from the encoding
1213
+ * of the model, so it is not meant to be a complete representation of the
1214
+ * feasible solution symmetries, just a valid subgroup.
1215
+ *
1216
+ * @generated from message operations_research.sat.SymmetryProto
1217
+ */
1218
+ export type SymmetryProto = Message<"operations_research.sat.SymmetryProto"> & {
1219
+ /**
1220
+ * A list of variable indices permutations that leave the feasible space of
1221
+ * solution invariant. Usually, we only encode a set of generators of the
1222
+ * group.
1223
+ *
1224
+ * @generated from field: repeated operations_research.sat.SparsePermutationProto permutations = 1;
1225
+ */
1226
+ permutations: SparsePermutationProto[];
1227
+ /**
1228
+ * An orbitope is a special symmetry structure of the solution space. If the
1229
+ * variable indices are arranged in a matrix (with no duplicates), then any
1230
+ * permutation of the columns will be a valid permutation of the feasible
1231
+ * space.
1232
+ *
1233
+ * This arise quite often. The typical example is a graph coloring problem
1234
+ * where for each node i, you have j booleans to indicate its color. If the
1235
+ * variables color_of_i_is_j are arranged in a matrix[i][j], then any columns
1236
+ * permutations leave the problem invariant.
1237
+ *
1238
+ * @generated from field: repeated operations_research.sat.DenseMatrixProto orbitopes = 2;
1239
+ */
1240
+ orbitopes: DenseMatrixProto[];
1241
+ };
1242
+ /**
1243
+ * Describes the message operations_research.sat.SymmetryProto.
1244
+ * Use `create(SymmetryProtoSchema)` to create a new message.
1245
+ */
1246
+ export declare const SymmetryProtoSchema: GenMessage<SymmetryProto>;
1247
+ /**
1248
+ * A constraint programming problem.
1249
+ *
1250
+ * @generated from message operations_research.sat.CpModelProto
1251
+ */
1252
+ export type CpModelProto = Message<"operations_research.sat.CpModelProto"> & {
1253
+ /**
1254
+ * For debug/logging only. Can be empty.
1255
+ *
1256
+ * @generated from field: string name = 1;
1257
+ */
1258
+ name: string;
1259
+ /**
1260
+ * The associated Protos should be referred by their index in these fields.
1261
+ *
1262
+ * @generated from field: repeated operations_research.sat.IntegerVariableProto variables = 2;
1263
+ */
1264
+ variables: IntegerVariableProto[];
1265
+ /**
1266
+ * @generated from field: repeated operations_research.sat.ConstraintProto constraints = 3;
1267
+ */
1268
+ constraints: ConstraintProto[];
1269
+ /**
1270
+ * The objective to minimize. Can be empty for pure decision problems.
1271
+ *
1272
+ * @generated from field: operations_research.sat.CpObjectiveProto objective = 4;
1273
+ */
1274
+ objective?: CpObjectiveProto;
1275
+ /**
1276
+ * Advanced usage.
1277
+ * It is invalid to have both an objective and a floating point objective.
1278
+ *
1279
+ * The objective of the model, in floating point format. The solver will
1280
+ * automatically scale this to integer during expansion and thus convert it to
1281
+ * a normal CpObjectiveProto. See the mip* parameters to control how this is
1282
+ * scaled. In most situation the precision will be good enough, but you can
1283
+ * see the logs to see what are the precision guaranteed when this is
1284
+ * converted to a fixed point representation.
1285
+ *
1286
+ * Note that even if the precision is bad, the returned objective_value and
1287
+ * best_objective_bound will be computed correctly. So at the end of the solve
1288
+ * you can check the gap if you only want precise optimal.
1289
+ *
1290
+ * @generated from field: operations_research.sat.FloatObjectiveProto floating_point_objective = 9;
1291
+ */
1292
+ floatingPointObjective?: FloatObjectiveProto;
1293
+ /**
1294
+ * Defines the strategy that the solver should follow when the
1295
+ * search_branching parameter is set to FIXED_SEARCH. Note that this strategy
1296
+ * is also used as a heuristic when we are not in fixed search.
1297
+ *
1298
+ * Advanced Usage: if not all variables appears and the parameter
1299
+ * "instantiate_all_variables" is set to false, then the solver will not try
1300
+ * to instantiate the variables that do not appear. Thus, at the end of the
1301
+ * search, not all variables may be fixed. Currently, we will set them to
1302
+ * their lower bound in the solution.
1303
+ *
1304
+ * @generated from field: repeated operations_research.sat.DecisionStrategyProto search_strategy = 5;
1305
+ */
1306
+ searchStrategy: DecisionStrategyProto[];
1307
+ /**
1308
+ * Solution hint.
1309
+ *
1310
+ * If a feasible or almost-feasible solution to the problem is already known,
1311
+ * it may be helpful to pass it to the solver so that it can be used. The
1312
+ * solver will try to use this information to create its initial feasible
1313
+ * solution.
1314
+ *
1315
+ * Note that it may not always be faster to give a hint like this to the
1316
+ * solver. There is also no guarantee that the solver will use this hint or
1317
+ * try to return a solution "close" to this assignment in case of multiple
1318
+ * optimal solutions.
1319
+ *
1320
+ * @generated from field: operations_research.sat.PartialVariableAssignment solution_hint = 6;
1321
+ */
1322
+ solutionHint?: PartialVariableAssignment;
1323
+ /**
1324
+ * A list of literals. The model will be solved assuming all these literals
1325
+ * are true. Compared to just fixing the domain of these literals, using this
1326
+ * mechanism is slower but allows in case the model is INFEASIBLE to get a
1327
+ * potentially small subset of them that can be used to explain the
1328
+ * infeasibility.
1329
+ *
1330
+ * Think (IIS), except when you are only concerned by the provided
1331
+ * assumptions. This is powerful as it allows to group a set of logically
1332
+ * related constraint under only one enforcement literal which can potentially
1333
+ * give you a good and interpretable explanation for infeasiblity.
1334
+ *
1335
+ * Such infeasibility explanation will be available in the
1336
+ * sufficient_assumptions_for_infeasibility response field.
1337
+ *
1338
+ * @generated from field: repeated int32 assumptions = 7;
1339
+ */
1340
+ assumptions: number[];
1341
+ /**
1342
+ * For now, this is not meant to be filled by a client writing a model, but
1343
+ * by our preprocessing step.
1344
+ *
1345
+ * Information about the symmetries of the feasible solution space.
1346
+ * These usually leaves the objective invariant.
1347
+ *
1348
+ * @generated from field: operations_research.sat.SymmetryProto symmetry = 8;
1349
+ */
1350
+ symmetry?: SymmetryProto;
1351
+ };
1352
+ /**
1353
+ * Describes the message operations_research.sat.CpModelProto.
1354
+ * Use `create(CpModelProtoSchema)` to create a new message.
1355
+ */
1356
+ export declare const CpModelProtoSchema: GenMessage<CpModelProto>;
1357
+ /**
1358
+ * Just a message used to store dense solution.
1359
+ * This is used by the additional_solutions field.
1360
+ *
1361
+ * @generated from message operations_research.sat.CpSolverSolution
1362
+ */
1363
+ export type CpSolverSolution = Message<"operations_research.sat.CpSolverSolution"> & {
1364
+ /**
1365
+ * @generated from field: repeated int64 values = 1;
1366
+ */
1367
+ values: bigint[];
1368
+ };
1369
+ /**
1370
+ * Describes the message operations_research.sat.CpSolverSolution.
1371
+ * Use `create(CpSolverSolutionSchema)` to create a new message.
1372
+ */
1373
+ export declare const CpSolverSolutionSchema: GenMessage<CpSolverSolution>;
1374
+ /**
1375
+ * The response returned by a solver trying to solve a CpModelProto.
1376
+ *
1377
+ * Next id: 32
1378
+ *
1379
+ * @generated from message operations_research.sat.CpSolverResponse
1380
+ */
1381
+ export type CpSolverResponse = Message<"operations_research.sat.CpSolverResponse"> & {
1382
+ /**
1383
+ * The status of the solve.
1384
+ *
1385
+ * @generated from field: operations_research.sat.CpSolverStatus status = 1;
1386
+ */
1387
+ status: CpSolverStatus;
1388
+ /**
1389
+ * A feasible solution to the given problem. Depending on the returned status
1390
+ * it may be optimal or just feasible. This is in one-to-one correspondence
1391
+ * with a CpModelProto::variables repeated field and list the values of all
1392
+ * the variables.
1393
+ *
1394
+ * @generated from field: repeated int64 solution = 2;
1395
+ */
1396
+ solution: bigint[];
1397
+ /**
1398
+ * Only make sense for an optimization problem. The objective value of the
1399
+ * returned solution if it is non-empty. If there is no solution, then for a
1400
+ * minimization problem, this will be an upper-bound of the objective of any
1401
+ * feasible solution, and a lower-bound for a maximization problem.
1402
+ *
1403
+ * @generated from field: double objective_value = 3;
1404
+ */
1405
+ objectiveValue: number;
1406
+ /**
1407
+ * Only make sense for an optimization problem. A proven lower-bound on the
1408
+ * objective for a minimization problem, or a proven upper-bound for a
1409
+ * maximization problem.
1410
+ *
1411
+ * @generated from field: double best_objective_bound = 4;
1412
+ */
1413
+ bestObjectiveBound: number;
1414
+ /**
1415
+ * If the parameter fill_additional_solutions_in_response is set, then we
1416
+ * copy all the solutions from our internal solution pool here.
1417
+ *
1418
+ * Note that the one returned in the solution field will likely appear here
1419
+ * too. Do not rely on the solutions order as it depends on our internal
1420
+ * representation (after postsolve).
1421
+ *
1422
+ * @generated from field: repeated operations_research.sat.CpSolverSolution additional_solutions = 27;
1423
+ */
1424
+ additionalSolutions: CpSolverSolution[];
1425
+ /**
1426
+ * Advanced usage.
1427
+ *
1428
+ * If the option fill_tightened_domains_in_response is set, then this field
1429
+ * will be a copy of the CpModelProto.variables where each domain has been
1430
+ * reduced using the information the solver was able to derive. Note that this
1431
+ * is only filled with the info derived during a normal search and we do not
1432
+ * have any dedicated algorithm to improve it.
1433
+ *
1434
+ * Warning: if you didn't set keep_all_feasible_solutions_in_presolve, then
1435
+ * these domains might exclude valid feasible solution. Otherwise for a
1436
+ * feasibility problem, all feasible solution should be there.
1437
+ *
1438
+ * Warning: For an optimization problem, these will correspond to valid bounds
1439
+ * for the problem of finding an improving solution to the best one found so
1440
+ * far. It might be better to solve a feasibility version if one just want to
1441
+ * explore the feasible region.
1442
+ *
1443
+ * @generated from field: repeated operations_research.sat.IntegerVariableProto tightened_variables = 21;
1444
+ */
1445
+ tightenedVariables: IntegerVariableProto[];
1446
+ /**
1447
+ * A subset of the model "assumptions" field. This will only be filled if the
1448
+ * status is INFEASIBLE. This subset of assumption will be enough to still get
1449
+ * an infeasible problem.
1450
+ *
1451
+ * This is related to what is called the irreducible inconsistent subsystem or
1452
+ * IIS. Except one is only concerned by the provided assumptions. There is
1453
+ * also no guarantee that we return an irreducible (aka minimal subset).
1454
+ * However, this is based on SAT explanation and there is a good chance it is
1455
+ * not too large.
1456
+ *
1457
+ * If you really want a minimal subset, a possible way to get one is by
1458
+ * changing your model to minimize the number of assumptions at false, but
1459
+ * this is likely an harder problem to solve.
1460
+ *
1461
+ * Important: Currently, this is minimized only in single-thread and if the
1462
+ * problem is not an optimization problem, otherwise, it will always include
1463
+ * all the assumptions.
1464
+ *
1465
+ * TODO(user): Allows for returning multiple core at once.
1466
+ *
1467
+ * @generated from field: repeated int32 sufficient_assumptions_for_infeasibility = 23;
1468
+ */
1469
+ sufficientAssumptionsForInfeasibility: number[];
1470
+ /**
1471
+ * Contains the integer objective optimized internally. This is only filled if
1472
+ * the problem had a floating point objective, and on the final response, not
1473
+ * the ones given to callbacks.
1474
+ *
1475
+ * @generated from field: operations_research.sat.CpObjectiveProto integer_objective = 28;
1476
+ */
1477
+ integerObjective?: CpObjectiveProto;
1478
+ /**
1479
+ * Advanced usage.
1480
+ *
1481
+ * A lower bound on the integer expression of the objective. This is either a
1482
+ * bound on the expression in the returned integer_objective or on the integer
1483
+ * expression of the original objective if the problem already has an integer
1484
+ * objective.
1485
+ *
1486
+ * TODO(user): This should be renamed integer_objective_lower_bound.
1487
+ *
1488
+ * @generated from field: int64 inner_objective_lower_bound = 29;
1489
+ */
1490
+ innerObjectiveLowerBound: bigint;
1491
+ /**
1492
+ * Some statistics about the solve.
1493
+ *
1494
+ * Important: in multithread, this correspond the statistics of the first
1495
+ * subsolver. Which is usually the one with the user defined parameters. Or
1496
+ * the default-search if none are specified.
1497
+ *
1498
+ * @generated from field: int64 num_integers = 30;
1499
+ */
1500
+ numIntegers: bigint;
1501
+ /**
1502
+ * @generated from field: int64 num_booleans = 10;
1503
+ */
1504
+ numBooleans: bigint;
1505
+ /**
1506
+ * @generated from field: int64 num_fixed_booleans = 31;
1507
+ */
1508
+ numFixedBooleans: bigint;
1509
+ /**
1510
+ * @generated from field: int64 num_conflicts = 11;
1511
+ */
1512
+ numConflicts: bigint;
1513
+ /**
1514
+ * @generated from field: int64 num_branches = 12;
1515
+ */
1516
+ numBranches: bigint;
1517
+ /**
1518
+ * @generated from field: int64 num_binary_propagations = 13;
1519
+ */
1520
+ numBinaryPropagations: bigint;
1521
+ /**
1522
+ * @generated from field: int64 num_integer_propagations = 14;
1523
+ */
1524
+ numIntegerPropagations: bigint;
1525
+ /**
1526
+ * @generated from field: int64 num_restarts = 24;
1527
+ */
1528
+ numRestarts: bigint;
1529
+ /**
1530
+ * @generated from field: int64 num_lp_iterations = 25;
1531
+ */
1532
+ numLpIterations: bigint;
1533
+ /**
1534
+ * The time counted from the beginning of the Solve() call.
1535
+ *
1536
+ * @generated from field: double wall_time = 15;
1537
+ */
1538
+ wallTime: number;
1539
+ /**
1540
+ * @generated from field: double user_time = 16;
1541
+ */
1542
+ userTime: number;
1543
+ /**
1544
+ * @generated from field: double deterministic_time = 17;
1545
+ */
1546
+ deterministicTime: number;
1547
+ /**
1548
+ * The integral of log(1 + absolute_objective_gap) over time.
1549
+ *
1550
+ * @generated from field: double gap_integral = 22;
1551
+ */
1552
+ gapIntegral: number;
1553
+ /**
1554
+ * Additional information about how the solution was found. It also stores
1555
+ * model or parameters errors that caused the model to be invalid.
1556
+ *
1557
+ * @generated from field: string solution_info = 20;
1558
+ */
1559
+ solutionInfo: string;
1560
+ /**
1561
+ * The solve log will be filled if the parameter log_to_response is set to
1562
+ * true.
1563
+ *
1564
+ * @generated from field: string solve_log = 26;
1565
+ */
1566
+ solveLog: string;
1567
+ };
1568
+ /**
1569
+ * Describes the message operations_research.sat.CpSolverResponse.
1570
+ * Use `create(CpSolverResponseSchema)` to create a new message.
1571
+ */
1572
+ export declare const CpSolverResponseSchema: GenMessage<CpSolverResponse>;
1573
+ /**
1574
+ * The status returned by a solver trying to solve a CpModelProto.
1575
+ *
1576
+ * @generated from enum operations_research.sat.CpSolverStatus
1577
+ */
1578
+ export declare enum CpSolverStatus {
1579
+ /**
1580
+ * The status of the model is still unknown. A search limit has been reached
1581
+ * before any of the statuses below could be determined.
1582
+ *
1583
+ * @generated from enum value: UNKNOWN = 0;
1584
+ */
1585
+ UNKNOWN = 0,
1586
+ /**
1587
+ * The given CpModelProto didn't pass the validation step. You can get a
1588
+ * detailed error by calling ValidateCpModel(model_proto).
1589
+ *
1590
+ * @generated from enum value: MODEL_INVALID = 1;
1591
+ */
1592
+ MODEL_INVALID = 1,
1593
+ /**
1594
+ * A feasible solution has been found. But the search was stopped before we
1595
+ * could prove optimality or before we enumerated all solutions of a
1596
+ * feasibility problem (if asked).
1597
+ *
1598
+ * @generated from enum value: FEASIBLE = 2;
1599
+ */
1600
+ FEASIBLE = 2,
1601
+ /**
1602
+ * The problem has been proven infeasible.
1603
+ *
1604
+ * @generated from enum value: INFEASIBLE = 3;
1605
+ */
1606
+ INFEASIBLE = 3,
1607
+ /**
1608
+ * An optimal feasible solution has been found.
1609
+ *
1610
+ * More generally, this status represent a success. So we also return OPTIMAL
1611
+ * if we find a solution for a pure feasibility problem or if a gap limit has
1612
+ * been specified and we return a solution within this limit. In the case
1613
+ * where we need to return all the feasible solution, this status will only be
1614
+ * returned if we enumerated all of them; If we stopped before, we will return
1615
+ * FEASIBLE.
1616
+ *
1617
+ * @generated from enum value: OPTIMAL = 4;
1618
+ */
1619
+ OPTIMAL = 4
1620
+ }
1621
+ /**
1622
+ * Describes the enum operations_research.sat.CpSolverStatus.
1623
+ */
1624
+ export declare const CpSolverStatusSchema: GenEnum<CpSolverStatus>;
1625
+ //# sourceMappingURL=cp_model_pb.d.ts.map