DotNet Reference

.Net Reference

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.

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 3514 of file CpModel.pb.cs.

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. More...
 
const int HeadsFieldNumber = 2
 Field number for the "heads" field. More...
 
const int LiteralsFieldNumber = 3
 Field number for the "literals" field. More...
 
const int DemandsFieldNumber = 4
 Field number for the "demands" field. More...
 
const int CapacityFieldNumber = 5
 Field number for the "capacity" field. More...
 

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]
 Experimental. More...
 
long Capacity [get, set]
 

Constructor & Destructor Documentation

◆ RoutesConstraintProto() [1/2]

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

◆ RoutesConstraintProto() [2/2]

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

Member Function Documentation

◆ CalculateSize()

int CalculateSize ( )
inline

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

◆ Clone()

RoutesConstraintProto Clone ( )
inline

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

◆ Equals() [1/2]

override bool Equals ( object  other)
inline

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

◆ Equals() [2/2]

bool Equals ( RoutesConstraintProto  other)
inline

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

◆ GetHashCode()

override int GetHashCode ( )
inline

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

◆ MergeFrom() [1/2]

void MergeFrom ( pb::CodedInputStream  input)
inline

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

◆ MergeFrom() [2/2]

void MergeFrom ( RoutesConstraintProto  other)
inline

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

◆ ToString()

override string ToString ( )
inline

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

◆ WriteTo()

void WriteTo ( pb::CodedOutputStream  output)
inline

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

Member Data Documentation

◆ CapacityFieldNumber

const int CapacityFieldNumber = 5
static

Field number for the "capacity" field.

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

◆ DemandsFieldNumber

const int DemandsFieldNumber = 4
static

Field number for the "demands" field.

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

◆ HeadsFieldNumber

const int HeadsFieldNumber = 2
static

Field number for the "heads" field.

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

◆ LiteralsFieldNumber

const int LiteralsFieldNumber = 3
static

Field number for the "literals" field.

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

◆ TailsFieldNumber

const int TailsFieldNumber = 1
static

Field number for the "tails" field.

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

Property Documentation

◆ Capacity

long Capacity
getset

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

◆ Demands

pbc.RepeatedField<int> Demands
get

Experimental.

The demands for each node, and the maximum capacity for each route. Note that this is currently only used for the LP relaxation and one need to add the corresponding constraint to enforce this outside of the LP.

TODO(user): Ideally, we should be able to extract any dimension like these (i.e. capacity, route_length, etc..) automatically from the encoding. The classical way to encode that is to have "current_capacity" variables along the route and linear equations of the form: arc_literal => (current_capacity_tail + demand <= current_capacity_head)

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

◆ Descriptor

pbr.MessageDescriptor Descriptor
staticget

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

◆ Heads

pbc.RepeatedField<int> Heads
get

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

◆ Literals

pbc.RepeatedField<int> Literals
get

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

◆ Parser

pb.MessageParser<RoutesConstraintProto> Parser
staticget

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

◆ Tails

pbc.RepeatedField<int> Tails
get

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


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