GRASP
GRASP
Procedure GRASP_Construction
𝑆𝑜𝑙𝑢𝑡𝑖𝑜𝑛 ← ∅ (*Solution to be constructed*)
𝐶←𝐸 (*Candidate list as the initial list (components)*)
𝐸𝑣𝑎𝑙𝑢𝑎𝑡𝑒 𝑒𝑎𝑐ℎ 𝑒 𝑖𝑛 𝐶 𝑤𝑖𝑡ℎ 𝑎 𝑐𝑜𝑠𝑡 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛
𝑊ℎ𝑖𝑙𝑒 𝐶 ≠ ∅ 𝑑𝑜
𝐶 ← min{𝑐𝑜𝑠𝑡(𝑒), 𝑒 ∈ 𝐶} (*Component of minimum cost*)
𝐶 ← max{𝑐𝑜𝑠𝑡(𝑒), 𝑒 ∈ 𝐶} (*Component of maximum cost*)
(*Restricted Candidate List*)
𝑅𝐶𝐿 ← {𝑒 ∈ 𝐶|𝑓(𝑒) ≤ 𝐶 + 𝛼(𝐶 −𝐶 )}
(*α=1: all components; α=0: only component of cost Cmin*)
𝑅𝑎𝑛𝑑𝑜𝑚𝑙𝑦 𝑆𝑒𝑙𝑒𝑐𝑡 𝑠 𝑓𝑟𝑜𝑚 𝑅𝐶𝐿 (*random component*)
𝑆𝑜𝑙𝑢𝑡𝑖𝑜𝑛 ← 𝑆𝑜𝑙𝑢𝑡𝑖𝑜𝑛 ∪ {𝑠}
𝑈𝑝𝑑𝑎𝑡𝑒 𝐶 (*compatibility with s*)
𝑅𝑒𝑣𝑎𝑙𝑢𝑎𝑡𝑒 𝑒𝑎𝑐ℎ 𝑒 𝑖𝑛 𝐶 𝑤𝑖𝑡ℎ 𝑎𝑛 𝑖𝑛𝑐𝑟𝑒𝑚𝑒𝑛𝑡𝑎𝑙 𝑐𝑜𝑠𝑡 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛
𝑡𝑎𝑘𝑖𝑛𝑔 𝑖𝑛 𝑐𝑜𝑛𝑠𝑖𝑑𝑒𝑟𝑎𝑡𝑖𝑜𝑛 𝑡ℎ𝑒 𝑐𝑜𝑠𝑡 𝑜𝑓 𝑠
𝐸𝑛𝑑 𝑊ℎ𝑖𝑙𝑒
𝑅𝑒𝑡𝑢𝑟𝑛 𝑆𝑜𝑙𝑢𝑡𝑖𝑜𝑛
3. Local Search Phase
Procedure GRASP_Local_Search
End While
4. Example (TSP)
Construction
• 𝐶𝑜s𝑡𝑠(𝐶) ← {5,3,6,3,9,11,5,9,10,6,11,10}
Iteration 1
• 𝐶𝑀𝑖𝑛 ← 3 ; 𝐶𝑀𝑎𝑥 ← 11
• 𝐶 ← {𝐶𝐵, 𝐶𝐷}
• 𝐶𝑀𝑖𝑛 ← 14 ; 𝐶𝑀𝑎𝑥 ← 15
• 𝑅𝐶𝐿← {𝐶𝐵}
• 𝑺←{𝑨𝑪, 𝑪𝑩}
• 𝐶←{𝐵𝐷}
• 𝐶𝑜s𝑡𝑠(𝐶)←{25} (*AC-CB-BD*)
Iteration 3
• 𝐶𝑀𝑖𝑛 ← 0 ; 𝐶𝑀𝑎𝑥 ← 25
• 𝑅𝐶𝐿← {BD}
• 𝐶←{DA}
• 𝐶𝑜s𝑡𝑠(𝐶)←{31} (*AC-CB-BD-DA*)
Iteration 4
• 𝐶𝑀𝑖𝑛 ← 0 ; 𝐶𝑀𝑎𝑥 ← 31
• 𝑅𝐶𝐿← {DA}
• 𝐶←{ }
• 𝐶𝑜s𝑡𝑠(𝐶)←{0}
f(𝑺’) = 28
Solution={AB,BC,CD,DA} (3+9+10+6)=28
5. Advantages :
Parameters : only α and nb of iterations.
Runtime : comparing with other methaheuristics, the algorithm consume a few
CPU time, it’s predictable.
Parallelism: GRASP is also easily implemented in parallel, so a considerable
gain of time of calculation.
Implementation : relatively, GRASP is easy to implement.
6. Disdvantages
Incertitude about the quality of the solution: final solution always depend on
parameters of the algorithm.
Construction without memorization: Informations not saved from an iteration to
onother.
May easily re-discover the same solution many times.