FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
t
January 3rd, 2011
Metaheuristics: GRASP
Group 1:Clara GouveiaDaniel OliveiraFabrício SperandioFilipe Sousa [Presenter]
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
2
Part One: Introduction to GRASP
Part Two: Paper Presentation
GRASP Overview Construction Phase Local Search Phase GRASP Example GRASP Variations
3D BPP Definition 2D BPP Definition Hybrid GRASP/VND for BPP
Preprocess Phase Construction Phase Improvement Phase
Improvement Procedures Combined Strategies
Diversification Phase Computational Results Comparison with other Algorithms Conclusions
Outline
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
3
GRASP
reedy
andomized
daptive
earch
rocedure
GRASP Overview
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
4
GRASP Overview
GRASP is a metaheuristic:
A metaheuristic is a method that works with local improvement procedures and other higher level strategies to create processes capable of escaping from local optima, and performing a robust search of a solution space.
GRASP was first described in 1989:
Published by Thomas A. Feo and Mauricio G. C. Resende.
In this first publication GRASP was applied to the set covering problem.
References:M. Gendreau, and J. Potvin. Handbook of Metaheuristics. 2nd edition, Springer, 2010.T. A. Feo, and M. G. C. Resende. A Probabilistic Heuristic for a Computationally Difficult Set Covering Problem. Operations Research Letters, no. 8, pp. 67-71, 1989.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
5
GRASP Overview
References:T. A. Feo, and M. G. C. Resende. Greedy Randomized Adaptive Search Procedures. Journal of Global Optimization, no. 6, pp. 109-133, 1995.M. G. C. Resende. Greedy Randomized Adaptive Search Procedures (GRASP). AT&T Labs Research Technical Report, 98.41.1, Dec. 1998.M. G. C. Resende, and Celso C. Ribeiro. Greedy Randomized Search Procedures. AT&T Labs Research Technical Report TD-53RSJY, version 2, Aug. 2002
GRASP can be divided in two phases:
Construction: where a feasible solution is built.
Local Search: from the solution obtained a neighborhood is built and the search is then performed.
Best Solution
For N iterations
Improved SolutionLocal Search PhaseConstruction Phase
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
6
GRASP Overview
References:T. A. Feo, and M. G. C. Resende. Greedy Randomized Adaptive Search Procedures. Journal of Global Optimization, no. 6, pp. 109-133, 1995.M. G. C. Resende. Greedy Randomized Adaptive Search Procedures (GRASP). AT&T Labs Research Technical Report, 98.41.1, Dec. 1998.M. G. C. Resende, and Celso C. Ribeiro. Greedy Randomized Search Procedures. AT&T Labs Research Technical Report TD-53RSJY, version 2, Aug. 2002
GRASP is easy to implement:
Few parameters need to be set and tuned.
Effort can be transferred to the implementation of efficient data structures.
GRASP is also easily implemented in parallel.
Best Solution
For N iterations
Improved SolutionLocal Search PhaseConstruction Phase
Improved SolutionLocal Search PhaseConstruction Phase
com
pare
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
7
Construction Phase
References:T. A. Feo, and M. G. C. Resende. Greedy Randomized Adaptive Search Procedures. Journal of Global Optimization, no. 6, pp. 109-133, 1995.M. G. C. Resende. Greedy Randomized Adaptive Search Procedures (GRASP). AT&T Labs Research Technical Report, 98.41.1, Dec. 1998.M. G. C. Resende, and Celso C. Ribeiro. Greedy Randomized Search Procedures. AT&T Labs Research Technical Report TD-53RSJY, version 2, Aug. 2002
The RCL (Restricted Candidate List) is built based on the α parameter:
α is variable between 0 and 1: 0 makes the construction too random. 1 makes the construction too greedy.
If β is the best free element and Σ represents the free elements, RCL is composed by: RCL U {Σ ≥ α.β}
Build RCLInitialize elements
Randomly choose an element Update Solution
Contructed Solution
Repeat until element list is empty
Update Candidate List
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
8
Construction Phase
References:T. A. Feo, and M. G. C. Resende. Greedy Randomized Adaptive Search Procedures. Journal of Global Optimization, no. 6, pp. 109-133, 1995.M. G. C. Resende. Greedy Randomized Adaptive Search Procedures (GRASP). AT&T Labs Research Technical Report, 98.41.1, Dec. 1998.M. G. C. Resende, and Celso C. Ribeiro. Greedy Randomized Search Procedures. AT&T Labs Research Technical Report TD-53RSJY, version 2, Aug. 2002
The randomness of GRASP is present when an element is picked by chance from the RCL.
After the element is added to the current solution the cost of each free element is updated:
This is the adaptive part of the GRASP metaheuristic.
Build RCLInitialize elements
Randomly choose an element Update Solution
Update Candidate List Contructed Solution
Repeat until element list is empty
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
9
Local Search Phase
References:T. A. Feo, and M. G. C. Resende. Greedy Randomized Adaptive Search Procedures. Journal of Global Optimization, no. 6, pp. 109-133, 1995.M. G. C. Resende. Greedy Randomized Adaptive Search Procedures (GRASP). AT&T Labs Research Technical Report, 98.41.1, Dec. 1998.F. Parreño, R. Alvarez-Valdes, J. F. Oliveira, and J. M. Tamarit. A hybrid GRASP/VND algorithm for two- and three-dimensional bin packing. Annals of Operations Research, vol. 179, no. 1, pp. 203-220, Oct. 2008.
The Create Neighborhood can be implement in several different ways:
This is problem dependent.
The stopping criteria varies with the implemented method.
Create Neighborhood
Select Best Solution
Contructed Solution
Repeat until stopping criteria is satisfied
Compare with Existing Best Improved Solution
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
10
GRASP Example
References:T. A. Feo, and M. G. C. Resende. Greedy Randomized Adaptive Search Procedures. Journal of Global Optimization, no. 6, pp. 109-133, 1995.
Set Covering Problem:
Having α = 40% implies a RCL = {P1, P4, P5, P6, P7}.
Randomly selecting P5 translates into: Covering elements 3, 4, and 5.
The next GRASP step consists in the candidate list update.
P1 P2 P3 P4 P5 P6 P7 P8
X 1
X X X 2
X X X X X 3
X X X X X 4
X X 5
2 1 1 3 3 3 2 1
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
11
GRASP Example
References:T. A. Feo, and M. G. C. Resende. Greedy Randomized Adaptive Search Procedures. Journal of Global Optimization, no. 6, pp. 109-133, 1995.
Set Covering Problem:
RCL = {P3, P4, P6, P7}.
Randomly choosing P3 leaves P6 as the only option: Translates into solution {P5, P3, P6}.
P1 P2 P3 P4 P5 P6 P7 P8
X 1
X X X 2
3
4
5
0 0 1 1 0 1 1 0
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
12
GRASP Example
References:T. A. Feo, and M. G. C. Resende. Greedy Randomized Adaptive Search Procedures. Journal of Global Optimization, no. 6, pp. 109-133, 1995.
Set Covering Problem:
Once again, having α = 40% implies a RCL = {P1, P4, P5, P6, P7}.
However, if P6 had been randomly chosen, and then P4 we would have reached an optimal solution: {P6, P4}.
P1 P2 P3 P4 P5 P6 P7 P8
X 1
X X X 2
X X X X X 3
X X X X X 4
X X 5
2 1 1 3 3 3 2 1
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
13
GRASP Variations
References:T. A. Feo, and M. G. C. Resende. Greedy Randomized Adaptive Search Procedures. Journal of Global Optimization, no. 6, pp. 109-133, 1995.M. G. C. Resende, and Celso C. Ribeiro. Greedy Randomized Search Procedures. AT&T Labs Research Technical Report TD-53RSJY, version 2, Aug. 2002
Reactive GRASP:
RCL size is adjusted according to the quality of the solutions previously found.
GRASP using GA (Genetic Algorithm) methodology :
Introduces a mutation in the local search phase.
GRASP with cost perturbation:
The cost associated with an element is modified in some way to cause a perturbation in the greedy function.
Other variations exist...
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
14
OutlinePart One: Introduction to GRASP
Part Two: Paper Presentation
GRASP Overview Construction Phase Local Search Phase GRASP Example GRASP Variations
3D BPP Definition 2D BPP Definition Hybrid GRASP/VND for BPP
Preprocess Phase Construction Phase Improvement Phase
Improvement Procedures Combined Strategies
Diversification Phase Computational Results Comparison with other Algorithms Conclusions
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
15
Part Two: Paper Presentation
A hybrid GRASP/VND algorithm for two- and three-dimensional bin packing.
F. Parreño, R. Alvarez-Valdes, J.F. Oliveira, and J.M. Tamarit
Annals of Operations ResearchVolume 179, Number 1, Pages 203-220, 25 October 2008.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
16
3D BPP Definition
The three-dimensional bin packing problem (3BP):
NP-hard problem.
Useful for industrial applications (loading cargo into pallets, containers or vehicles, or packaging design).
Assumptions:
Known dimensions: Bin (W,H,D) . Boxes (wi,hi, di ), (i = 1, . . . , n). wi ≤ W, hi ≤ H, and di ≤ D.
The items cannot be rotated.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
17
2D BPP Definition
The two-dimensional bin packing problem (2BP):
Special case of 3BP where di =D , i=1, . . . , n.
Assumptions:
Known dimensions: Bin (W,H). Boxes (wi,hi), (i = 1, . . . , n). wi ≤ W, and hi ≤ H.
The items cannot be rotated.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
18
Hybrid GRASP/VND for BPPk=1; f=[]
B={b1,...,bn}
Preprocess
B={b1,...,bm}S={E}
ConstructivePhase
k=k+1Target: n-1
orImprovement
Phase f=[]𝑽 ′>𝑽YES
NO
YES
NOYES
NO
Inputs:
Items to pack.
Number of iterations.
Alpha.
Preprocess:
Simplify the problem.
Constructive Phase:
Develop a feasible solution.
Improvement Phase:
Improves the solution.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
19
Hybrid GRASP/VND for BPPConstructive Phase
(1)Choose
Maximal Space – S*
(0)Initialization
(2)Choose
Boxes to Pack
(3)Update
List S
and
Vectors with boxes left to pack: B={b1,...,bm}.
Set of empty maximal spaces: S={E}.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
20
Hybrid GRASP/VND for BPPConstructive Phase: Step 1
(1)Choose
Maximal Space – S*
(0)Initialization
(2)Choose
Boxes to Pack
(3)Update List S
Choose Maximal Space:
Maximal Space (S*): maximal space in S closer to a corner.
The volume can be used as a tie breaker.
Objective:
First fill the corners.
Then the sides.
Later the inner space.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
21
Hybrid GRASP/VND for BPPConstructive Phase: Step 2
(1)Choose
Maximal Space – S*
(0)Initialization
(2)Choose
Boxes to Pack
(3)Update List S
Choose Boxes to Pack:
Boxes fitting in S* can be packed: Individually. Layer: several boxes with the same dimensions.
Using one of the following criteria: Best volume: order by the box that produces the largest
increase in the bin volume. Best fit: order by the box which fits best in the maximal space.
The box to be moved is selected randomly among the (1-α)*100% blocks.
α is the RCL GRASP parameter.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
22
Hybrid GRASP/VND for BPPConstructive Phase: Step 2
(1)Choose
Maximal Space – S*
(0)Initialization
(2)Choose
Boxes to Pack
(3)Update List S
α parameter:
Responsible for the random selection of the boxes to pack.
The authors used the reactive-GRASP principle to determine α:
α is initially chosen randomly from the discrete set {0.1, 0.2,...,0.9}.
After some iterations the probability distribution of α is adjusted taking into account the relative quality of the solutions.
This incorporates a learning mechanism in GRASP, which is memory less in its constructive phase.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
23
Hybrid GRASP/VND for BPPConstructive Phase: Step 3
(1)Choose
Maximal Space – S*
(0)Initialization
(2)Choose
Boxes to Pack
(3)Update List S
Update List S:
Update S: If the box intercepts other maximal space. If the box does not fit exactly in the space S*. If the unpacked boxes are larger than the remaining
maximal spaces.
Update B: The placed boxes must be removed from the list.
If and then return to step 1: Otherwise the constructive phase ends with n bins used.
For the next GRASP iteration, the target of the constructive phase is n-1.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
24
Hybrid GRASP/VND for BPPImprovement Phase
Initial Procedure
ImprovementProcedures
RepackingObjects
CombinedProcedures
Order Solutionby Non-increasing
Volume
Procedure 1 Procedure 2 Procedure 3 Procedure 4Local Search
Best Fit Best Volume
VND(N1, N2, N3, N4)
VNDseq(N1, N2, N3, N4)
All Moves1→ 4
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
25
Improvement PhaseImprovement Procedures
Procedure 1:
Eliminates the last k% items in the solution.
k is a random value between 30 and 90%.
Procedure 2:
Removes the last k% pieces packed from each bin, whose occupied volume is less than the average.
Procedure 3:
Select all the bins in which the occupied volume is lower than the overall average occupancy.
Split each bin into two parts randomly selecting how to cut: vertically or horizontally.
Choose randomly one side of the bin: [up/down left/right]: Remove all boxes that are mostly in the selected side.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
26
Procedure 4 – Local Search:
Neighborhood: consists in all pairs of bins in which at least one have an occupancy bellow the average.
Search method: For each pair in the neighborhood unpack all the items. The first box to pack must be one of the boxes that was not packed (initial solution). The moves are chosen considering one of the following criteria:
First Improve: select the first pair which improves the current solution. Best Improve: Examine all the neighborhood and select the best improvement.
The move improves the solution if the total volume of boxes packed into the bins increases.
Improvement PhaseImprovement Procedures
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
27
All moves:
The improvement procedures are applied: 1→ 4.
VND (Variable Neighborhood Descent):
Neighborhood (N1 to N4): generated by the four improvement procedures.
Start with the solution given by the constructive heuristic (x):1. set p ← 12. while p <= 4
a) Exploration of the neighborhood to find the best x’ in the neighbor Np(x).b) Move if x’ is better then x. Return to p ← 1. Otherwise set p ← p +1.
VNDseq (Sequential Variable Neighborhood Descent):
Similar to VND but:
In step 2.a) instead of setting p=1, the algorithm proceeds sequentially to the (p+1)th.
Improvement PhaseCombined Strategies
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
28
Computation and Data Sets:
The algorithm was coded in C++ and run on a standard laptop.
2D and 3D data sets were used in order to test the proposed algorithm: For the 3D simulation, a standard benchmark generated by Martello et al
was used. This data set was also used by Faroe et al. For the 2D simulation, more than one data set was used. To compare with
already published results of other heuristics.
Computational Results
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
29
Choosing the best strategy:
Constructive Phase: Number of corners to consider:
[1, 2, 3, 4] for the 2D BPP. [1, 2, 3, 4, 8] for the 3D BPP.
Deterministic or random constructive phase.
Improvement Phase: Compare the performance of the four improvement methods individually. Compare the performance of the combined improvement methods.
Comparison with other algorithms to solve 2D and 3D BPP.
Computational ResultsExperiments
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
30
Applying the constructive phase with randomization:
Each improvement methods were tested with both objective functions: Best Volume and Best Fit.
At each iteration one of the four strategies to choose the corner is randomly selected.
The algorithm run for 5000 iterations.
Computational ResultsConstructive
Deterministic Random
2D 7635 74923D 10148 9877
Overall 17783 17369
The results obtained for each dataset showed that using the randomized constructive algorithm proved to be better than the determinist.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
31
2D:
Method 4 was the best independently of the objective function used.
Method 2 with best fit approach also produced good results.
3D
For both objective functions, method 4 performed better followed by method 2.
Computational ResultsImprovements
Best Volume Best Fit
1 2 3 4 1 2 3 4
2D 7492 7492 7494 7478 7492 7484 7494 7476
3D 9876 9867 9875 9820 9877 9865 9871 9828
Overall 17368 17359 17369 17298 17369 17349 17365 17304
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
32
Computational ResultsCombined Improvement
The diversification algorithm is applied after 500 iterations without improvement in the following 100 iterations .
The analysis of the three strategies for the combination of improvements shows:
2D/3D: “All moves” is the worst strategy. Small difference among the others.
The method chosen for the final implementation was:
VNDseq + Diversification.
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
33
2D statistical analysis show:
GRASP is better than TS3 and it favors GRASP against the others algorithms.
3D statistical analysis show:
GRASP and SCH are significantly better than TS3, GLS, and HBP.
GRASP and SCH achieved optimal solutions:
Indicates a good performance of the proposed algorithm.
Comparison with other Algorithms
FEU
P |
PDEE
C |
Dec
isio
n Su
ppor
tMetaheuristics: GRASP
34
Regarding the GRASP algorithm:
Grasp consists in a constructive phase followed by a local search procedure.
It is easy to implement due to the reduced number of parameters
Parameter α defines the randomness of Grasp
Basic version of GRASP does not have memory. It can be combined with other procedures such as reactive GRASP that adjust α.
Hybrid GRASP/VND for BPP:
Combination of GRASP with VND allowed the algorithm to obtain high quality solutions.
The quality of the solutions were similar to well known algorithms to solve 2D and 3D BPP.
Reinforces the fact that GRASP is flexible and could be adapted easily to accommodate constraints or other conditions.
Conclusions