You are on page 1of 7

Single-objective optimization

 One goal function, formally:


Bioinspired and soft-computing
min f ( x )
methods in data analysis and x
f (x)
optimization f : ℝ

Optimization
where: x*
Ω
and problem solving Ω – the decision (search) space
ℝ – the objective space
primer f – the objective (goal) function

Krzysztof Michalak  We look for one, the best, solution x *


krzysztof.michalak@ue.wroc.pl
https://krzysztof-michalak.pl/
2

Multiobjective optimization (1/5) Multiobjective optimization (2/5)


 More than one goal function, formally:  Examples
 Minimize travel time and costs
min F ( x)  [ f1 ( x ), f 2 ( x),..., f m ( x)]T
x  Maximize strength of an element, minimize weight
F :   ℝm  Maximize investment return, minimize risk

where:
non-dominated solutions
Ω – the decision (search) space dominated solutions
f2 = travel cost

m
ℝ – the objective space
fi – the objective (goal) functions

 Usually, no single solution minimizes all the


objectives
3 f1 = travel time 4

Multiobjective optimization (3/5) Multiobjective optimization (4/5)


 A dominating solution. Let:  A Pareto-optimal (non-dominated) solution x * Ω
x1, x2  Ω x    x  x *
u = F(x1), v = F(x2)
 Improving any objective of x * requires worsening at
 We say that x1 dominates x2 (denoted x1 ≻ x2) when: least one other objective
i1, 2,..., m  ui  vi
 Pareto set (PS) = all non-dominated solutions
i1, 2,..., m  ui  vi
x *
  : x    x  x* 
x 1 is not worse than x 2
 We denote x1 ≡ x2 when: w.r.t. to all objectives  Pareto front (PF) = objectives attained by the PS
and better w.r.t. at least
i1, 2,..., m  ui  vi one objective F x  ℝ
* m
: x    x  x * 
5 6

1
Multiobjective optimization (5/5) Search space
 Multiobjective optimization aims at finding solutions  A set of all solutions to an optimization problem
 Non-dominated  Some examples
 Close to the true PF of the optimization problem  Real numbers ℝ
 Well distributed (covering a wide range of the true PF)  Real vectors ℝd
 Binary vectors { 0, 1 }d
 Two contradicting requirements
 Permutations
 Convergence (to the true PF)  Expressions (in Genetic Programming)
 Diversity (along the PF)  Rules
Graphs
 Many solutions are required to approximate the PF 

 Machine learning models (trees, neural networks)


 Population-based methods (e.g. evolutionary algorithms)
are a good choice  …

7 8

Computational complexity Computational complexity


 A measure of resources (time, memory, etc.)  O(n ) denotes a linear complexity
required to solve computational problems  The algorithm runs 3 times longer to process 30 elements than
to process 10 elements
 The big O notation
 Quadratic complexity O(n 2)
 Used to express computational complexity with relation to the
problem size n (e.g. number of items to process)  The algorithm runs 9 times longer when given 30 elements than
when given 10
 Formally, f(n ) ~ O(g(n )) if there exist positive numbers c and N
such that:  Note that an O(n) algorithm is also in the O(n 2) class
f(n ) ≤ c  g(n ) for all n ≥ N and O(n 3), and so on

 In other words, for sufficiently large n the function f(n ) grows  We usually only mention the „lowest” class to which
not faster than g(n ) a given algorithm belongs

9
 Average vs. worst-case 10

Computational complexity Computational complexity


 Examples  Examples

11 12

2
Computational complexity Travelling Salesman Problem (TSP)
 Examples  Given n cities (or other locations) find the shortest
tour visiting each city exactly once

 Applications:
 Transport optimization
 Electronics manufacure
(e.g. PLA design)

source:
http://gtresearchnews.gatech.edu/reshor/rh-f04/tsp.html

13 14

Travelling Salesman Problem (TSP) Travelling Salesman Problem (TSP)


 Typical solution representation: a permutation of n  Typical solution representation: a permutation of n
