Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
OperationsResearch.MPSosConstraint Class Referencesealed

Special Ordered Set (SOS) constraints of type 1 or 2. See https://en.wikipedia.org/wiki/Special_ordered_set As of 2019/04, only SCIP and Gurobi support this constraint type. More...

Inheritance diagram for OperationsResearch.MPSosConstraint:

Classes

class  Types
 Container for nested types declared in the MPSosConstraint message type. More...
 

Public Member Functions

 MPSosConstraint ()
 
 MPSosConstraint (MPSosConstraint other)
 
MPSosConstraint Clone ()
 
void ClearType ()
 Clears the value of the "type" field.
 
override bool Equals (object other)
 
bool Equals (MPSosConstraint other)
 
override int GetHashCode ()
 
override string ToString ()
 
void WriteTo (pb::CodedOutputStream output)
 
int CalculateSize ()
 
void MergeFrom (MPSosConstraint other)
 
void MergeFrom (pb::CodedInputStream input)
 

Static Public Attributes

const int TypeFieldNumber = 1
 Field number for the "type" field.
 
const int VarIndexFieldNumber = 2
 Field number for the "var_index" field.
 
const int WeightFieldNumber = 3
 Field number for the "weight" field.
 

Properties

static pb::MessageParser< MPSosConstraintParser [get]
 
static pbr::MessageDescriptor Descriptor [get]
 
global::OperationsResearch.MPSosConstraint.Types.Type Type [get, set]
 
bool HasType [get]
 Gets whether the "type" field is set.
 
pbc::RepeatedField< int > VarIndex [get]
 Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.
 
pbc::RepeatedField< double > Weight [get]
 Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).
 

Detailed Description

Special Ordered Set (SOS) constraints of type 1 or 2. See https://en.wikipedia.org/wiki/Special_ordered_set As of 2019/04, only SCIP and Gurobi support this constraint type.

Definition at line 2243 of file LinearSolver.pb.cs.

Constructor & Destructor Documentation

◆ MPSosConstraint() [1/2]

OperationsResearch.MPSosConstraint.MPSosConstraint ( )
inline

Definition at line 2269 of file LinearSolver.pb.cs.

◆ MPSosConstraint() [2/2]

OperationsResearch.MPSosConstraint.MPSosConstraint ( MPSosConstraint other)
inline

Definition at line 2277 of file LinearSolver.pb.cs.

Member Function Documentation

◆ CalculateSize()

int OperationsResearch.MPSosConstraint.CalculateSize ( )
inline

Definition at line 2432 of file LinearSolver.pb.cs.

◆ ClearType()

void OperationsResearch.MPSosConstraint.ClearType ( )
inline

Clears the value of the "type" field.

Definition at line 2314 of file LinearSolver.pb.cs.

◆ Clone()

MPSosConstraint OperationsResearch.MPSosConstraint.Clone ( )
inline

Definition at line 2287 of file LinearSolver.pb.cs.

◆ Equals() [1/2]

bool OperationsResearch.MPSosConstraint.Equals ( MPSosConstraint other)
inline

Definition at line 2364 of file LinearSolver.pb.cs.

◆ Equals() [2/2]

override bool OperationsResearch.MPSosConstraint.Equals ( object other)
inline

Definition at line 2358 of file LinearSolver.pb.cs.

◆ GetHashCode()

override int OperationsResearch.MPSosConstraint.GetHashCode ( )
inline

Definition at line 2379 of file LinearSolver.pb.cs.

◆ MergeFrom() [1/2]

void OperationsResearch.MPSosConstraint.MergeFrom ( MPSosConstraint other)
inline

Definition at line 2447 of file LinearSolver.pb.cs.

◆ MergeFrom() [2/2]

void OperationsResearch.MPSosConstraint.MergeFrom ( pb.CodedInputStream input)
inline

Definition at line 2461 of file LinearSolver.pb.cs.

◆ ToString()

override string OperationsResearch.MPSosConstraint.ToString ( )
inline

Definition at line 2392 of file LinearSolver.pb.cs.

◆ WriteTo()

void OperationsResearch.MPSosConstraint.WriteTo ( pb.CodedOutputStream output)
inline

Definition at line 2398 of file LinearSolver.pb.cs.

Member Data Documentation

◆ TypeFieldNumber

const int OperationsResearch.MPSosConstraint.TypeFieldNumber = 1
static

Field number for the "type" field.

Definition at line 2292 of file LinearSolver.pb.cs.

◆ VarIndexFieldNumber

const int OperationsResearch.MPSosConstraint.VarIndexFieldNumber = 2
static

Field number for the "var_index" field.

Definition at line 2319 of file LinearSolver.pb.cs.

◆ WeightFieldNumber

const int OperationsResearch.MPSosConstraint.WeightFieldNumber = 3
static

Field number for the "weight" field.

Definition at line 2334 of file LinearSolver.pb.cs.

Property Documentation

◆ Descriptor

pbr.MessageDescriptor OperationsResearch.MPSosConstraint.Descriptor
staticget

Definition at line 2257 of file LinearSolver.pb.cs.

◆ HasType

bool OperationsResearch.MPSosConstraint.HasType
get

Gets whether the "type" field is set.

Definition at line 2308 of file LinearSolver.pb.cs.

◆ Parser

pb.MessageParser<MPSosConstraint> OperationsResearch.MPSosConstraint.Parser
staticget

Definition at line 2253 of file LinearSolver.pb.cs.

◆ Type

global.OperationsResearch.MPSosConstraint.Types.Type OperationsResearch.MPSosConstraint.Type
getset

Definition at line 2298 of file LinearSolver.pb.cs.

◆ VarIndex

pbc.RepeatedField<int> OperationsResearch.MPSosConstraint.VarIndex
get

Variable index (w.r.t. the "variable" field of MPModelProto) of the variables in the SOS.

Definition at line 2329 of file LinearSolver.pb.cs.

◆ Weight

pbc.RepeatedField<double> OperationsResearch.MPSosConstraint.Weight
get

Optional: SOS weights. If non-empty, must be of the same size as "var_index", and strictly increasing. If empty and required by the underlying solver, the 1..n sequence will be given as weights. SUBTLE: The weights can help the solver make branch-and-bound decisions that fit the underlying optimization model: after each LP relaxation, it will compute the "average weight" of the SOS variables, weighted by value (this is confusing: here we're using the values as weights), and the binary branch decision will be: is the non-zero variable above or below that? (weights are strictly monotonous, so the "cutoff" average weight corresponds to a "cutoff" index in the var_index sequence).

Definition at line 2352 of file LinearSolver.pb.cs.


The documentation for this class was generated from the following file: