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, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashFields, toStringaddAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic 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.GeneratedMessagepublic java.util.List<java.lang.Integer> getTailsList()
repeated int32 tails = 1;getTailsList in interface RoutesConstraintProtoOrBuilderpublic int getTailsCount()
repeated int32 tails = 1;getTailsCount in interface RoutesConstraintProtoOrBuilderpublic int getTails(int index)
repeated int32 tails = 1;getTails in interface RoutesConstraintProtoOrBuilderindex - The index of the element to return.public java.util.List<java.lang.Integer> getHeadsList()
repeated int32 heads = 2;getHeadsList in interface RoutesConstraintProtoOrBuilderpublic int getHeadsCount()
repeated int32 heads = 2;getHeadsCount in interface RoutesConstraintProtoOrBuilderpublic int getHeads(int index)
repeated int32 heads = 2;getHeads in interface RoutesConstraintProtoOrBuilderindex - The index of the element to return.public java.util.List<java.lang.Integer> getLiteralsList()
repeated int32 literals = 3;getLiteralsList in interface RoutesConstraintProtoOrBuilderpublic int getLiteralsCount()
repeated int32 literals = 3;getLiteralsCount in interface RoutesConstraintProtoOrBuilderpublic int getLiterals(int index)
repeated int32 literals = 3;getLiterals in interface RoutesConstraintProtoOrBuilderindex - 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 RoutesConstraintProtoOrBuilderpublic 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 RoutesConstraintProtoOrBuilderpublic 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 RoutesConstraintProtoOrBuilderindex - The index of the element to return.public long getCapacity()
int64 capacity = 5;getCapacity in interface RoutesConstraintProtoOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessagepublic void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessagejava.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessagepublic boolean equals(java.lang.Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static RoutesConstraintProto parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static RoutesConstraintProto parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static RoutesConstraintProto parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static RoutesConstraintProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static RoutesConstraintProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static RoutesConstraintProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static RoutesConstraintProto parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static RoutesConstraintProto parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static RoutesConstraintProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static RoutesConstraintProto parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static RoutesConstraintProto parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static RoutesConstraintProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic RoutesConstraintProto.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static RoutesConstraintProto.Builder newBuilder()
public static RoutesConstraintProto.Builder newBuilder(RoutesConstraintProto prototype)
public RoutesConstraintProto.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected RoutesConstraintProto.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
newBuilderForType in class com.google.protobuf.AbstractMessagepublic static RoutesConstraintProto getDefaultInstance()
public static com.google.protobuf.Parser<RoutesConstraintProto> parser()
public com.google.protobuf.Parser<RoutesConstraintProto> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessagepublic RoutesConstraintProto getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderCopyright © 2024. All rights reserved.