0% found this document useful (0 votes)
36 views

GRASP

GRASP is a metaheuristic algorithm that uses a greedy randomized adaptive search procedure to find high quality solutions to optimization problems. It has two phases - a construction phase and a local search phase. The construction phase iteratively builds a solution by adding components from a restricted candidate list that balances greedy and random selection. The local search phase then tries to improve the constructed solution by exploring neighboring solutions locally. GRASP has advantages like few parameters, fast runtime, and ease of parallelization, though the quality of solutions depends on parameters and it may rediscover the same solutions.

Uploaded by

Slimani Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

GRASP

GRASP is a metaheuristic algorithm that uses a greedy randomized adaptive search procedure to find high quality solutions to optimization problems. It has two phases - a construction phase and a local search phase. The construction phase iteratively builds a solution by adding components from a restricted candidate list that balances greedy and random selection. The local search phase then tries to improve the constructed solution by exploring neighboring solutions locally. GRASP has advantages like few parameters, fast runtime, and ease of parallelization, though the quality of solutions depends on parameters and it may rediscover the same solutions.

Uploaded by

Slimani Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

GRASP

 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.
 Greedy: Select the best choice (or among the best choices)
 Randomized: Use some probabilistic selection to prevent the same solution to
be constructed every time
 Adaptive: Change the evaluation of choices after making each decision
 Search Procedure: It is a heuristic algorithm for examining the solution space
1. Flowchart
2. Construction Phase
 First, a 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.

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

While <Optimal Solution NOT Found>

Find S’ a local solution to S

If f(S’) is better than f(S) then S S’

End While

4. Example (TSP)

 E = {AB,AC,AD,BC,BD,CD} set of all arcs (Components)


 Cost(e): Cost for each arc e  E
(𝛼 = 0.5)

Construction

• 𝐶 ← {𝐴𝐶, 𝐴𝐵, 𝐴𝐷,BA, 𝐵𝐶, 𝐵𝐷,CA,CB,𝐶𝐷,DA,DB,DC}

• 𝐶𝑜s𝑡𝑠(𝐶) ← {5,3,6,3,9,11,5,9,10,6,11,10}

Iteration 1

• 𝐶𝑀𝑖𝑛 ← 3 ; 𝐶𝑀𝑎𝑥 ← 11

• 𝑅𝐶𝐿 ← {𝐴𝐶, 𝐴𝐵, 𝐴𝐷,BA,CA,DA} (<=7)

• 𝑺 ← {𝑨𝑪} (random selection)

• 𝐶 ← {𝐶𝐵, 𝐶𝐷}

• 𝐶𝑜s𝑡𝑠(𝐶) ← {14,15} (*AC-CB and AC-CD*)


Iteration 2

• 𝐶𝑀𝑖𝑛 ← 14 ; 𝐶𝑀𝑎𝑥 ← 15

• 𝑅𝐶𝐿← {𝐶𝐵}

• 𝑺←{𝑨𝑪, 𝑪𝑩}

• 𝐶←{𝐵𝐷}

• 𝐶𝑜s𝑡𝑠(𝐶)←{25} (*AC-CB-BD*)

Iteration 3

• 𝐶𝑀𝑖𝑛 ← 0 ; 𝐶𝑀𝑎𝑥 ← 25

• 𝑅𝐶𝐿← {BD}

• 𝑺←{𝑨𝑪, 𝑪𝑩, 𝑩D}

• 𝐶←{DA}

• 𝐶𝑜s𝑡𝑠(𝐶)←{31} (*AC-CB-BD-DA*)

Iteration 4

• 𝐶𝑀𝑖𝑛 ← 0 ; 𝐶𝑀𝑎𝑥 ← 31

• 𝑅𝐶𝐿← {DA}

• 𝑺←{𝑨𝑪, 𝑪𝑩, 𝑩D, DA}

• 𝐶←{ }

• 𝐶𝑜s𝑡𝑠(𝐶)←{0}

• 𝑺←{𝑨𝑪, 𝑪𝑩, 𝑩D, DA}


Local Search

• 𝑺←{𝑨𝑪, 𝑪𝑩, 𝑩D, DA}

• 𝑺’←{𝑨B, BC, CD, DA}

f(𝑺’) = 28

f(S’) < f(S) so new solution={𝑨B, BC, CD, DA}

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.

You might also like