elements elements
To be precise, n ! is the size of the search space if the permutation-based
representation is used.
[ 3, 4, 2, 1, 5, 6, 7 ] [ 3, 4, 2, 1, 5, 6, 7 ]
The number of different solutions encoded using this representation is
(n-1)!, because you can start the tour at any of the cities.
 Number of solutions: n ! = 1 * 2 * … * n  Number of solutions: n ! = 1 * 2 * … * n
Moreover, if the problem is symmetrical (ci,j = cj,i) the number of
different solutions is further reduced by half, because the tour can be
n =5 n ! = 120 n =5 n ! = 120
travelled in any direction.
n = 10 n ! = 3 628 800 ≈ 3.63  106 n = 10 n ! = 3 628 800 ≈ 3.63  106
n = 100 n ! ≈ 9.33  10157 n = 100 n ! ≈ 9.33  10157

15 16

Travelling Salesman Problem (TSP) Travelling Salesman Problem (TSP)


 For n = 100 we have n ! ≈ 9.33  10157 permutations  For n = 100 we have n ! ≈ 9.33  10157 permutations
Repeat the following construction for every atom in the observable universe 
Then, try to find good solutions... here...
 How large is this number?  How large is this number?

 To put it in perspective:  To put in in perspective:


 The estimated number of atoms in the whole observable  The estimated number of atoms in the whole observable
universe[1] is between 1078 and 1082 universe[1] is between 1078 and 1082

 Given that 9.33  10157 ≈ (1079)2, we would have to take all  Given that 9.33  10157 ≈ (1079)2, we would have to take all
the atoms in the whole observable universe and replace atoms in the whole observable universe and replace every
every single one with the entire universe. single one with the entire universe 
https://commons.wikimedia.org/wiki/File:8_Observable_Universe_(ELitU).png

[1] https://www.universetoday.com/36302/atoms-in-the-universe/ 17 [1] https://www.universetoday.com/36302/atoms-in-the-universe/ 18

3
Travelling Salesman Problem (TSP) Knapsack Problem (KP)
 Cost matrix [ c i,j ]i ,j = 1, …, n  Given n items, each with a weight wi and a value vi
choose the items to pack to a knapsack with the
 Symmetrical for the TSP
weight limit W so tha the total value is maximized.
 Non-symmetrical for the ATSP
source: https://www.maps-of-the-usa.com/maps/usa/
table-of-distances-between-the-cities-of-the-usa.jpg  Simpler version
 Pack the knapsack with as much
weight as possible
 Evaluation of a solution    n
n 1 Formally: wi = vi
f ( )  c [ n ], [1]   c [ i ], [ i 1]

i 1  The decision version is called


the subset-sum problem
(can the knapsack be fully filled?) CC BY-SA 2.5,
https://commons.wikimedia.org/w/index.php?curid=985491

19 20

Knapsack Problem (KP) Decision problems


 Typical solution representation: a binary vector of n  KP and TSP discussed in the previous slides are
elements optimization problems
n

[ 0, 1, 0, 1, 1, 1, 0 ]
max
xi {0 ,1}
v x
i 1
i i
 The task is to find a solution with the minimal or
n maximal value of the goal function
subject to :  wi xi  W
i 1
 The corresponding decision problems are:
 KP: Can a value of at least V be achieved without
 Number of solutions: 2n Constrained optimization exceeding the weight W ?
problem
n =5 2n = 32  TSP: Given the cost matrix and a number L, decide
n = 10 2n = 1024 whether there is a round-trip route cheaper than L
n = 100 2n ≈ 1.27  1030
21 22

P and NP problem classes P vs. NP


 Polynomial time (P) class  Obviously, P  NP
 Decision problems that can be solved by a deterministic  If you can find a solution in at most O(n k) steps then it also
algorithm in at most O(n k) steps, where n is the problem is a proof that the answer is "yes"
size and k  ℕ
 P is often treated as the class of computational problems  Does also NP  P ?
