Creates and returns a pack constraint which maintains the load of a set of containers or bins, given a set of weighted items and an assignment of items to containers.

Namespace: ILOG.CP
Assembly: oplall (in oplall.dll)

Syntax

C#
public virtual IConstraint Pack(
	IIntExpr[] load,
	IIntExpr[] where,
	int[] weight
)

Parameters

load
Type: array<ILOG.Concert..::..IIntExpr>[]()[][]
where
Type: array<ILOG.Concert..::..IIntExpr>[]()[][]
weight
Type: array<System..::..Int32>[]()[][]

Remarks

Consider that we have n items and m containers. Each item i has an integer weight weight[i] and a constrained integer variable where[i] associated with it, indicating in which container (numbered contiguously from 0) item i is to be placed. No item can be split up, and so an item can go in only one container. Associated with each container j is an integer variable load[j] representing the load in that container; that is, the sum of the weights of the items which have been assigned to that container. A capacity can be set for each container placing an upper bound on this load variable. The constraint also ensures that the total sum of the loads of the containers is equal to the sum of the weights of the items being placed.

Note: This constraint cannot be used in a logical constraint.

See Also