Google OR-Tools v9.12
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 2275 of file LinearSolver.pb.cs.

Constructor & Destructor Documentation

◆ MPSosConstraint() [1/2]

OperationsResearch.MPSosConstraint.MPSosConstraint ( )
inline

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

◆ MPSosConstraint() [2/2]

OperationsResearch.MPSosConstraint.MPSosConstraint ( MPSosConstraint other)
inline

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

Member Function Documentation

◆ CalculateSize()

int OperationsResearch.MPSosConstraint.CalculateSize ( )
inline

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

◆ ClearType()

void OperationsResearch.MPSosConstraint.ClearType ( )
inline

Clears the value of the "type" field.

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

◆ Clone()

MPSosConstraint OperationsResearch.MPSosConstraint.Clone ( )
inline

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

◆ Equals() [1/2]

bool OperationsResearch.MPSosConstraint.Equals ( MPSosConstraint other)
inline

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

◆ Equals() [2/2]

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

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

◆ GetHashCode()

override int OperationsResearch.MPSosConstraint.GetHashCode ( )
inline

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

◆ MergeFrom() [1/2]

void OperationsResearch.MPSosConstraint.MergeFrom ( MPSosConstraint other)
inline

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

◆ MergeFrom() [2/2]

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

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

◆ ToString()

override string OperationsResearch.MPSosConstraint.ToString ( )
inline

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

◆ WriteTo()

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

Definition at line 2430 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 2324 of file LinearSolver.pb.cs.

◆ VarIndexFieldNumber

const int OperationsResearch.MPSosConstraint.VarIndexFieldNumber = 2
static

Field number for the "var_index" field.

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

◆ WeightFieldNumber

const int OperationsResearch.MPSosConstraint.WeightFieldNumber = 3
static

Field number for the "weight" field.

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

Property Documentation

◆ Descriptor

pbr.MessageDescriptor OperationsResearch.MPSosConstraint.Descriptor
staticget

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

◆ HasType

bool OperationsResearch.MPSosConstraint.HasType
get

Gets whether the "type" field is set.

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

◆ Parser

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

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

◆ Type

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

Definition at line 2330 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 2361 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 2384 of file LinearSolver.pb.cs.


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