public final class RoutesConstraintProto extends com.google.protobuf.GeneratedMessage implements RoutesConstraintProtoOrBuilder
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 expect 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.Protobuf type
operations_research.sat.RoutesConstraintProto
Modifier and Type | Class and Description |
---|---|
static class |
RoutesConstraintProto.Builder
The "VRP" (Vehicle Routing Problem) constraint.
|
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message,T>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter
Modifier and Type | Field and Description |
---|---|
static int |
CAPACITY_FIELD_NUMBER |
static int |
DEMANDS_FIELD_NUMBER |
static int |
HEADS_FIELD_NUMBER |
static int |
LITERALS_FIELD_NUMBER |
static int |
TAILS_FIELD_NUMBER |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
long |
getCapacity()
int64 capacity = 5; |
static RoutesConstraintProto |
getDefaultInstance() |
RoutesConstraintProto |
getDefaultInstanceForType() |
int |
getDemands(int index)
EXPERIMENTAL.
|
int |
getDemandsCount()
EXPERIMENTAL.
|
java.util.List<java.lang.Integer> |
getDemandsList()
EXPERIMENTAL.
|
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
int |
getHeads(int index)
repeated int32 heads = 2; |
int |
getHeadsCount()
repeated int32 heads = 2; |
java.util.List<java.lang.Integer> |
getHeadsList()
repeated int32 heads = 2; |
int |
getLiterals(int index)
repeated int32 literals = 3; |
int |
getLiteralsCount()
repeated int32 literals = 3; |
java.util.List<java.lang.Integer> |
getLiteralsList()
repeated int32 literals = 3; |
com.google.protobuf.Parser<RoutesConstraintProto> |
getParserForType() |
int |
getSerializedSize() |
int |
getTails(int index)
repeated int32 tails = 1; |
int |
getTailsCount()
repeated int32 tails = 1; |
java.util.List<java.lang.Integer> |
getTailsList()
repeated int32 tails = 1; |
int |
hashCode() |
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static RoutesConstraintProto.Builder |
newBuilder() |
static RoutesConstraintProto.Builder |
newBuilder(RoutesConstraintProto prototype) |
RoutesConstraintProto.Builder |
newBuilderForType() |
protected RoutesConstraintProto.Builder |
newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) |
static RoutesConstraintProto |
parseDelimitedFrom(java.io.InputStream input) |
static RoutesConstraintProto |
parseDelimitedFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static RoutesConstraintProto |
parseFrom(byte[] data) |
static RoutesConstraintProto |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static RoutesConstraintProto |
parseFrom(java.nio.ByteBuffer data) |
static RoutesConstraintProto |
parseFrom(java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static RoutesConstraintProto |
parseFrom(com.google.protobuf.ByteString data) |
static RoutesConstraintProto |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static RoutesConstraintProto |
parseFrom(com.google.protobuf.CodedInputStream input) |
static RoutesConstraintProto |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static RoutesConstraintProto |
parseFrom(java.io.InputStream input) |
static RoutesConstraintProto |
parseFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<RoutesConstraintProto> |
parser() |
RoutesConstraintProto.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashFields, toString
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static final int TAILS_FIELD_NUMBER
public static final int HEADS_FIELD_NUMBER
public static final int LITERALS_FIELD_NUMBER
public static final int DEMANDS_FIELD_NUMBER
public static final int CAPACITY_FIELD_NUMBER
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class com.google.protobuf.GeneratedMessage
public java.util.List<java.lang.Integer> getTailsList()
repeated int32 tails = 1;
getTailsList
in interface RoutesConstraintProtoOrBuilder
public int getTailsCount()
repeated int32 tails = 1;
getTailsCount
in interface RoutesConstraintProtoOrBuilder
public int getTails(int index)
repeated int32 tails = 1;
getTails
in interface RoutesConstraintProtoOrBuilder
index
- The index of the element to return.public java.util.List<java.lang.Integer> getHeadsList()
repeated int32 heads = 2;
getHeadsList
in interface RoutesConstraintProtoOrBuilder
public int getHeadsCount()
repeated int32 heads = 2;
getHeadsCount
in interface RoutesConstraintProtoOrBuilder
public int getHeads(int index)
repeated int32 heads = 2;
getHeads
in interface RoutesConstraintProtoOrBuilder
index
- The index of the element to return.public java.util.List<java.lang.Integer> getLiteralsList()
repeated int32 literals = 3;
getLiteralsList
in interface RoutesConstraintProtoOrBuilder
public int getLiteralsCount()
repeated int32 literals = 3;
getLiteralsCount
in interface RoutesConstraintProtoOrBuilder
public int getLiterals(int index)
repeated int32 literals = 3;
getLiterals
in interface RoutesConstraintProtoOrBuilder
index
- The index of the element to return.public java.util.List<java.lang.Integer> getDemandsList()
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)
repeated int32 demands = 4;
getDemandsList
in interface RoutesConstraintProtoOrBuilder
public int getDemandsCount()
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)
repeated int32 demands = 4;
getDemandsCount
in interface RoutesConstraintProtoOrBuilder
public int getDemands(int index)
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)
repeated int32 demands = 4;
getDemands
in interface RoutesConstraintProtoOrBuilder
index
- The index of the element to return.public long getCapacity()
int64 capacity = 5;
getCapacity
in interface RoutesConstraintProtoOrBuilder
public final boolean isInitialized()
isInitialized
in interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessage
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException
writeTo
in interface com.google.protobuf.MessageLite
writeTo
in class com.google.protobuf.GeneratedMessage
java.io.IOException
public int getSerializedSize()
getSerializedSize
in interface com.google.protobuf.MessageLite
getSerializedSize
in class com.google.protobuf.GeneratedMessage
public boolean equals(java.lang.Object obj)
equals
in interface com.google.protobuf.Message
equals
in class com.google.protobuf.AbstractMessage
public int hashCode()
hashCode
in interface com.google.protobuf.Message
hashCode
in class com.google.protobuf.AbstractMessage
public static RoutesConstraintProto parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static RoutesConstraintProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static RoutesConstraintProto parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static RoutesConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static RoutesConstraintProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static RoutesConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static RoutesConstraintProto parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static RoutesConstraintProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static RoutesConstraintProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static RoutesConstraintProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static RoutesConstraintProto parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOException
public static RoutesConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public RoutesConstraintProto.Builder newBuilderForType()
newBuilderForType
in interface com.google.protobuf.Message
newBuilderForType
in interface com.google.protobuf.MessageLite
public static RoutesConstraintProto.Builder newBuilder()
public static RoutesConstraintProto.Builder newBuilder(RoutesConstraintProto prototype)
public RoutesConstraintProto.Builder toBuilder()
toBuilder
in interface com.google.protobuf.Message
toBuilder
in interface com.google.protobuf.MessageLite
protected RoutesConstraintProto.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
newBuilderForType
in class com.google.protobuf.AbstractMessage
public static RoutesConstraintProto getDefaultInstance()
public static com.google.protobuf.Parser<RoutesConstraintProto> parser()
public com.google.protobuf.Parser<RoutesConstraintProto> getParserForType()
getParserForType
in interface com.google.protobuf.Message
getParserForType
in interface com.google.protobuf.MessageLite
getParserForType
in class com.google.protobuf.GeneratedMessage
public RoutesConstraintProto getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
Copyright © 2025. All rights reserved.