A Generic Model and Hybrid Algorithm For Hoist Scheduling Problems
A Generic Model and Hybrid Algorithm For Hoist Scheduling Problems
1 Introduction
1.1 The Hoist Scheduling Problem
Many industrial processes employ computer-controlled hoists for material han-
dling [2, 4, 14, 16, 22]. The hoists are programmed to perform a xed sequence
of moves repeatedly. Each repetition of the sequence of moves is called a cycle
and the total time required by the hoists to complete the cycle is called a cycle
time. A typical application is an automated electroplating line for processing
printed circuit boards (jobs). The importance of minimising the cyclic time is
evident by the fact that the lot sizes for electroplating jobs are usually large
and a production run may require weeks between changeovers [22]. Even a small
reduction in the cycle time can result in a signicant saving of time and cost.
Due to the nature of dierent industrial processes, specic approaches for
dierent classes of HSPs have been developed. There are two drawbacks of the
proposed approaches. First, the models and solution algorithms are dedicated
to each class of problems, and second, an optimal solution and the proof of
optimality has been shown only for restricted classes of HSPs [10].
1.2 A Generic Model and Solver for HSPs
This paper addresses all the dierent classes of HSPs using a single generic ap-
proach. This approach uses Constraint Logic Programming (CLP) as the mod-
elling language, and models the dierent classes of HSPs by extending a single
underlying model with extra constraints. The models are handled by a generic
algorithm which uses a combination of constraint propagation and linear solving.
The HSP problem involves both linear constraints and logical constraints,
and CLP is a powerful language for modelling such problems. The language used
in this paper to model HSPs is CLP(R)1 , an instance of the CLP scheme [13].
However while the CLP Scheme envisages a single constraint solver for all the
constraints, this paper follows [3] and passes constraints to either (or both) of two
dierent solvers. In this setup, we can separate the denition and the behaviour
of constraints. A practical consequence is that the programmer can concentrate
on modelling of the problem and any problems with the performance of the
default behaviour can be ironed out afterwards.
The hybrid algorithms for solving HSPs combines a CLP solver and a MIP
solver such that both solvers share the variables and constraints to cooperate in
nding an optimal solution. The experiments on HSPs have shown that there
are problem classes which can be solved neither by constraint propagation nor
MIP alone, but which succumb to this combination of the two.
Moreover the combination is not an exclusive one, where some constraints
are handled by one solver and the remainder by the other solver. Indeed every
constraint is passed to both solvers. This application, therefore, shows the value
of allowing a single constraint to be handled by more than one solver.
track
unprocessed processed
hoist jobs
jobs
CLP Model This class of one-hoist scheduling problems can be captured by the
following model. The model is expressed in CLP syntax: input data is expressed
as facts; constraints as clauses; variables start with an upper-case letter. We use
a bold font for types; for example numTanks(Integer) means that the predicate
numTanks takes a single argument which is an integer.
{ numTanks(Integer). The number (=12) of chemical treatment tanks in the pro-
duction line.
{ empty(Tank, Tank, Time). Tank is an integer denoting a tank. Time is also
an integer. The predicate empty is used to record the times of travel from tank to
tank for the hoist when empty. It records times for every pair of tanks.
{ full(Tank, Time). The transport times of jobs from a tank to the next tank
on the production line.
{ numJobs(Integer). The number (=3) of jobs in the production line.
{ minTime( Tank, Time). The minimum time a job can stay in each tank.
{ maxTime( Tank, Time). The maximum time a job can stay in each tank.
The problem variables are those whose value is found during the search for the
shortest possible cycle:
{ Entry. An array of the times at which the jobs are put into the tanks.
{ Removal . An array of the times at which the jobs are removed from the tanks.
{ Period . The time of a cycle.
A single cyclic HSP with time windows can be dened by four types of con-
straints.
First, we relate the array of variables Entry to the array of decision variables
Removal. For each tank, the entry time is the removal time from the previous
tank, plus the transportation time between the two tanks. The \0th" tank is the
stack of unprocessed jobs.
lin1(Removal,Entry):-
for(Tank,1:numTanks) do
Removal[Tank-1] + full(Tank-1) = Entry[Tank].
Second, the entry time of a job to a tank is related straightforwardly to its re-
moval time from this tank: the dierence between them is equal to the treatment
time in the tank. Due to the nature of chemical treatments, the processing of a
job in a tank must be completed within a given time window. These intervals
impose time window constraints on the hoist movements. Scheduling with time
window has been studied by Phillips and Unger [18].
lin2(Removal,Entry) :-
for(Tank,1:numTanks) do
Entry[Tank] + minTime(Tank) Removal[Tank],
Entry[Tank] + maxTime(Tank) Removal[Tank].
Third, since one job is removed from the production line during each cycle
the time of any job in the system cannot be longer than the time of NumJobs
cycles.
lin3(Removal,Period) :-
Removal[numTanks] +
full(numTanks) numJobs * Period.
Fourth, the hoist can only do one thing at a time. Thus a constraint is
required to prevent the hoist transporting a job from tank T1 to T1 + 1 at the
same time as it is transporting the same, or another, job from tank T2 to T2 + 1.
A clash will obviously occur if a task is being performed on a job at the same
time as any other task on the same job. Less obviously a clash will occur if a task
is being performed on a job at time Time, and another task is being performed
on the same job at time Time+Period. In this case the clash will be between the
rst task on one job and the second task on the following job. In fact a clash
will occur if two tasks are being performed on a job at any pair of times Time
and Time+N*Period, for N up to but not including the number of jobs at the
same time on the production line.
To ensure no clash between the transportation from T1 to T1 + 1 and T2 to
T2 + 1, either one job must be removed from tank T1 after the other was placed
in tank T2 + 1, leaving time for the hoist to travel empty from tank T2 + 1 to
tank T1; or the job must be placed in tank T1 + 1 before being removed from
tank T2, leaving time for the hoist to travel empty from T1 + 1 to T2.
This constraint is the core of the generic HSP model. It is expressed in terms
of the following clauses:
disj(Removal,Entry,Period) :-
for(T1,1:numTanks-1) do for(T2,T1+1:numTanks) do
for(K,1:numJobs-1) do
disj1(T1,T2,K,Removal,Entry,Period).
disj1(T1,T2,K,Removal,Entry,Period) :-
Entry[T1+1] + empty(T1+1,T2) + K * Period
Removal[T2].
disj1(T1,T2,K,Removal,Entry,Period) :-
Entry[T2+1] + empty(T2+1,T1)
Removal[T1] + K * Period.
This disjunctive constraint is supercially similar to the resource constraints en-
countered in disjunctive scheduling, which enforce that one task is performed ei-
ther before or after another task [7]. However the disjunctive constraints in hoist
scheduling involve not just the two task variables, Entry[T1] and Removal[T2]
for example, but they also involve a third variable Period. The occurrence of a
third variable makes the handling of the hoist scheduling disjunctive constraints
quite dierent. In case there are only two variables, choosing one alternative
for each disjunctive constraint, together with propagation, suces to decide the
global consistency of the constraints. In case three variable are involved, by con-
trast, choosing disjuncts and propagating without failing, no longer suces to
guarantee global consistency.
The whole single cyclic scheduling problem with time windows, denoted by
hsp1, is dened as follows:
problem hsp1:
minimize Period
subject to lin1(Removal,Entry),
lin2(Removal,Entry),
lin3(Removal,Period), disj(Removal,Entry,Period).
mhdisj1(T1,T2,K,Removal,Entry, H,Period) :-
Entry[T1+1] + empty(T1+1,T2)
Removal[T2] + K * Period.
mhdisj1(T1,T2,K,Removal,Entry, H,Period) :-
Entry[T2+1] + empty(T2+1,T1) + K * Period
Removal[T1].
mhdisj1(T1,T2,K,Removal,Entry,Hoist,Period) :-
/* Comment: T2>T1 */
Hoist[T2] Hoist[T1] + 1.
The whole P&U's problem with multi hoists on one track is denoted by hsp3
and it contains constraints lin1, lin2, lin3, lin4, mhdisj.
Notice that Lei and others introduced two quite dierent models for the 2-
hoist problem, the partitioning model [15], and the trac-collision approach [14].
hsp3 models the trac-collision approach. The weaker partition approach could
be modelled by adding the single constraint
partition(Hoist) :-
for(I,1:numTanks-1) do for(J,I+1:numTanks) do
Hoist[J]
Hoist[I].
3.4 Scheduling with Multiple Tracks
HSPs can contain hoists on more than one track. Previous approaches toward
solving cyclic HSPs have been limited to single-track cases. Our model for that
problem is very similar to the model for the previous class of HSPs. Since the
hoists use dierent tracks it is enough to force that the hoists for each tank are
dierent. We adapt the model of hsp3 by adding a single extra clause to the
procedure for mhdisj1, viz:
mhdisj1(T1,T2,K,Removal,Entry,Hoist,Period) :-
Hoist[T1] Hoist[T2] + 1.
The whole P&U's problem with multi hoists on dierent tracks is denoted by
hsp4 and it contains lin1, lin2, lin3, lin4, and the modied mhdisj.
4.1 Modelling
CLP has greater expressive power than traditional mathematical programming
models in two ways:
{ Constraints involving disjunction can be represented directly
{ Constraints can be encapsulated (as predicates) and used in the denition
of further constraints
However, a CLP model can be automatically translated into a traditional MIP
model by
{ Eliminating disjunctions in favour of auxiliary boolean variables
{ Unfolding predicates into their denitions
This translation is only applicable on condition that any recursively dened
constraints can be fully unfolded at the time of translation. This condition is
satised in the HSP model, and all the other large scale industrial optimisation
problems we have addressed. The translation is presented in detail in [19]. We
brie
y summarise the key steps, and present a toy example.
{ For each possible top level goal, p(X1, ..., Xn) add to the program a single
clause
p(X1...Xn) :- p(X1...Xn,1).
4.2 Example
The program
prog(X, Y) : X::1..10, Y::1..10, diff(X, Y) .
diff(X, Y) : .
Y+2 X
diff(X, Y) : .
X+2 Y
4.3 Solving
The proposed evaluation algorithm allows an integration of MIP with CLP us-
ing a unique model for a problem. The derived linear constraints are treated
either by the MIP solver, or the CLP solver, or by both solvers. Our hybrid
algorithm combines both solvers such that search is separated from the handling
of constraints. Search is applied by labelling of boolean and integer variables.
Constraint handling is performed by constraint propagation of the CLP solver
and linear constraint solving of the MIP solver.
We have implemented the integration of CLP with MIP by using the ECLiPSe
constraint logic programming platform and the XPRESS-MP mathematical pro-
gramming package [9, 23]. This allows XPRESS to be used to solve problems
modelled in ECLiPSe. The control of the search process and the constraint
propagation is handled by CLP while the linear constraint solving is handled
by MIP. The constraint propagation is performed by a consistency algorithm on
nite domains and it represents a component of the ECLiPSe package. On the
other hand, the linear constraint solving is performed by the simplex algorithm
which is a component of the XPRESS package.
Communication between the solvers is supported by the attributed variables
of ECLiPSe. For the purposes of the hoist scheduling problem, the information
communicated is just the upper and lower bounds of the variables.
Naturally the main performance benet of the hybrid solver is due to the
early detection of failure by the dierent solvers. Each solver detects certain
failures which would not have been detected by the other solver until a later
node in the search tree. For example constraint propagation fails immediately
with constraints,
X::0..2, Y::0..2, X+2*Y = 3, X-Y = 1 .
but cannot detect any inconsistency in the constraints:
X::1..10, Y::1..10, 2*X+2*Y 20, X+Y 11.
A linear solver has precisely the complementary behaviour, detecting the incon-
sistency of the second constraint set, but not the rst.
On the HSP problem, we apply the following three solvers:
{ CLP solver. The constraints are considered only by ECLiPSe. The search
is done by labelling binary variables rst. Constraint handling is performed
by constraint propagation on nite domains.
{ MIP solver. The constraints are considered only by XPRESS. The search
is done by performing the default XPRESS branch-and-bound procedure.
Constraint handling is performed by linear constraint solving (simplex). The
optimal solution of the whole problem is returned to ECLiPSe.
{ CLP&MIP solver. The constraints are considered by ECLiPSe and XPRESS.
The search is done by labelling binary variables rst. Constraint handling is
performed by constraint propagation on nite domains and linear constraint
solving.
5 Empirical Results
Let us discuss the empirical results of the hybrid CLP&MIP solver relative to
the results of the CLP and MIP solvers on the following HSPs from Section 2:
The empirical results in Table 2 show that HSPs are hard for our CLP solver.
However, the
exibility of CLP gives the programmer the choice of a variety
Table 1. Hoist scheduling problems
hsp1 the P&U's problem with 12 tanks and 4 jobs
hsp2 the P&U's problem with the tank capacity equal to 2
hsp3 the collision-based P&U's problem with 2 hoists on one track
hsp4 the P&U's problem with 2 hoists on two tracks
of constraint solvers and variable domains. Baptiste et al. [2] compared two do-
mains and associated constraint solvers from dierent CLP languages: CHIP's
nite domains and Prolog III's rational numbers. Their empirical results show
when a constraint solver should be chosen in preference to another constraint
solver and how to control the search towards an ecient running program.
The MIP solver has diculties to derive an optimal solution to all HSPs. The
solver is very ecient for problems hsp1 and hsp2, and inecient for problems
hsp3, and hsp4.
6 Conclusions
We have presented models for several classes of industrial HSPs and an e-
cient translation to a generic model for dierent solution techniques, i.e. the
CLP solver, the MIP solver, or hybrid CLP&MIP solvers. These models and
solvers have been benchmarked on some problems which have been the subject
of previous research both using CLP, MIP and heuristic algorithms.
The proposed CLP&MIP solver can solve several classes of HSPs which have
never previously been solved to optimality. Neither the CLP solver nor the MIP
solver alone are able to solve them in reasonable time. The experimental results
demonstrated that constraint propagation and linear constraint solving are or-
thogonal up to certain degree. An infeasibility of several HSPs is recognised by
only one of the procedures. The proposed integration of CLP with MIP allows
comparisons between the two approaches and gives a clearer idea of when CLP
should be chosen in preference to MIP, and when an integrated solver is quicker
than the CLP solver or the MIP solver.
However the HSP experiments have revealed an unexpected, but very im-
portant, benet of hybrid solvers. The experiments show that, if constraints are
passed to both a constraint propagation engine and a linear solver, the robust-
ness of the model may be dramatically enhanced. The same generic model can
be easily and naturally adapted for all the dierent classes of HSPs, and they
can all be solved.
Using either MIP or CLP solvers alone, problem modelling is made harder
because models must be designed specically for the solver, as for example in
[14, 15, 16, 18, 22]. In fact, when the same generic model is solved by a CLP
or an MIP solver alone, only a subset of the dierent problem classes can be
eectively handled. Our hope is that hybrid solvers may make it possible to
simplify problem modelling, by reducing the need to address issues of solver
eciency at the modelling stage.
Our work makes a contribution to the long-term objective of separating the
modelling and solving of combinatorial problems. With the powerful modelling
facilities of CLP, with multiple solvers and
exible search control, the encoding
of a correct model of the problem can indeed be a guaranteed step towards
an ecient running program. The consequences can be revolutionary - with
programmers actually taking modelling seriously.
Acknowledgements Many thanks to the IC-PARC group who has con-
tributed to the writing of this paper through helpful discussions and criticisms.
References
1. Barth, P., Bockmayr, A.: Modelling Mixed-Integer Optimisation Problems in Con-
straint Logic Programming. MPI Report Nr. I-95-2-011 (1995)
2. Baptiste, P., Legeard, B., Manier, M.A., Varnier, C.: A Scheduling Problem Op-
timisation Solved with Constraint Logic Programming. Proc. of the PACT Conf.
(1994) 47-66
3. Beringer, H., De Backer, B.: Combinatorial Problem Solving in Constraint Logic
Programming with Cooperating Solvers. Chapter 8 in Logic Programming: Formal
Methods and Practical Applications ed. C. Beierle and L. Pluemer Elsevier (1995)
4. Cheng, C.C., Smith, S.F.: A Constraint Satisfaction Approach to Makespan
Scheduling. Proc. of the AIPS Conf. (1996) 45-52
5. Dincbas, M., Van Hentenryck, P., Simonis, H., Aggoun, A., Graf, T., Berthier, F.:
The Constraint Logic Programming Language CHIP. Proc. of the FGCS Conf.
(1988) 693-702
6. CPLEX. Using the CPLEX Callable Library. CPLEX Optimization, Inc. (1997)
7. Dincbas, M., Simonis, H., Van Hentenryck, P.: Solving Large Combinatorial Prob-
lems in Logic Programming. Journal of Logic programming 8 (1995) 75-93
8. Darby-Dowman, K., Little, J., Mitra, G., Zaalon, M.: Constraint Logic Program-
ming and Integer programming Approaches and their Collaboration in Solving an
Assignment Scheduling Problem. Constraints 1(3) (1997) 245-264
9. ECLiPSe User Manual Version 3.7.1. IC-PARC, Imperial College, London (1998)
10. Hanen. C.: Study of a NP-Hard Cyclic Scheduling Problem: The Recurrent Job-
Shop. European Journal of Operations Research 72 (1994) 82-101
11. Hooker, J.N., Osorio, M.A.: Mixed Logical/Linear Programming. Proc. of the IN-
FORMS CSTS Conf. Atlanta (1996)
12. Hajian, M., Sakkout, H.El, Wallace, M., Richards, E.: Towards a Closer Integration
of Finite Domain Propagation and Simplex-Based Algorithms. Proc. of the AI
Maths Conf. Florida (1995) www.icparc.ic.ac.uk/papers.html
13. Jaar, J., Lassez, J.L.: Constraint Logic Programming. Proc. of the ACM POPL
Symposium Munich (1997)
14. Lei, L., Armstrong, R., Gu, S.: Minimizing the Fleet Size with Dependent Time-
Window and Single-Track Constraints. Operations Res. Letters 14 (1993) 91-98
15. Lei, L., Wang, T.J.: The Minimum Common-Cycle Algorithm for Cycle Scheduling
of Two Material Handling Hoists with Time Window Constraints. Management
Science 37(12) (1991) 1629-1639
16. Lei, L., Wang, T.J.: Determining Optimal Cyclic Hoist Schedules in a Single Hoist
Electroplating Line. IEE Transactions 26(2) (1994) 25-33
17. McAloon, K., Tretko, C.: Optimization and Computational Logic. Wiley-
Interscience (1996)
18. Phillips, L.W., Unger, P.S.: Mathematical Programming Solution of a Hoist
Scheduling Problem. AIIE Transactions 8(2) (1976) 219-255
19. Rodosek, R., Wallace, M.G., Hajian, M.T.: A New Approach to Integrating Mixed
Integer Programming with Constraint Logic Programming. Annals of Operational
Research. Recent Advance in Combinatorial Optimization: Theory and Applications
(to appear) www.icparc.ic.ac.uk/papers.html
20. Smith, B.M., Brailsford, S.C., Hubbard, P.M., Williams, H.P.: The Progressive
Party Problem: Integer Linear Programming and Constraint Programming Com-
pared. Constraints 1(2) (1996) 119-138
21. Schimpf. J.: ECLiPSe Approach to Solver Integration and Cooperation. Proc. of
the INFORMS CSTS Conf. Monterey (1998)
22. Sharpio, G.W., Nuttle, H.: Hoist Scheduling for a PBC Electroplating Facility. IIE
Transactions 20(2) (1988) 157-167
23. Dash Associates. XPRESS-MP Reference Manual. Dash Associates UK (1993)
This article was processed using the LATEX macro package with LLNCS style