1 / 28

Exact and heuristics algorithms

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

Introduction

- Navigation
- path-cost distance to node in miles
- minimum gt minimum time, least fuel

Introduction

- VLSI Design (Very-large-scale integration)
- path-cost length of wires between chips
- minimum gt least clock/signal delay

Introduction

- Puzzle
- path-cost number of pieces moved
- minimum gt least time to solve the puzzle

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)

i1,...,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.

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.

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.

Math Model

Inputs

Solution

Outputs

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?

Combinatorial optimization problem

- So, we can model this problem as follows
- Let I1,,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.

Combinatorial optimization problem

Variable 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 yi

Transportation Cost of client j toward the warehouse i Cij

Client j demand dj

Max number of initial warehouse m

Client number n

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

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

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?

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)

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.

Complexity of a problem

- Problem complexity
- We measure the time to solve a problem of input

size n by a function T(n). - Example

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

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

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.

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

Genetic algorithm Operators

Population

Select

Crossover

Mutation

No

Final iteration

Recombination

Yes

Best solution

Genetic algorithm Operators

Population

1- Randomly generate an initial population

(random chromosomes)

2 -Compute and save the fitness (Objective

function F) for each individual (chromosomes) in

the current population

Select

- 3-Select some chromosomes from the population as

an offspring individual - Randomly
- using stochastic method

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

Crossover

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 2 1 1 2

Father

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 2 1 1 2

Mother

Genetic algorithm Operators

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 2 1 1 2

Father

Crossover

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 3 1 2 2

Mother

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 3 1 1 2

Child 1

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 2 1 2 2

Child 2

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

Mutation

W1 W2 W3 C1 C2 C3 C4 C5

1 0 1 3 2 1 1 2

Current

New

W1 W2 W3 C1 C2 C3 C4 C5

0 0 1 3 2 1 1 2

Genetic algorithm Operators

- Recombination combines the chromosomes from the

initial population and the new offspring

chromosomes.

Recombination

- Repeat a fixed number of iteration or until the

solution converge to one solution (always with

the best fitness) .

Final iteration

Genetic algorithm Operators

Population

Select

Crossover

Mutation

No

Final iteration

Recombination

Yes

Best solution