which are "efficiently solvable" or "tractable"  That's a million dollar question! (literally:
https://en.wikipedia.org/wiki/Millennium_Prize_Problems)
 Non-deterministic polynomial time (NP) class
 This would, naturally, imply P = NP
 Decision problems for which the problem instances, where
the answer is "yes", have proofs verifiable by a  Common-sense intepretation: if verifying a solution is easy,
deterministic algorithm in polynomial time (i.e. in at most is also finding a solution easy?
O(n k) steps)
 So far, we don't know…
23 24

4
P vs. NP Graph Protection Problems
 Many people intuitively feel that P  NP, because  A threat is spreading on a graph G =  V, E 
finding a solution is thought to be harder than merely  We can protect vertices or edges
veifying one
Goal: minimize the losses
 Hovewer, there is no consensus among the 

specialists[1]  Multiobjective variants: also minimize the protection cost


 Solutions often evaluated using simulations

[1] https://www.cs.umd.edu/users/gasarch/BLOGPAPERS/pollpaper2.pdf Erdős–Rényi REDS


25 26

Graph Protection Problems The Firefighter Problem (FFP)


 A threat is spreading on a graph G =  V, E   Introduced by Hartnell in 1995[1]
 WeFun
can
factsprotect
 vertices or edges  Spread of fire is modelled on an undirected graph
 Goal: minimize
Paul Erdős the wrote
(1913-1996) losses
around 1,500 mathema-  Discrete-time model
tical articles in his lifetime, mostly co-written. He had
 Multiobjective variants: also minimize the
509 direct collaborators. protection cost  Vertices are labelled:
 'B' – burning
In mathematics, and especially network science the
 Solutions often
Erdős number evaluated
is the using
number of "hops" simulations
needed to  'D' – defended by firefighters
connect the author of a paper with Paul Erdős.
Paul Erdős has an Erdős number of zero. Anybody else's Erdős number is  'U' – untouched
k + 1 where k is the lowest Erdős number of any coauthor
 In the initial state S0 a certain number Ns of vertices are burning
('B') and the remaining ones are untouched

[1] B. Hartnell "Firefighter! An application of domination", in: 20th Conference on Numerical


Erdős–Rényi REDS Mathematics and Computing (1995)
27 28

The Firefighter Problem (FFP) The Firefighter Problem – An Example


 At each time step 1 7 9
Nf firefighters are assigned to the untouched ('U') nodes. These nodes 5

become defended ('D')


Ns = 1
3 6
 The fire spreads: nodes adjacent to the burning nodes catch on fire Nf = 2
(unless they are defended by firefighters) 8
4
2
10
 The simulation stops when the fire is contained or when
all undefended nodes are burning P = 3, 4, 2, 1, 6, 7, 8, 9, 10, 5
t=0
 Representation of a solution:
- Ns initial nodes are burning
 A permutation = the order in which the nodes are protected
 Other representations possible

29 30

5
The Firefighter Problem – An Example The Firefighter Problem – An Example

1 7 9 1 7 9
5 5
Ns = 1 Ns = 1
3 6 3 6
Nf = 2 Nf = 2
8 8
4 4
2 2
10 10

P = 3, 4, 2, 1, 6, 7, 8, 9, 10, 5 P = 3, 4, 2, 1, 6, 7, 8, 9, 10, 5
t=1 t=1
- Nf firefighters are assigned - the fire spreads to adjacent nodes

31 32

The Firefighter Problem – An Example The Firefighter Problem – An Example

1 7 9 1 7 9
5 5
Ns = 1 Ns = 1
3 6 3 6
Nf = 2 Nf = 2
8 8
4 4
2 2
10 10

P = 3, 4, 2, 1, 6, 7, 8, 9, 10, 5 P = 3, 4, 2, 1, 6, 7, 8, 9, 10, 5
t=2 t=2
- Nf firefighters are assigned - the fire spreads to adjacent nodes

Note, that at this point the fire cannot spread any further and
33
the simulation can be stopped 34

