ommx 2.1.0

Open Mathematical prograMming eXchange (OMMX)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
// This file is @generated by prost-build.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Linear {
    #[prost(message, repeated, tag = "1")]
    pub terms: ::prost::alloc::vec::Vec<linear::Term>,
    #[prost(double, tag = "2")]
    pub constant: f64,
}
/// Nested message and enum types in `Linear`.
pub mod linear {
    #[non_exhaustive]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Term {
        #[prost(uint64, tag = "1")]
        pub id: u64,
        #[prost(double, tag = "2")]
        pub coefficient: f64,
    }
}
/// A monomial in a multivariate polynomial.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Monomial {
    #[prost(uint64, repeated, tag = "1")]
    pub ids: ::prost::alloc::vec::Vec<u64>,
    #[prost(double, tag = "2")]
    pub coefficient: f64,
}
/// Multi­variate polynomial
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Polynomial {
    #[prost(message, repeated, tag = "1")]
    pub terms: ::prost::alloc::vec::Vec<Monomial>,
}
/// Quadratic function as a COO-style sparse matrix and linear sparse vector.
///
/// COOrdinate format, also known as triplet format, is a way to represent sparse matrices as a list of non-zero elements.
/// It consists of three lists: the row indices, the column indices, and the values of the non-zero elements with following constraints:
///
/// - Entries and coordinates sorted by row, then column.
/// - There are no duplicate entries (i.e. duplicate (i,j) locations)
/// - Data arrays MAY have explicit zeros.
///
/// Note that this matrix is not assured to be symmetric nor upper triangular.
/// For example, a quadratic function `x1^2 + x2^2 + 2x1*x2` can be represented as:
///
/// - `{ rows: \[0, 0, 1\], columns: \[0, 1, 1\], values: \[1, 2, 1\] }`, i.e. an upper triangular matrix `\[[1, 2\], \[0, 1\]`
/// - `{ rows: \[0, 0, 1, 1\], columns: \[0, 1, 0, 1\], values: \[1, 1, 1, 1\] }`, i.e. a symmetric matrix `\[[1, 1\], \[1, 1]\]`
///
/// or even a non-symmetric, non-trianglar matrix as `x1^2 + 3x1*x2 - x2*x1 + x2^2`:
///
/// - `{ rows: \[0, 0, 1, 1\], columns: \[0, 1, 0, 1\], values: \[1, 3, -1, 1\] }`, i.e. a non-symmetric matrix `\[[1, 3\], \[-1, 1]\]`
///
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Quadratic {
    #[prost(uint64, repeated, tag = "1")]
    pub rows: ::prost::alloc::vec::Vec<u64>,
    #[prost(uint64, repeated, tag = "2")]
    pub columns: ::prost::alloc::vec::Vec<u64>,
    #[prost(double, repeated, tag = "3")]
    pub values: ::prost::alloc::vec::Vec<f64>,
    #[prost(message, optional, tag = "4")]
    pub linear: ::core::option::Option<Linear>,
}
/// Real-valued multivariate function used for objective function and constraints.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Function {
    #[prost(oneof = "function::Function", tags = "1, 2, 3, 4")]
    pub function: ::core::option::Option<function::Function>,
}
/// Nested message and enum types in `Function`.
pub mod function {
    #[non_exhaustive]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Function {
        /// Constant function like `f(x_1, x_2) = 2`
        #[prost(double, tag = "1")]
        Constant(f64),
        /// Linear function like `f(x_1, x_2) = 2 x_1 + 3 x_2`
        #[prost(message, tag = "2")]
        Linear(super::Linear),
        /// Quadratic function like `f(x_1, x_2) = 4 x_1 x_2 + 5 x_2`
        #[prost(message, tag = "3")]
        Quadratic(super::Quadratic),
        /// Polynomial like `f(x_1, x_2) = 4 x_1^2 + 5 x_2^3 + 6 x_1 x_2^2 + 7 x_2^2 + 8 x_1 x_2 + 9 x_1 + 10 x_2 + 11`
        #[prost(message, tag = "4")]
        Polynomial(super::Polynomial),
    }
}
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Constraint {
    /// Constraint ID
    ///
    /// - Constraint IDs are managed separately from decision variable IDs.
    ///    We can use the same ID for both. For example, we have a decision variable `x` with decision variable ID `1``
    ///    and constraint `x == 0` with constraint ID `1`.
    /// - IDs are not required to be sequential.
    /// - IDs must be unique with other types of constraints.
    #[prost(uint64, tag = "1")]
    pub id: u64,
    #[prost(enumeration = "Equality", tag = "2")]
    pub equality: i32,
    #[prost(message, optional, tag = "3")]
    pub function: ::core::option::Option<Function>,
    /// Integer parameters of the constraint.
    ///
    /// Consider for example a problem constains a series of constraints `x\[i, j\] + y\[i, j\] <= 10` for `i = 1, 2, 3` and `j = 4, 5`,
    /// then 6 = 3x2 `Constraint` messages should be created corresponding to each pair of `i` and `j`.
    /// The `name` field of this message is intended to be a human-readable name of `x\[i, j\] + y\[i, j\] <= 10`,
    /// and the `subscripts` field is intended to be the value of `\[i, j\]` like `\[1, 5\]`.
    ///
    #[prost(int64, repeated, tag = "8")]
    pub subscripts: ::prost::alloc::vec::Vec<i64>,
    /// Key-value parameters of the constraint.
    #[prost(map = "string, string", tag = "5")]
    pub parameters:
        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Name of the constraint.
    #[prost(string, optional, tag = "6")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    /// Detail human-readable description of the constraint.
    #[prost(string, optional, tag = "7")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
}
/// A constraint evaluated with a state
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EvaluatedConstraint {
    #[prost(uint64, tag = "1")]
    pub id: u64,
    #[prost(enumeration = "Equality", tag = "2")]
    pub equality: i32,
    /// The value of function for the state
    #[prost(double, tag = "3")]
    pub evaluated_value: f64,
    /// IDs of decision variables used to evalute this constraint
    #[prost(uint64, repeated, tag = "4")]
    pub used_decision_variable_ids: ::prost::alloc::vec::Vec<u64>,
    /// Integer parameters of the constraint.
    #[prost(int64, repeated, tag = "9")]
    pub subscripts: ::prost::alloc::vec::Vec<i64>,
    /// Key-value parameters of the constraint.
    #[prost(map = "string, string", tag = "5")]
    pub parameters:
        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Name of the constraint.
    #[prost(string, optional, tag = "6")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    /// Detail human-readable description of the constraint.
    #[prost(string, optional, tag = "7")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    /// Value for the Lagrangian dual variable of this constraint.
    /// This is optional because not all solvers support to evaluate dual variables.
    #[prost(double, optional, tag = "8")]
    pub dual_variable: ::core::option::Option<f64>,
    /// Short removed reason of the constraint. This field exists only if this message is evaluated from a removed constraint.
    #[prost(string, optional, tag = "10")]
    pub removed_reason: ::core::option::Option<::prost::alloc::string::String>,
    /// Detailed parameters why the constraint is removed. This field exists only if this message is evaluated from a removed constraint.
    #[prost(map = "string, string", tag = "11")]
    pub removed_reason_parameters:
        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RemovedConstraint {
    /// The removed constraint
    #[prost(message, optional, tag = "1")]
    pub constraint: ::core::option::Option<Constraint>,
    /// Short reason why the constraint was removed.
    ///
    /// This should be the name of method, function or application which remove the constraint.
    #[prost(string, tag = "2")]
    pub removed_reason: ::prost::alloc::string::String,
    /// Arbitrary key-value parameters representing why the constraint was removed.
    ///
    /// This should be human-readable and can be used for debugging.
    #[prost(map = "string, string", tag = "3")]
    pub removed_reason_parameters:
        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
/// Equality of a constraint.
#[non_exhaustive]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Equality {
    Unspecified = 0,
    EqualToZero = 1,
    LessThanOrEqualToZero = 2,
}
impl Equality {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Equality::Unspecified => "EQUALITY_UNSPECIFIED",
            Equality::EqualToZero => "EQUALITY_EQUAL_TO_ZERO",
            Equality::LessThanOrEqualToZero => "EQUALITY_LESS_THAN_OR_EQUAL_TO_ZERO",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "EQUALITY_UNSPECIFIED" => Some(Self::Unspecified),
            "EQUALITY_EQUAL_TO_ZERO" => Some(Self::EqualToZero),
            "EQUALITY_LESS_THAN_OR_EQUAL_TO_ZERO" => Some(Self::LessThanOrEqualToZero),
            _ => None,
        }
    }
}
/// A message representing a one-hot constraint.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OneHot {
    /// The ID of the constraint.
    #[prost(uint64, tag = "1")]
    pub constraint_id: u64,
    /// The list of ids of decision variables that are constrained to be one-hot.
    #[prost(uint64, repeated, tag = "2")]
    pub decision_variables: ::prost::alloc::vec::Vec<u64>,
}
/// A message representing a [Spcial Ordered Set constraint of Type 1](<https://en.wikipedia.org/wiki/Special_ordered_set#Types>) (SOS1).
/// SOS1 constraint on non-negative variables x_1, ..., x_n
/// requires that at most one of x_i can be non-zero.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Sos1 {
    /// The ID of the SOS1 constraint on binary variables.
    #[prost(uint64, tag = "1")]
    pub binary_constraint_id: u64,
    /// The IDs of the big-M constraint on non-binary variables.
    #[prost(uint64, repeated, tag = "2")]
    pub big_m_constraint_ids: ::prost::alloc::vec::Vec<u64>,
    /// The list of ids of decision variables that are constrained to be one-hot.
    #[prost(uint64, repeated, tag = "3")]
    pub decision_variables: ::prost::alloc::vec::Vec<u64>,
}
/// A constraint hint is an additional inforomation to be used by solver to gain performance.
/// They are derived from one-or-more constraints in the instance and typically contains information of special types of constraints (e.g. one-hot, SOS, ...).
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConstraintHints {
    /// One-hot constraint: e.g. `x_1 + ... + x_n = 1` for binary variables `x_1, ..., x_n`.
    #[prost(message, repeated, tag = "2")]
    pub one_hot_constraints: ::prost::alloc::vec::Vec<OneHot>,
    /// SOS1 constraint: at most one of x_1, ..., x_n can be non-zero.
    #[prost(message, repeated, tag = "3")]
    pub sos1_constraints: ::prost::alloc::vec::Vec<Sos1>,
}
/// Upper and lower bound of the decision variable.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Bound {
    /// Lower bound of the decision variable.
    #[prost(double, tag = "1")]
    pub lower: f64,
    /// Upper bound of the decision variable.
    #[prost(double, tag = "2")]
    pub upper: f64,
}
/// Decison variable which mathematical programming solver will optimize.
/// It must have its kind, i.e. binary, integer, real or others and unique identifier of 64-bit integer.
/// It may have its name and subscripts which are used to identify in modeling tools.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DecisionVariable {
    /// Decision variable ID.
    ///
    /// - IDs are not required to be sequential.
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Kind of the decision variable
    #[prost(enumeration = "decision_variable::Kind", tag = "2")]
    pub kind: i32,
    /// Bound of the decision variable
    /// If the bound is not specified, the decision variable is considered as unbounded.
    #[prost(message, optional, tag = "3")]
    pub bound: ::core::option::Option<Bound>,
    /// Name of the decision variable. e.g. `x`
    #[prost(string, optional, tag = "4")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    /// Subscripts of the decision variable. e.g. `\[1, 3\]` for an element of multidimensional deicion variable `x\[1, 3\]`
    #[prost(int64, repeated, tag = "5")]
    pub subscripts: ::prost::alloc::vec::Vec<i64>,
    /// Additional parameters for decision variables
    #[prost(map = "string, string", tag = "6")]
    pub parameters:
        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Detail human-readable description of the decision variable.
    #[prost(string, optional, tag = "7")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    /// The value substituted by partial evaluation of the instance. Not determined by the solver.
    #[prost(double, optional, tag = "8")]
    pub substituted_value: ::core::option::Option<f64>,
}
/// Nested message and enum types in `DecisionVariable`.
pub mod decision_variable {
    /// Kind of the decision variable
    #[non_exhaustive]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Kind {
        Unspecified = 0,
        Binary = 1,
        Integer = 2,
        Continuous = 3,
        /// Semi-integer decision variable is a decision variable that can take only integer values in the given range or zero.
        SemiInteger = 4,
        /// Semi-continuous decision variable is a decision variable that can take only continuous values in the given range or zero.
        SemiContinuous = 5,
    }
    impl Kind {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Kind::Unspecified => "KIND_UNSPECIFIED",
                Kind::Binary => "KIND_BINARY",
                Kind::Integer => "KIND_INTEGER",
                Kind::Continuous => "KIND_CONTINUOUS",
                Kind::SemiInteger => "KIND_SEMI_INTEGER",
                Kind::SemiContinuous => "KIND_SEMI_CONTINUOUS",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "KIND_UNSPECIFIED" => Some(Self::Unspecified),
                "KIND_BINARY" => Some(Self::Binary),
                "KIND_INTEGER" => Some(Self::Integer),
                "KIND_CONTINUOUS" => Some(Self::Continuous),
                "KIND_SEMI_INTEGER" => Some(Self::SemiInteger),
                "KIND_SEMI_CONTINUOUS" => Some(Self::SemiContinuous),
                _ => None,
            }
        }
    }
}
/// A set of parameters for instantiating an optimization problem from a parametric instance
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Parameters {
    #[prost(map = "uint64, double", tag = "1")]
    pub entries: ::std::collections::HashMap<u64, f64>,
}
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Instance {
    #[prost(message, optional, tag = "1")]
    pub description: ::core::option::Option<instance::Description>,
    /// Decision variables used in this instance
    ///
    /// - This must constain every decision variables used in the objective and constraints.
    /// - This can contains a decision variable that is not used in the objective or constraints.
    #[prost(message, repeated, tag = "2")]
    pub decision_variables: ::prost::alloc::vec::Vec<DecisionVariable>,
    #[prost(message, optional, tag = "3")]
    pub objective: ::core::option::Option<Function>,
    /// Constraints of the optimization problem
    #[prost(message, repeated, tag = "4")]
    pub constraints: ::prost::alloc::vec::Vec<Constraint>,
    /// The sense of this problem, i.e. minimize the objective or maximize it.
    ///
    /// Design decision note:
    /// - This is a required field. Most mathematical modeling tools allow for an empty sense and default to minimization. Alternatively, some tools do not create such a field and represent maximization problems by negating the objective function. This project prefers explicit descriptions over implicit ones to avoid such ambiguity and to make it unnecessary for developers to look up the reference for the treatment of omitted cases.
    ///
    #[prost(enumeration = "instance::Sense", tag = "5")]
    pub sense: i32,
    /// Parameters used when instantiating this instance
    #[prost(message, optional, tag = "6")]
    pub parameters: ::core::option::Option<Parameters>,
    /// Constraint hints to be used by solver to gain performance. They are derived from one-or-more constraints in the instance and typically contains information of special types of constraints (e.g. one-hot, SOS, ...).
    #[prost(message, optional, tag = "7")]
    pub constraint_hints: ::core::option::Option<ConstraintHints>,
    /// Constraints removed via preprocessing. These are restored when evaluated into `ommx.v1.Solution`.
    #[prost(message, repeated, tag = "8")]
    pub removed_constraints: ::prost::alloc::vec::Vec<RemovedConstraint>,
    /// When a decision variable is dependent on another decision variable as polynomial, this map contains the ID of the dependent decision variable as key and the polynomial as value.
    #[prost(map = "uint64, message", tag = "9")]
    pub decision_variable_dependency: ::std::collections::HashMap<u64, Function>,
}
/// Nested message and enum types in `Instance`.
pub mod instance {
    #[non_exhaustive]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Description {
        #[prost(string, optional, tag = "1")]
        pub name: ::core::option::Option<::prost::alloc::string::String>,
        #[prost(string, optional, tag = "2")]
        pub description: ::core::option::Option<::prost::alloc::string::String>,
        #[prost(string, repeated, tag = "3")]
        pub authors: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
        /// The application or library name that created this message.
        #[prost(string, optional, tag = "4")]
        pub created_by: ::core::option::Option<::prost::alloc::string::String>,
    }
    /// The sense of this instance
    #[non_exhaustive]
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
    #[repr(i32)]
    pub enum Sense {
        Unspecified = 0,
        Minimize = 1,
        Maximize = 2,
    }
    impl Sense {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Sense::Unspecified => "SENSE_UNSPECIFIED",
                Sense::Minimize => "SENSE_MINIMIZE",
                Sense::Maximize => "SENSE_MAXIMIZE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "SENSE_UNSPECIFIED" => Some(Self::Unspecified),
                "SENSE_MINIMIZE" => Some(Self::Minimize),
                "SENSE_MAXIMIZE" => Some(Self::Maximize),
                _ => None,
            }
        }
    }
}
/// Placeholder of a parameter in a parametrized optimization problem
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Parameter {
    /// ID for the parameter
    ///
    /// - IDs are not required to be sequential.
    /// - The ID must be unique within the instance including the decision variables.
    #[prost(uint64, tag = "1")]
    pub id: u64,
    /// Name of the parameter. e.g. `x`
    #[prost(string, optional, tag = "2")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    /// Subscripts of the parameter, same usage as DecisionVariable.subscripts
    #[prost(int64, repeated, tag = "3")]
    pub subscripts: ::prost::alloc::vec::Vec<i64>,
    /// Additional metadata for the parameter, same usage as DecisionVariable.parameters
    #[prost(map = "string, string", tag = "4")]
    pub parameters:
        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Human-readable description for the parameter
    #[prost(string, optional, tag = "5")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
}
/// Optimization problem including parameter, variables varying while solving the problem like penalty weights or dual variables.
/// These parameters are not decision variables.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ParametricInstance {
    #[prost(message, optional, tag = "1")]
    pub description: ::core::option::Option<instance::Description>,
    /// Decision variables used in this instance
    #[prost(message, repeated, tag = "2")]
    pub decision_variables: ::prost::alloc::vec::Vec<DecisionVariable>,
    /// Parameters of this instance
    ///
    /// - The ID must be unique within the instance including the decision variables.
    #[prost(message, repeated, tag = "3")]
    pub parameters: ::prost::alloc::vec::Vec<Parameter>,
    /// Objective function of the optimization problem. This may contain parameters in addition to the decision variables.
    #[prost(message, optional, tag = "4")]
    pub objective: ::core::option::Option<Function>,
    /// Constraints of the optimization problem. This may contain parameters in addition to the decision variables.
    #[prost(message, repeated, tag = "5")]
    pub constraints: ::prost::alloc::vec::Vec<Constraint>,
    /// The sense of this problem, i.e. minimize the objective or maximize it.
    #[prost(enumeration = "instance::Sense", tag = "6")]
    pub sense: i32,
    /// Constraint hints to be used by solver to gain performance. They are derived from one-or-more constraints in the instance and typically contains information of special types of constraints (e.g. one-hot, SOS, ...).
    #[prost(message, optional, tag = "7")]
    pub constraint_hints: ::core::option::Option<ConstraintHints>,
    /// Constraints removed via preprocessing. These are restored when evaluated into `ommx.v1.Solution`.
    #[prost(message, repeated, tag = "8")]
    pub removed_constraints: ::prost::alloc::vec::Vec<RemovedConstraint>,
    /// When a decision variable is dependent on another decision variable as polynomial, this map contains the ID of the dependent decision variable as key and the polynomial as value.
    #[prost(map = "uint64, message", tag = "9")]
    pub decision_variable_dependency: ::std::collections::HashMap<u64, Function>,
}
/// A set of values of decision variables, without any evaluation, even the
/// feasiblity of the solution.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct State {
    /// The value of the solution for each variable ID.
    #[prost(map = "uint64, double", tag = "1")]
    pub entries: ::std::collections::HashMap<u64, f64>,
}
/// Solution with evaluated objective and constraints
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Solution {
    #[prost(message, optional, tag = "1")]
    pub state: ::core::option::Option<State>,
    #[prost(double, tag = "2")]
    pub objective: f64,
    #[prost(message, repeated, tag = "3")]
    pub decision_variables: ::prost::alloc::vec::Vec<DecisionVariable>,
    #[prost(message, repeated, tag = "4")]
    pub evaluated_constraints: ::prost::alloc::vec::Vec<EvaluatedConstraint>,
    /// The feasibility of the solution for all, remaining and removed constraints.
    ///
    /// The feasibility for the remaining constraints is represented by the `feasible_relaxed` field.
    #[prost(bool, tag = "5")]
    pub feasible: bool,
    /// Feasibility of the solution for remaining constraints, ignoring removed constraints.
    ///
    /// This is optional due to the backward compatibility.
    /// If this field is NULL, the `feasible` field represents relaxed feasibility,
    /// and the deprecated `feasible_unrelaxed` field represents the feasibility including removed constraints.
    #[prost(bool, optional, tag = "9")]
    pub feasible_relaxed: ::core::option::Option<bool>,
    /// \[DEPRECATED\] Feasibility of the solution for all constraints.
    /// This field has been introduced in Python SDK 1.6.0 and deprecated in 1.7.0.
    /// The feasibility in this sense is represented by the `feasible` field after 1.7.0.
    #[deprecated]
    #[prost(bool, tag = "8")]
    pub feasible_unrelaxed: bool,
    /// The optimality of the solution.
    #[prost(enumeration = "Optimality", tag = "6")]
    pub optimality: i32,
    /// Whether the solution is obtained by a relaxed linear programming solver.
    #[prost(enumeration = "Relaxation", tag = "7")]
    pub relaxation: i32,
    /// Whether the problem is a minimization or maximization problem.
    #[prost(enumeration = "instance::Sense", tag = "10")]
    pub sense: i32,
}
/// The solver proved that the problem is infeasible.
///
/// TODO: Add more information about the infeasibility.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Infeasible {}
/// The solver proved that the problem is unbounded.
///
/// TODO: Add more information about the unboundedness.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Unbounded {}
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Result {
    #[prost(oneof = "result::Result", tags = "1, 2, 3, 4")]
    pub result: ::core::option::Option<result::Result>,
}
/// Nested message and enum types in `Result`.
pub mod result {
    #[non_exhaustive]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Result {
        /// Error information by the solver which cannot be expressed by other messages.
        /// This string should be human-readable.
        #[prost(string, tag = "1")]
        Error(::prost::alloc::string::String),
        /// Some feasible or infeasible solution for the problem is found. Most of heuristic solvers should use this value.
        #[prost(message, tag = "2")]
        Solution(super::Solution),
        /// The solver proved that the problem is infeasible, i.e. all solutions of the problem are infeasible.
        /// If the solver cannot get the proof of infeasibility,
        /// and just cannot find any feasible solution due to the time limit or due to heuristic algorithm limitation,
        /// the solver should return its *best* `Solution` message with `feasible` field set to `false`.
        #[prost(message, tag = "3")]
        Infeasible(super::Infeasible),
        /// The solver proved that the problem is unbounded.
        #[prost(message, tag = "4")]
        Unbounded(super::Unbounded),
    }
}
#[non_exhaustive]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Optimality {
    /// The solver cannot determine whether the solution is optimal. Most of heuristic solvers should use this value.
    Unspecified = 0,
    /// The solver has determined that the solution is optimal.
    Optimal = 1,
    /// The solver has determined that the solution is not optimal.
    NotOptimal = 2,
}
impl Optimality {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Optimality::Unspecified => "OPTIMALITY_UNSPECIFIED",
            Optimality::Optimal => "OPTIMALITY_OPTIMAL",
            Optimality::NotOptimal => "OPTIMALITY_NOT_OPTIMAL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "OPTIMALITY_UNSPECIFIED" => Some(Self::Unspecified),
            "OPTIMALITY_OPTIMAL" => Some(Self::Optimal),
            "OPTIMALITY_NOT_OPTIMAL" => Some(Self::NotOptimal),
            _ => None,
        }
    }
}
#[non_exhaustive]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum Relaxation {
    /// No relaxation is used.
    Unspecified = 0,
    /// The solution is obtained by a relaxed linear programming problem.
    LpRelaxed = 1,
}
impl Relaxation {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Relaxation::Unspecified => "RELAXATION_UNSPECIFIED",
            Relaxation::LpRelaxed => "RELAXATION_LP_RELAXED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "RELAXATION_UNSPECIFIED" => Some(Self::Unspecified),
            "RELAXATION_LP_RELAXED" => Some(Self::LpRelaxed),
            _ => None,
        }
    }
}
/// A map from sample ID to state
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Samples {
    #[prost(message, repeated, tag = "1")]
    pub entries: ::prost::alloc::vec::Vec<samples::SamplesEntry>,
}
/// Nested message and enum types in `Samples`.
pub mod samples {
    /// Sampling processes are likely to generate same samples multiple times. We compress the same samples into one entry.
    /// Note that uncompressed state is also valid. The reader should not assume that every states are distinct.
    #[non_exhaustive]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct SamplesEntry {
        /// State of the sample
        #[prost(message, optional, tag = "1")]
        pub state: ::core::option::Option<super::State>,
        /// IDs of the sample
        #[prost(uint64, repeated, tag = "2")]
        pub ids: ::prost::alloc::vec::Vec<u64>,
    }
}
/// A map from sample IDs to sampled values
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SampledValues {
    #[prost(message, repeated, tag = "1")]
    pub entries: ::prost::alloc::vec::Vec<sampled_values::SampledValuesEntry>,
}
/// Nested message and enum types in `SampledValues`.
pub mod sampled_values {
    /// Compressed sampled values, but uncompressed state is also valid. The reader should not assume that every states are distinct.
    #[non_exhaustive]
    #[allow(clippy::derive_partial_eq_without_eq)]
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct SampledValuesEntry {
        #[prost(double, tag = "1")]
        pub value: f64,
        /// IDs of the sample
        #[prost(uint64, repeated, tag = "2")]
        pub ids: ::prost::alloc::vec::Vec<u64>,
    }
}
/// A pair of decision variable description and its sampled values
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SampledDecisionVariable {
    #[prost(message, optional, tag = "1")]
    pub decision_variable: ::core::option::Option<DecisionVariable>,
    /// Sampled values of decision variable. This becomes `None` if the decision variable is not sampled.
    #[prost(message, optional, tag = "2")]
    pub samples: ::core::option::Option<SampledValues>,
}
/// Evaluated constraint for samples
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SampledConstraint {
    /// Constraint ID
    #[prost(uint64, tag = "1")]
    pub id: u64,
    #[prost(enumeration = "Equality", tag = "2")]
    pub equality: i32,
    /// Name of the constraint.
    #[prost(string, optional, tag = "3")]
    pub name: ::core::option::Option<::prost::alloc::string::String>,
    /// Integer parameters of the constraint.
    #[prost(int64, repeated, tag = "4")]
    pub subscripts: ::prost::alloc::vec::Vec<i64>,
    /// Key-value parameters of the constraint.
    #[prost(map = "string, string", tag = "5")]
    pub parameters:
        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Detail human-readable description of the constraint.
    #[prost(string, optional, tag = "6")]
    pub description: ::core::option::Option<::prost::alloc::string::String>,
    /// Short removed reason of the constraint. This field exists only if this message is evaluated from a removed constraint.
    #[prost(string, optional, tag = "7")]
    pub removed_reason: ::core::option::Option<::prost::alloc::string::String>,
    /// Detailed parameters why the constraint is removed. This field exists only if this message is evaluated from a removed constraint.
    #[prost(map = "string, string", tag = "8")]
    pub removed_reason_parameters:
        ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
    /// Evaluated values of constraint for each sample
    #[prost(message, optional, tag = "9")]
    pub evaluated_values: ::core::option::Option<SampledValues>,
    /// IDs of decision variables used to evaluate this constraint
    #[prost(uint64, repeated, tag = "10")]
    pub used_decision_variable_ids: ::prost::alloc::vec::Vec<u64>,
    /// Feasibility of each sample
    #[prost(map = "uint64, bool", tag = "11")]
    pub feasible: ::std::collections::HashMap<u64, bool>,
}
/// Output of the sampling process.
#[non_exhaustive]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SampleSet {
    #[prost(message, optional, tag = "1")]
    pub objectives: ::core::option::Option<SampledValues>,
    #[prost(message, repeated, tag = "2")]
    pub decision_variables: ::prost::alloc::vec::Vec<SampledDecisionVariable>,
    #[prost(message, repeated, tag = "3")]
    pub constraints: ::prost::alloc::vec::Vec<SampledConstraint>,
    /// Feasibility for *both* remaining and removed constraints of each sample.
    ///
    /// The meaning of `feasible` field in SDK changes between Python SDK 1.6.0 to 1.7.0.
    /// In Python SDK 1.6.0, `feasible` represents the feasibility of remaining constraints of each sample,
    /// i.e. removed constraints (introduced in 1.6.0) are not considered.
    /// After Python SDK 1.7.0, `feasible` represents the feasibility of all constraints of each sample.
    /// The feasibility of 1.6.0 is renamed to `feasible_relaxed` in 1.7.0.
    #[prost(map = "uint64, bool", tag = "4")]
    pub feasible: ::std::collections::HashMap<u64, bool>,
    /// \[Deprecated\] This field has been introduced in Python SDK 1.6.0 to represent
    /// the feasibility of all constraints of each sample.
    /// The `feasible` field is used in this sense after Python SDK 1.7.0.
    #[prost(map = "uint64, bool", tag = "6")]
    #[deprecated]
    pub feasible_unrelaxed: ::std::collections::HashMap<u64, bool>,
    /// Feasibility for remaining (non-removed) constraints of each sample.
    #[prost(map = "uint64, bool", tag = "7")]
    pub feasible_relaxed: ::std::collections::HashMap<u64, bool>,
    /// Minimize or Maximize
    #[prost(enumeration = "instance::Sense", tag = "5")]
    pub sense: i32,
}