Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Google.OrTools.Sat.RoutesConstraintProto Class Referencesealed

The "VRP" (Vehicle Routing Problem) constraint. More...

Detailed Description

The "VRP" (Vehicle Routing Problem) constraint.

The direct graph where arc #i (from tails[i] to head[i]) is present iff literals[i] is true must satisfy this set of properties:

  • #incoming arcs == 1 except for node 0.
  • #outgoing arcs == 1 except for node 0.
  • for node zero, #incoming arcs == #outgoing arcs.
  • There are no duplicate arcs.
  • Self-arcs are allowed except for node 0.
  • There is no cycle in this graph, except through node 0.
    Note
    Currently this constraint expects all the nodes in [0, num_nodes) to have at least one incident arc. The model will be considered invalid if it is not the case. You can add self-arc fixed to one to ignore some nodes if needed.
    Todo
    (user): It is probably possible to generalize this constraint to a no-cycle in a general graph, or a no-cycle with sum incoming <= 1 and sum outgoing <= 1 (more efficient implementation). On the other hand, having this specific constraint allow us to add specific "cuts" to a VRP problem.

Definition at line 3709 of file CpModel.pb.cs.

Inheritance diagram for Google.OrTools.Sat.RoutesConstraintProto:

Classes

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

Public Member Functions

 RoutesConstraintProto ()
 RoutesConstraintProto (RoutesConstraintProto other)
RoutesConstraintProto Clone ()
override bool Equals (object other)
bool Equals (RoutesConstraintProto other)
override int GetHashCode ()
override string ToString ()
void WriteTo (pb::CodedOutputStream output)
int CalculateSize ()
void MergeFrom (RoutesConstraintProto other)
void MergeFrom (pb::CodedInputStream input)

Static Public Attributes

const int TailsFieldNumber = 1
 Field number for the "tails" field.
const int HeadsFieldNumber = 2
 Field number for the "heads" field.
const int LiteralsFieldNumber = 3
 Field number for the "literals" field.
const int DemandsFieldNumber = 4
 Field number for the "demands" field.
const int CapacityFieldNumber = 5
 Field number for the "capacity" field.
const int DimensionsFieldNumber = 6
 Field number for the "dimensions" field.

Properties

static pb::MessageParser< RoutesConstraintProtoParser [get]
static pbr::MessageDescriptor Descriptor [get]
pbc::RepeatedField< int > Tails [get]
pbc::RepeatedField< int > Heads [get]
pbc::RepeatedField< int > Literals [get]
pbc::RepeatedField< int > Demands [get]
long Capacity [get, set]
pbc::RepeatedField< global::Google.OrTools.Sat.RoutesConstraintProto.Types.NodeExpressions > Dimensions [get]
 Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node. Expressions with the same "dimension" (such as "load" or "time") must be listed together. This field is optional. If it is set, the linear constraints of size 1 or 2 between the variables in these expressions will be used to derive cuts for this constraint. If it is not set, the solver will try to automatically derive it, from the linear constraints of size 1 or 2 in the model (this can fail in complex cases).

Constructor & Destructor Documentation

◆ RoutesConstraintProto() [1/2]

Google.OrTools.Sat.RoutesConstraintProto.RoutesConstraintProto ( )
inline

Definition at line 3734 of file CpModel.pb.cs.

◆ RoutesConstraintProto() [2/2]

Google.OrTools.Sat.RoutesConstraintProto.RoutesConstraintProto ( RoutesConstraintProto other)
inline

Definition at line 3742 of file CpModel.pb.cs.

Member Function Documentation

◆ CalculateSize()

int Google.OrTools.Sat.RoutesConstraintProto.CalculateSize ( )
inline

Definition at line 3927 of file CpModel.pb.cs.

◆ Clone()

RoutesConstraintProto Google.OrTools.Sat.RoutesConstraintProto.Clone ( )
inline

Definition at line 3754 of file CpModel.pb.cs.

◆ Equals() [1/2]

override bool Google.OrTools.Sat.RoutesConstraintProto.Equals ( object other)
inline

Definition at line 3841 of file CpModel.pb.cs.

◆ Equals() [2/2]

bool Google.OrTools.Sat.RoutesConstraintProto.Equals ( RoutesConstraintProto other)
inline

Definition at line 3847 of file CpModel.pb.cs.

◆ GetHashCode()

override int Google.OrTools.Sat.RoutesConstraintProto.GetHashCode ( )
inline

Definition at line 3865 of file CpModel.pb.cs.

◆ MergeFrom() [1/2]

void Google.OrTools.Sat.RoutesConstraintProto.MergeFrom ( pb.CodedInputStream input)
inline

Definition at line 3962 of file CpModel.pb.cs.

◆ MergeFrom() [2/2]

void Google.OrTools.Sat.RoutesConstraintProto.MergeFrom ( RoutesConstraintProto other)
inline

Definition at line 3945 of file CpModel.pb.cs.

◆ ToString()

override string Google.OrTools.Sat.RoutesConstraintProto.ToString ( )
inline

Definition at line 3881 of file CpModel.pb.cs.

◆ WriteTo()

void Google.OrTools.Sat.RoutesConstraintProto.WriteTo ( pb.CodedOutputStream output)
inline

Definition at line 3887 of file CpModel.pb.cs.

Member Data Documentation

◆ CapacityFieldNumber

const int Google.OrTools.Sat.RoutesConstraintProto.CapacityFieldNumber = 5
static

Field number for the "capacity" field.

Definition at line 3806 of file CpModel.pb.cs.

◆ DemandsFieldNumber

const int Google.OrTools.Sat.RoutesConstraintProto.DemandsFieldNumber = 4
static

Field number for the "demands" field.

Definition at line 3792 of file CpModel.pb.cs.

◆ DimensionsFieldNumber

const int Google.OrTools.Sat.RoutesConstraintProto.DimensionsFieldNumber = 6
static

Field number for the "dimensions" field.

Definition at line 3818 of file CpModel.pb.cs.

◆ HeadsFieldNumber

const int Google.OrTools.Sat.RoutesConstraintProto.HeadsFieldNumber = 2
static

Field number for the "heads" field.

Definition at line 3770 of file CpModel.pb.cs.

◆ LiteralsFieldNumber

const int Google.OrTools.Sat.RoutesConstraintProto.LiteralsFieldNumber = 3
static

Field number for the "literals" field.

Definition at line 3781 of file CpModel.pb.cs.

◆ TailsFieldNumber

const int Google.OrTools.Sat.RoutesConstraintProto.TailsFieldNumber = 1
static

Field number for the "tails" field.

Definition at line 3759 of file CpModel.pb.cs.

Property Documentation

◆ Capacity

long Google.OrTools.Sat.RoutesConstraintProto.Capacity
getset

Definition at line 3810 of file CpModel.pb.cs.

◆ Demands

pbc.RepeatedField<int> Google.OrTools.Sat.RoutesConstraintProto.Demands
get
Deprecated
These fields are no longer used. The solver ignores them.

Definition at line 3801 of file CpModel.pb.cs.

◆ Descriptor

pbr.MessageDescriptor Google.OrTools.Sat.RoutesConstraintProto.Descriptor
staticget

Definition at line 3722 of file CpModel.pb.cs.

◆ Dimensions

pbc.RepeatedField<global.Google.OrTools.Sat.RoutesConstraintProto.Types.NodeExpressions> Google.OrTools.Sat.RoutesConstraintProto.Dimensions
get

Expressions associated with the nodes of the graph, such as the load of the vehicle arriving at a node, or the time at which a vehicle arrives at a node. Expressions with the same "dimension" (such as "load" or "time") must be listed together. This field is optional. If it is set, the linear constraints of size 1 or 2 between the variables in these expressions will be used to derive cuts for this constraint. If it is not set, the solver will try to automatically derive it, from the linear constraints of size 1 or 2 in the model (this can fail in complex cases).

Definition at line 3835 of file CpModel.pb.cs.

◆ Heads

pbc.RepeatedField<int> Google.OrTools.Sat.RoutesConstraintProto.Heads
get

Definition at line 3776 of file CpModel.pb.cs.

◆ Literals

pbc.RepeatedField<int> Google.OrTools.Sat.RoutesConstraintProto.Literals
get

Definition at line 3787 of file CpModel.pb.cs.

◆ Parser

pb.MessageParser<RoutesConstraintProto> Google.OrTools.Sat.RoutesConstraintProto.Parser
staticget

Definition at line 3718 of file CpModel.pb.cs.

◆ Tails

pbc.RepeatedField<int> Google.OrTools.Sat.RoutesConstraintProto.Tails
get

Definition at line 3765 of file CpModel.pb.cs.


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