









































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Prepara i tuoi esami
Studia grazie alle numerose risorse presenti su Docsity
Prepara i tuoi esami con i documenti condivisi da studenti come te su Docsity
Trova i documenti specifici per gli esami della tua università
Preparati con lezioni e prove svolte basate sui programmi universitari!
Rispondi a reali domande d’esame e scopri la tua preparazione
Riassumi i tuoi documenti, fagli domande, convertili in quiz e mappe concettuali
Studia con prove svolte, tesine e consigli utili
Togliti ogni dubbio leggendo le risposte alle domande fatte da altri studenti come te
Esplora i documenti più scaricati per gli argomenti di studio più popolari
Ottieni i punti per scaricare
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Una varietà di problemi di ottimizzazione combinatoria, fornendo una panoramica completa dei concetti chiave, delle formulazioni matematiche e degli algoritmi di risoluzione. Il documento copre argomenti come il problema dello zaino, il problema del ricoprimento di insiemi, il problema del posizionamento delle strutture, il problema dell'accoppiamento, il problema della selezione degli indici, il problema del set indipendente massimo, il problema del ricoprimento minimo dei vertici, il problema dell'imballaggio dei bidoni e i problemi di routing degli archi. Offre una comprensione approfondita di questi problemi, fornendo esempi concreti e illustrando le tecniche di risoluzione, inclusi algoritmi esatti ed euristici.
Tipologia: Appunti
1 / 49
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!










































