1
Exact and heuristics algorithms
2
Introduction An optimization problem is the problem of finding the best solution from all feasible solutions
• Example: we want the minimum cost path from s to a goal t
3
Introduction• Navigation
– path-cost = distance to node in miles – minimum => minimum time, least fuel
4
Introduction• VLSI Design (Very-large-scale
integration)– path-cost = length of wires between chips– minimum => least clock/signal delay
5
Introduction• Puzzle
– path-cost = number of pieces moved– minimum => least time to solve the puzzle
6
Combinatorial optimization problem
• A set of solution for combinatory optimization problem can be mathematically modeled using:
• Variables vector x = (x1, x2, ..., xn),• Variable domaine D = (D1, D2, ..., Dn), or (Di)
i=1,...,n finite sets,• Constraints set,• F: Objective function to minimize or to
maximize,• A set of all feasible solutions
• S = {x = (x1, x2, , xn)} ϵ D / x satisfies all the constraints S is also called search space.
7
Combinatorial optimization problem
• Facilities layout problem is consisted of a variety of problems. The main problems are: Storage (warehouses) architectural design and general layout
problem, picking, response time for the order processing, minimization of travel distances in the
warehouse, routing of pickers or automated guided vehicles,
personnel and machine Scheduling.
8
Combinatorial optimization problem
• Example: Warehouse location problem Warehouses location problem: It aims to compute optimal
location for the warehouses in given area based on location of factories with their production capacities, the location of clients with their demands, warehouse storage capacities.
MathModelMathModel SolutionSolution
Inputs
Inputs
Outputs
Outputs
9
Combinatorial optimization problem
• Example: Warehouse location problem
• We need to answer these questions: – how many warehouse are needed in a given
area? – Where can we deploy them? – How to assign clients to the warehouse and
respect constraints?
10
Combinatorial optimization problem
• So, we can model this problem as follows:– Let I={1,…,m} be the set of possible locations to
establish a warehouse, – J={ 1,…,n} be the set of customers,
– Cij denoting the amount of transportation from warehouse i to customer j,
– dj be the demand of customer j.
– ai be the opening cost of warehouse i.
– Let Yi be a decision variable that is not null if the warehouse i is opened and Xij a binary variable not null if the client j is assigned to warehouse i, and Wi is the ith warehouse capacity. These variables are summarized in the following table.
11
Combinatorial optimization problemVariable Notation
Investment cost to build warehouse i ai
ith warehouse capacity Wi
Binary decision variable of affecting client j to warehouse i
Xij
Decision variable to open or not warehouse i yiTransportation Cost of client j toward the warehouse i
Cij
Client j demand djMax number of initial warehouse mClient number n
12
Combinatorial optimization problem
• Objectives functions: • F1 minimizes the investment cost , • F2 minimizes the transportation cost, • We combine the two functions into a single
objective function F:
• With:
F F1 F2
m
iyiaiF
1min1
m
i
n
jxijcijF
1 1min2
13
Combinatorial optimization problem
• Constraints • Ensures that client j is affected only to one warehouse;
• guarantees that the sum of the demand dj is smaller than the warehouse capacity;
• Integrity constraints
ijxi 1
m 1
jd ijxj 1
n iW iy
ijx {0,1} 1,0jy
14
Exact and heuristic solution
Exact Heuristic
An exact algorithm is typically deterministic and proven to yield an optimal result.
A heuristic has no proof of correctness, often involves random elements, and may not yield optimal results.
Lot of iterations, lot of constraints Big computation resources Long time
Does not explore all possible states of the problem short time
Exact solution Optimal (Good solution)
What to use? When?
15
Complexity of a problem• The theory of classifying problems based on how
difficult they are to solve:• P-problem (polynomial-time) • NP-problem (nondeterministic polynomial-time)
16
Complexity of a problem• The theory of classifying problems based on how
difficult they are to solve.
– A problem is assigned to the P-problem (polynomial-time) class if the number of steps needed to solve it is bounded by some power of the problem's size.
– A problem is assigned to the NP-problem (nondeterministic polynomial-time) class if it permits a nondeterministic solution and the number of steps to verify the solution is bounded by some power of the problem's size.
17
Complexity of a problem• Problem complexity:• We measure the time to solve a problem
of input size n by a function T(n).• Example:
18
Complexity of a problem• Problem complexity:• Algorithm complexity can be expressed in
Order notation, e.g. “at what rate does work grow with N?”:– O(1) Constant– O(logN) Sub-linear– O(N) Linear– O(NlogN) Nearly linear– O(N2) Quadratic– O(XN) Exponential
19
Solution• Solution for combinatorial optimization problem
includes different types of algorithms such as :– Algorithms based on geometry – “cut trees” algorithms – Genetic Algorithms – Neighborhood search algorithms – Dynamic programming – Linear and non-linear programming – Mixed integer programming – Particle swarm optimization – Simulated annealing algorithms
20
Genetic algorithm: introduction• Genetic Algorithms (GAs) are adaptive
heuristic search algorithm premised on the evolutionary ideas of natural selection and genetic. The basic concept of GAs is designed to simulate processes in natural system necessary for evolution, specifically those that follow the principles first laid down by Charles Darwin of survival of the fittest. As such they represent an intelligent exploitation of a random search within a defined search space to solve a problem.
21
Genetic algorithm: Chromosomes
• Chromosomes are used to code information.
• Example: 3 warehouses, 5 clients
W1 W2 W3 C1 C2 C3 C4 C5
1 0 1 3 2 1 1 2
22
Genetic algorithm: OperatorsPopulationPopulation
SelectSelect
CrossoverCrossover
MutationMutation
Recombination
Recombination
Best solution
Best solution
Final iterati
on
Final iterati
on
Yes
No
23
Genetic algorithm: OperatorsPopulationPopulation
SelectSelect
1- Randomly generate an initial population (random chromosomes)
3-Select some chromosomes from the population as an offspring individual:
-Randomly - using stochastic method
2 -Compute and save the fitness (Objective function F) for each individual (chromosomes) in the current population
24
Genetic algorithm: Operators• The crossover is done on a selected part of
population (offspring) to create the basis of the next generation (exchange information).
• This operator is applied with propability Pc
CrossoverCrossover
W1 W2 W3 C1 C2 C3 C4 C5
1 0 1 3 2 1 1 2
W1 W2 W3 C1 C2 C3 C4 C5
1 0 1 3 2 1 1 2
Father
Mother
25
Genetic algorithm: Operators
CrossoverCrossover
Child 1
Child 2
W1
W2
W3
C1 C2 C3 C4 C5
1 0 1 3 2 1 1 2
W1
W2
W3
C1 C2 C3 C4 C5
1 0 1 3 3 1 2 2
W1
W2
W3
C1 C2 C3 C4 C5
1 0 1 3 3 1 1 2
W1
W2
W3
C1 C2 C3 C4 C5
1 0 1 3 2 1 2 2
Father
Mother
26
Genetic algorithm: Operators• This operation is a random change in
the population. It modifies one or• more gene values in a chromosome to
have a new chromosom value in the pool.
• This operator is applied with propability Pm
MutationMutation
W1 W2 W3 C1 C2 C3 C4 C5
1 0 1 3 2 1 1 2
W1 W2 W3 C1 C2 C3 C4 C5
0 0 1 3 2 1 1 2
Current
New
27
Genetic algorithm: Operators• Recombination combines the
chromosomes from the initial population and the new offspring chromosomes.
Recombination
Recombination
Final iterati
on
Final iterati
on
• Repeat a fixed number of iteration or until the solution converge to one solution (always with the best fitness) .
28
Genetic algorithm: OperatorsPopulationPopulation
SelectSelect
CrossoverCrossover
MutationMutation
Recombination
Recombination
Best solution
Best solution
Final iterati
on
Final iterati
on
Yes
No
Top Related