31 MM34 MH V03 Construction Heuristics

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

31-MM34 Metaheuristics

Video 3: Construction Heuristics

Prof. Dr. Kevin Tierney

kevin.tierney@uni-bielefeld.de
Professor for Decision and Operation Technologies
Bielefeld University

Last updated: Summer 2022

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license.
Outline

Outline

This video:
I Introduction: Construction Heuristics
I Example: Set Covering Problem
I Naive heuristic
I Random heuristic
I Greedy heuristic
I Pseudocode

31-MM34 MH: Video 3: Construction Heuristics 2/12


Review

Review: Heuristics

Definition
Heuristic methods attempt to solve problems without providing guarantees of
optimality or solution quality using tricks or a “rule of thumb”.

Types of heuristics:
I Greedy
I Random
I Naive

31-MM34 MH: Video 3: Construction Heuristics 3/12


Construction heuristics

Construction heuristics

Basic concepts:
I Step-by-step solution process.
I Split problems into smaller pieces (solution components)
I Build a feasible solution out of the components
It’s easiest to understand how construction heuristics work with an example.

31-MM34 MH: Video 3: Construction Heuristics 4/12


Construction heuristics

Example: Set covering problem (SCP)


I Given: A set U and n subsets Si ⊂ U with costs ci .
I Goal: Find a cover with minimal costs such that the union of the cover equals U.
To formally define the problem, also let:
I Parameters δie ∈ {0, 1} be 1 iff e ∈ Si with e ∈ U
I Decision variables xi ∈ {0, 1} be 1 iff set i is in the cover

n
X
min ci xi (1)
i=1
n
X
subject to δie xi ≥ 1 ∀e ∈ U (2)
i=1

31-MM34 MH: Video 3: Construction Heuristics 5/12


Construction heuristics

SCP Example Instance

I Given: A set U and n subsets Si ⊂ U with costs ci .


I Goal: Find a cover with minimal costs such that the union of the cover contains
U.

Example Instance
U = {1, . . . , 6}
i 1 2 3 4 5 6 7 8 9
Si {1,3} {3,5} {1,2,5} {2,6} {1,2} {4} {3,4,6} {5} {4,5,6}
ci 3 4 7 7 8 9 10 10 11

31-MM34 MH: Video 3: Construction Heuristics 6/12


Construction heuristics

SCP: Naive solution heuristic

Example Instance
U = {1, . . . , 6}
i 1 2 3 4 5 6 7 8 9
Si {1,3} {3,5} {1,2,5} {2,6} {1,2} {4} {3,4,6} {5} {4,5,6}
ci 3 4 7 7 8 9 10 10 11

Naive Solution: C = {1, 2, 3, 4, 5, 6, 7, 8, 9}


Naive objective value: 3 + 4 + 7 + 7 + 8 + 9 + 10 + 10 + 11 = 69
General Heuristic: C = {1, . . . , n}

31-MM34 MH: Video 3: Construction Heuristics 7/12


Construction heuristics

SCP: Random solution heuristic (attempt 1)

Example Instance
U = {1, . . . , 6}
i 1 2 3 4 5 6 7 8 9
Si {1,3} {3,5} {1,2,5} {2,6} {1,2} {4} {3,4,6} {5} {4,5,6}
ci 3 4 7 7 8 9 10 10 11

Random Solution: C = {2, 5, 8}


Objective value: 4 + 8 + 10 = 22
Elements covered: 1,2,3,5 (Missing: 4, 6)

31-MM34 MH: Video 3: Construction Heuristics 8/12


Construction heuristics

SCP: Random solution heuristic (attempt 2)

Example Instance
U = {1, . . . , 6}
i 1 2 3 4 5 6 7 8 9
Si {1,3} {3,5} {1,2,5} {2,6} {1,2} {4} {3,4,6} {5} {4,5,6}
ci 3 4 7 7 8 9 10 10 11

Heuristic:
1. Let C ← ∅ be the current cover.
S 
2. If c∈C c 6= U then
2.1 Select i uniformly at random from {1, . . . , n} \ C
2.2 C ← C ∪ {i}
2.3 Go to step 2

31-MM34 MH: Video 3: Construction Heuristics 9/12


Construction heuristics

SCP: Greedy solution heuristic

Heuristic sketch:
I Add the subset with the lowest costs to the cover such that the number of
uncovered elements that become covered is maximized.

Heuristic pseudocode:
1. Let C ← ∅ be the current cover.
S 
2. If c∈C c 6= U then
2.1 D ← {1, . . . , n} \ C
2.2 Remove any element j from D where Sj ∩ C = Sj
2.3 O ← argminj∈D cj
2.4 i ← argmaxo∈O |So \ C |
2.5 C ← C ∪ {i}

31-MM34 MH: Video 3: Construction Heuristics 10/12


Construction heuristics

Running the greedy heuristic

Example with U = {1, . . . , 6}


i 1 2 3 4 5 6 7 8 9
Si {1,3} {3,5} {1,2,5} {2,6} {1,2} {4} {3,4,6} {5} {4,5,6}
ci 3 4 7 7 8 9 10 10 11

I Cover: ∅
I Missing Elements: { 1 2 3 4 5 6 }
I Costs: 0

31-MM34 MH: Video 3: Construction Heuristics 11/12


Construction heuristics

Running the greedy heuristic

Example with U = {1, . . . , 6}


i 1 2 3 4 5 6 7 8 9
Si {1,3} {3,5} {1,2,5} {2,6} {1,2} {4} {3,4,6} {5} {4,5,6}
ci 3 4 7 7 8 9 10 10 11

I Cover: {1 3 }
I Missing Elements: { 2 4 5 6 }
I Costs: 3

31-MM34 MH: Video 3: Construction Heuristics 11/12


Construction heuristics

Running the greedy heuristic

Example with U = {1, . . . , 6}


i 1 2 3 4 5 6 7 8 9
Si {1,3} {3,5} {1,2,5} {2,6} {1,2} {4} {3,4,6} {5} {4,5,6}
ci 3 4 7 7 8 9 10 10 11

I Cover: {1 3 5 }
I Missing Elements: { 2 4 6 }
I Costs: 7

31-MM34 MH: Video 3: Construction Heuristics 11/12


Construction heuristics

Running the greedy heuristic

Example with U = {1, . . . , 6}


i 1 2 3 4 5 6 7 8 9
Si {1,3} {3,5} {1,2,5} {2,6} {1,2} {4} {3,4,6} {5} {4,5,6}
ci 3 4 7 7 8 9 10 10 11

I Cover: {1 2 3 5 6}
I Missing Elements: { 4 }
I Costs: 14

31-MM34 MH: Video 3: Construction Heuristics 11/12


Construction heuristics

Running the greedy heuristic

Example with U = {1, . . . , 6}


i 1 2 3 4 5 6 7 8 9
Si {1,3} {3,5} {1,2,5} {2,6} {1,2} {4} {3,4,6} {5} {4,5,6}
ci 3 4 7 7 8 9 10 10 11

I Cover: {1 2 3 4 5 6}
I Missing Elements: ∅
I Costs: 23

31-MM34 MH: Video 3: Construction Heuristics 11/12


Summary

Summary

In this video. . .
I We discussed construction heuristics
I We examined the set covering problem with three different solution heuristics
I We looked at two different ways to describe a heuristic (pseudocode, prose)

31-MM34 MH: Video 3: Construction Heuristics 12/12

You might also like