𝑈 and 𝑏(𝐹
Set packing
max ∑ 𝑐
𝑗
𝑗
𝑛
𝑗= 1
𝑗
It’s a NP-hard problem: it’s easy to find a feasible solution, but the optimal one no.
Traveling Salesman Problem (TSP)
Given:
for going from 𝑖 to 𝑗.
We want to find the Hamiltonian cycle. So, we want to find the cyclic permutation 𝜋 =
1
𝑛
such that:
min
𝜋
𝑖𝜋
( 𝑗
)
𝑛
𝑗= 1
Where 𝑇 is the set of all cyclic permutations 𝜋 of 𝑛 items.
It’s a NP-hard problem, cause all the possible ways which it’s possible to combine costumers (cyclic
permutation) is an exponential number.
Mathematical formulation:
min ∑ 𝑐
𝑖𝑗
𝑖𝑗
(𝑖,𝑗)∈𝐴
𝑖𝑗
𝑗∈𝑁
𝑖𝑗
𝑖∈𝑁
𝑖𝑗
(𝑖,𝑗)∈𝐴(𝑆)
and
are called assignment problem : they are linear in number, but we obtain a subtour (a smaller
cycle). So, we introduce ( 3 ), that is called subtour elimination. They are in exponential number.
Plant Location Problem (PLP)
It’s NP-hard. There, the goal is to determine the optimal locations for opening facilities to efficiently serve
customers while minimizing costs.
Given:
Every facility has a setup cost represented by 𝑘 𝑗
and cost of connection between a customer 𝑖 and a facility 𝑗 is
represented by 𝑐 𝑖𝑗
We introduce two binary variables 𝑥 𝑖𝑗
and 𝑦
𝑖
𝑖𝑗
= 1 if plant 𝑗 serves customers 𝑖, 0 otherwise;
𝑗
= 1 if plant 𝑗 is open, 0 otherwise.
We have two formulations:
min ∑ 𝑘
𝑗
𝑗
𝑛
𝑗= 1
𝑖𝑗
𝑖𝑗
𝑛
𝑗= 1
𝑚
𝑖= 1
𝑖𝑗
𝑛
𝑗= 1
𝑖𝑗
𝑚
𝑖= 1
𝑗
𝑖𝑗
𝑗
( 1 ) states that for every costumer only 1 facility can be selected.
states that the total number of customers assigned to facility 𝑗 should be less or equal than the number
of facilities open (𝑚 ⋅ 𝑦
𝑗
). This constraint represents 𝑛 constraints.
min ∑ 𝑘
𝑗
𝑗
𝑛
𝑗= 1
𝑖𝑗
𝑖𝑗
𝑛
𝑗= 1
𝑚
𝑖= 1
𝑖𝑗
𝑛
𝑗= 1
𝑖𝑗
𝑗
𝑖𝑗
𝑗
In this way, ( 2 ) are 𝑛 ⋅ 𝑚 constraints.
The two formulations are equivalent: they provide the same integer optimal solution. The second one gives
the convex polyhedrons, so is the stronger one.
Minimum Spanning Tree (MST) Problem
Given:
associated with each edge 𝑒 ∈ 𝐸
The MST looks for a spanning tree of minimum cost.
We have two different formulations:
min ∑ 𝑐
𝑒
𝑒
𝑒∈𝐸
𝑒
𝑒∈𝛿
({ 𝑖
})
𝑒
min ∑ 𝑐
𝑒
𝑒
𝑒∈𝐸
𝑒
𝑒∈𝛿({𝑖})
𝑒
𝑒
𝑒∈𝛿(𝑆)
≥ 1 𝑆 ⊂ 𝑁, |𝑆| odd ( 3 )
Both formulations share the first two constraints.
ensures that only one edge connecting person 𝑖 to other should be selected to create a pair.
( 3 ) ensures an integer solution. This is useful to prevent cycles, because in this way we avoid groups of an
odd number of persons.
The second formulation is the strongest one. Moreover, 𝑃 𝐵
= 𝐶𝐻(𝑀), where 𝑀 is the set of all vectors 𝑥
corresponding to matchings.
Constructive Heuristic Algorithms
Constructive algorithm for TSP
phases:
a. Select a vertex 𝑘 not included in 𝑆, according to some (greedy) criterion:
b. Insert vertex 𝑘 in 𝑆, between two specific consecutive vertices 𝑢, 𝑣.
Constructive (and greedy) algorithm of 0-1 KP
a. Non-increasing order of profit/weight ratio;
b. Non-increasing order of profit;
c. Non-decreasing order of weight.
Local Search Algorithms
, where 𝑥 ∉ 𝑁
Iterative improvement algorithm
made towards the first one that improves the current solution.
It’s good for efficiency, but not for efficacy because I could leave neighborhood early. It’s faster than BI.
Procedure FI_Simple_Descent(s) /𝑠 ∈ 𝑆 initial sol./
Found:=TRUE;
while found=TRUE do
Found:=FALSE;
for each 𝑠
′
∈ 𝑁(𝑠) do
if 𝑓
′
then
′
Found:=TRUE;
break ;
end while
return
a. Solve LP relaxation;
b. Sort variables by sorting criterion according to:
o Non increasing value of variables in LP relaxation solution;
o Non decreasing value of absolute reduced costs.
c. While sorting, we also fixing variables of the problem;
d. Taking the first variables, construct initial kernel set Λ;
e. Partion remaining variables into a sequence of buckets
a. Set 𝑖 ≔ 1 ;
b. Construct set Λ ∪ 𝐵
𝑖
, with 𝐵
𝑖
current bucket;
c. Solve restricted problem 𝑀𝐼𝑃(Λ ∪ 𝐵
𝑖
) plus some constraints to find new incumbent solution and
improve kernel set. Constraints that we add are:
o 𝑓 ≥ 𝑤
∗
: the value of the objective function must be at least better than the current one;
o ∑ 𝑥
𝑗∈𝐵 𝑗
𝑗
≥ 1 : must take at least a newelement from 𝐵
𝑗
d. If 𝑀𝐼𝑃(Λ ∪ 𝐵
𝑗
) is feasible, it provides a better solution:
o Update incumbent integer solution
∗
∗
o Construct Λ
𝑖
≔ {selected variables in 𝐵
𝑗
o Update kernel set Λ ≔ Λ ∪ Λ
𝑖
. Λ is always increasing.
e. If 𝑖 < 𝑛𝑏 set 𝑖 ≔ 𝑖 + 1 and go to step (b), otherwise stop.
Iterative Kernel Search (IKS)
In Iterative Kernel Search, buckets are scrolled more than once.
Repeat until no more variables are added to Kernel Set:
Multidimensional Knapsack Problem (MKP)
Given:
of the 𝑗 item;
𝑘
of 𝑗 item in dimension 𝑘;
in dimension 𝑖;
that is 1 if item 𝑗 is selected, 0 otherwise.
The objective function is to maximize the total profit, subject to capacity constraints for each dimension.
The mathematical formulation is:
max ∑ 𝑝
𝑗
𝑗
𝑛
𝑗= 1
𝑖𝑗
𝑘
𝑗
𝑖
𝑛
𝑗= 1
𝑗
It’s a NP-hard problem. There, reduced costs provide good signal to identify promising variables.
Portfolio Selection Problem with Conditional Value at Risk (CVaR)
The objective is to optimize the portfolio’s performance while considering risk, transaction costs and capital
constraints.
This is a NP-hard problem.
In the objective function, given:
𝑘
𝑇
We want to maximize the expected value of the 𝑘 worst scenarios.
Variables are:
𝑗
: represents the number of securities to buy for security 𝑗. It’s a continuous variable;
𝑗
: binary variable indicating the selection
or non-selection
of security 𝑗;
𝑡
: represents the deviation from the Value at Risk (VaR) for each period 𝑡. It’s a continuous variable;
Parameters are:
𝑗𝑡
: return of security 𝑗 at time 𝑡;
𝑗
: transaction cost associated with buying security 𝑗;
𝑗
: fixed cost associated with selecting security 𝑗;
𝑡
: probability of scenario 𝑡;
𝑗
: quotation for security 𝑗 at time 𝑡;
0
: desired minimum return;
0
and 𝐶
1
: lower and upper bounds on the total amount of capital invested in the portfolio;
𝑗
and 𝑢
𝑗
: parameters defining lower and upper bounds on the number of securities bought for security 𝑗.
max 𝑦 −
𝑡
𝑡
𝑇
𝑡= 1
𝑡
𝑖𝑗
𝑗
𝑗
𝑗
𝑗
𝑗
𝑛
𝑗= 1
𝑛
𝑗= 1
𝑗
𝑗
𝑗
𝑗
𝑛
𝑗= 1
𝑗
𝑗
𝑛
𝑗= 1
0
𝑗
𝑗
𝑛
𝑗= 1
0
𝑗
𝑗
1
𝑛
𝑗= 1
𝑗
𝑛
𝑗= 1
𝑗
𝑗
𝑗
𝑗
𝑗
Basic algorithm of Short Term (STM)
Set 𝑥 ≔ 𝑥̃ , where 𝑥 is the current solution, and initialize the tabu list 𝑇𝐿 ≔ 0 ;
by deciding the move;
Tabu search with MST – Example
Greedy construction
Step Candidates Selection (min cost) Total weight
Tabu activation rules :
For the total of 𝑘 − 1 = 3 iterations.
TS iterations
Iteration
Tabu-active net tenure
Add Drop Weight
Iterations of a first level TS procedure
Iteration
Tabu-active net tenure
Add Drop
Move
value
Weight
∗
∗
Algorithm of Variable Neighborhood Search
a. Define a finite set of neighborhood structures 𝒩
𝑘
𝑚𝑎𝑥
b. Find an initial feasible solution 𝑥;
c. Decide a stopping rule.
a. 𝑘 ← 1 ;
b. Repeat until 𝑘 = 𝑘
𝑚𝑎𝑥
′
in the 𝑘-th neighborhood of 𝑥 => 𝑥
′
𝑘
′′
starting from 𝑥
′
by using a local search method;
o Move from 𝑥 to 𝑥
′′
′′
o Restart the search with 𝒩
1
Note that:
′
is randomly generated to avoid cycling.
Algorithm of Variable Neighborhood Descent (VND)
a. Define a finite set of neighborhood structures 𝒩
𝑘
𝑚𝑎𝑥
b. Find an initial feasible solution 𝑥;
a. 𝑘 ← 1 ;
b. Repeat until 𝑘 = 𝑘
𝑚𝑎𝑥
′
in the 𝑘-th neighborhood of 𝑥 => 𝑥
′
𝑘
′
is better than 𝑥:
o Set 𝑥 => 𝑥 ← 𝑥
′
o Restart the search with 𝒩
1
Note that VND is a randomly descent method using BI.
There are 2 phases:
Algorithm: GRASP outline
1 function Grasp (instance)
2 bestSolution ← null
3 bestObjValue ← null
4 while stopping rule is not satisfied do
5 solution ← BuildSolution (instance)
6 newSolution, newObjValue ← LocalSearch (instance, solution)
7 if newObjValue is better than bestObjValue then
8 bestSolution ← newSolution
9 bestObjValue ← newObjValue
10 end if
11 end while
12 return bestSolution, bestObjValue
13 end function
Algorithm: Greedy BuildSolution
1 function BuildSolution (instance)
2 solution ← null
3 sortedItems ← Sort(instance.items, 𝜃)
4 while solution is not feasible do
5 nextItem ← RemoveFirst (sortedItems)
6 solution ← Add (solution, nextItem)
end while
8 return solution
9 end function
To produce better solutions, we can make the building solution also adaptive:
Algorithm: Greedy and adaptive BuildSolution
1 function BuildSolution (instance)
2 solution ← null
3 while solution is not feasible do
4 sortedItems ← Sort (instance.items, 𝜃
𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛
5 nextItem ← RemoveFirst (sortedItems)
6 solution ← Add (solution, nextItem)
7 end while
8 return solution
9 end function
Since in a greedy algorithm the selection of the next element to add to the solution is deterministic, we need
to add some randomicity. To do that, we need to add Restricted Candidate List (RLC), a subset of good
candidates.
Common strategies to build the RCL are the following:
the best choice (𝛼 ∈ [ 0 , ∞]). (𝛼 = 0 : purely greedy, 𝛼 = +∞: purely random);
Algorithm: RCL construction
1 function BuildRCL (items, solution, 𝜃
𝑆
2 𝐴 ← items\solution
3 𝑎 ← min
𝑆
4 𝑏 ← max{𝜃
𝑆
𝑆
6 𝑘 ← min
7 𝑅𝐶𝐿 ← Topk (𝑅𝐶𝐿, 𝑘)
return 𝑅𝐶𝐿
9 end function
At the end, the pseudocode of phase I is:
Algorithm: GRASP phase I
1 function BuildSolution (instance)
2 solution ← null
3 while solution is not feasible do
4 RCL ← BuildRCL (instance, solution, 𝜃
𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛
5 chosenItem ← ChooseRandomItem (RCL)
6 solution ← Add (solution, chosenItem)
7 end while
8 return solution
9 end function
To introduce phase II, we need to introduce a neighborhood 𝒩(𝑆) where to make a local search.
Algorithm: GRASP phase II
1 function LocalSearch (instance, solution)
2 while solution is not locally optimal in 𝒩
solution
do
newSolution ← FindBetterSolution (𝒩
solution
4 solution ← newSolution
5 end while
6 return solution
7 end function
GRASP with SCP problem – Example
To rank each subset, we choose the rank function 𝜃: 𝑁 → ℝ, 𝑗 ↦
𝑐 𝑗
|𝑈
𝑗
|
A greedy procedure to build a solution for the SCP is then:
Algorithm: SCP example: greedy BuildSolution
1 function BuildSolution (𝑈, 𝒰, {𝑐
𝑗
𝑗∈𝑁
3 while ∪
𝑗∈𝑆
𝑗
≠ 𝑈 do
𝑗 ∈ arg min
j∈N\S
𝑗
end while
7 return 𝑆
8 end function
Consider 𝑈 = { 1 , … , 16 } and 𝒰 = {𝑈 1
2
3