FFP – An Optimization Problem The Multiobjective Firefighter Problem*)


 Task: Find the best assignment of firefighters to graph  For each vertex v there are m different values vi (v ),
nodes i = 1, …, m

 Single-objecitve: save the highest possible number of  The m objectives fi , i = 1, ..., m attained by a given
nodes in the graph solution are calculated as follows:

 Single-objective with variable node cost:

where:
vi (v ) - the value of node v according to the i - th criterion
where:
c (v ) – the cost assigned to node v
*) Introduced in: K. Michalak, "Auto-adaptation of Genetic Operators for Multi-objective Optimization in the Firefighter
Problem", Intelligent Data Engineering and Automated Learning IDEAL 2014, Lecture Notes in Computer Science, vol. 8669,
pp. 484-491, Springer, 2014.
35 36

6
Animal Diseases Control Financial Contagion
 Epidemic modelled on a graph[1]  Bankruptcies modelled on a graph G =  V, E 
 |V| = 9886 (9313 farms, 573 pastures,
560812 animals)
 |E| = 40328 (animal movements involving
 Threshold spreading model
168435 animals)  Banktrupt companies do not pay their dues
53 time steps (weeks)
Lost revenue incurrs a load on other companies

 The Susceptible, Vaccinated Infected,  If the loss exceeds a threshold the company fails
Recovered (SVIR) model  But, companies can keep reserves

 Epidemic outbreak: 1% of the farms  Initially, a few companies go bankrupt


 Disease transmission probability Spreading of the disease with αinf =
0.01, βs = 0.5 and βv = 0.01 during  Subsequently, a wave of bankruptcies is simulated (or
βs = 0.5 for susceptible animals one year (53 time periods). Axes
happens for real)

 βv = 0.01 for vaccinated animals show geographic coordinates.

[1] K. Michalak, M. Giacobini, "The Influence of Uncertainties on Optimization of Vaccinations on a Network of Animal
Movements", Soft Computing (IF2021 = 3.732), vol. 25, pp. 4907-4923, ISSN: 1432-7643, Springer, 2021. 37 38

Systemic Risk Mitigation Systemic Risk Mitigation


 Protection of vertices: select appropriate levels of reser-  Another approach: modify the graph connectivity
ves for companies
 Ladley[1] observed, that the system shows different levels
 Optimization problem with the search space Ω = [0, 1]|V| of resilience to shocks of various magnitudes depending
on how densely it is connected
 Goal minimize the number / value of bankrupt companies  When small shocks happen it is better to have more connections
in the system.
 Multiobjective variant: also minimizing the reserves  When large shocks happen it is better to have fewer connections
in the system

 Conclusion: no system is optimal w.r.t. resilience to


shocks of all possible magnitudes

[1] D. Ladley, "Contagion and risk-sharing on the inter-bank market", Journal of Economic Dynamics and Control 37, vol. 7,
39 pp. 1384–1400, 2013. 40

Systemic Risk Mitigation Graph Protection Problems


|V| = 1500  A whole variety of problems depending on:
 The area of applications
 Threat spreading mechanism
 What is modified (vertices? edges?) and how

Optimization What is modified Threat Search


problem spreading space
Firefighter Problem Vertices Deterministic Permutations

Epidemics Control Vertices (vaccinations) Probabilistic Binary vectors


Edges (social distancing) Binary vectors
Systemic Risk Vertices (company reserves) Threshold Real vectors
Mitigation Edges (business relationships) Binary vectors

Conversely, Influence Maximization problem is also


The optimal connectivity (percentage of active connections each node maintains) which leads
to the minimum number of nodes that eventually fail for a given initial shock size (black line)[1] 
[1] K. Michalak, "Surrogate-based Optimization for Reduction of Contagion Susceptibility in Financial Systems", GECCO '19
Proceedings of the Genetic and Evolutionary Computation Conference, Prague, Czech Republic - July 13-17, 2019,
studied
ISBN: 978-1-4503-5618-3, pp. 1266-1274, ACM New York, NY, USA, 2019. 41 42

You might also like