# Random Search Methods

Document Sample

```					  Random Search Methods
   Simulated Annealing
   Tabu Search
   Genetic Algorithms
   Job scheduling problem
   Branch-and-bound
   Beam search

December 4, 2011               1
Simulated Annealing (SA)
   Notation
   S0 is the best solution found so far
   Sk is the current solution
   G(Sk) it the performance of a solution
   Note that                            Aspiration Criterion
G(S k )  G(S0 )

December 4, 2011                                           2
Acceptance Criterion
   Let Sc be the candidate solution
   If G(Sc) < G(Sk) accept Sc and let
S k 1  S c
   If G(Sc)  G(Sk) move to Sc with
probability
Always  0                           G ( S k ) G ( S c )
k
P(Sk 1 , Sc )  e

Temperature > 0
December 4, 2011                                                         3
Cooling Schedule
    The temperature should satisfy
1   2   3  ...  0
    Normally we let
k  0
but we sometimes stop when some
predetermined final temperature is reached
    If temperature is decreased slowly
convergence is guaranteed

December 4, 2011                              4
SA Algorithm

Step 1:
Set k = 1 and select the initial temperature 1.
Select an initial solution S1 and set S0 = S1.
Step 2:
Select a candidate solution Sc from N(Sk).
If G(S0) < G(Sc) < G(Sk), set Sk+1 = Sc and go to Step 3.
If G(Sc) < G(S0), set S0 = Sk+1 = Sc and go to Step 3.
If G(Sc) < G(S0), generate Uk Uniform(0,1);
If Uk  P(Sk, Sc), set Sk+1 = Sc; otherwise set Sk+1 = Sk; go to
Step 3.
Step 3:
Select k+1  k.
Let k=k+1. If k=N STOP; otherwise go to Step 2.
December 4, 2011                                                     5
Discussion
   SA has been applied successfully to
many industry problems
   Allows us to escape local optima
   Performance depends on
   Construction of neighborhood
   Cooling schedule

December 4, 2011                            6
Tabu Search
   Similar to SA but uses a deterministic
acceptance/rejection criterion
   Maintain a tabu list of solution
changes
   A move made entered at top of tabu list
   Fixed length (5-9)
   Neighbors restricted to solutions not
requiring a tabu move
December 4, 2011                                      7
Tabu List
   Rational
   Avoid returning to a local optimum
   A tabu move could lead to a better
schedule
   Length of list
   Too short  cycling (“stuck”)
   Too long  search too constrained

December 4, 2011                                 8
Tabu Search Algorithm
Step 1:
Set k = 1. Select an initial solution S1 and set S0 = S1.
Step 2:
Select a candidate solution Sc from N(Sk).
If Sk  Sc on tabu list set Sk+1 = Sk and go to Step 3.
Enter Sc  Sk on tabu list.
Push all the other entries down (and delete the last one).
If G(Sc) < G(S0), set S0 = Sc.
Go to Step 3.
Step 3:
Select k+1  k.
Let k=k+1. If k=N STOP; otherwise go to Step 2.
December 4, 2011                                               9
Scheduling Problem
   Allocate scarce resources to tasks
   Combinatorial optimization problem

Maximize profit
Subject to constraints

   Mathematical techniques and heuristics
December 4, 2011                            10
Decision Variables
   Three basic types of solutions:
   A sequence: a permutation of the jobs
   A schedule: allocation of the jobs in a more
complicated setting of the environment
   A scheduling policy: determines the next job
given the current state of the system

December 4, 2011                                           11
Objectives and
Performance Measures
   Throughput (TP) and makespan (Cmax)
   Due date related objectives
(response time), finished inventory
   Others

December 4, 2011                            12
Single Machine Total Weighted
Tardiness Example
Jobs              1    2    3    4

pj             10   10   13   4

dj             4    2    1    12

wj              14   12   1    12

December 4, 2011                       13
Initialization
    Tabu list empty L={}
    Initial schedule S1 = (2,1,4,3)
20 - 4 = 16

10 - 2 = 8
37 - 1 = 36
24 - 12 = 12

0                      10             20        30       40

w T      j   j    14 16  12  8  1 36  12 12  500
December 4, 2011                                                       14
Neighborhood
   Define the neighborhood as all
interchanges
   The neighbors of S1 = (2,1,4,3) are
(1,2,4,3)     Select the best
non-tabu schedule
(2,4,1,3)
(2,1,3,4)
   Objective values are: 480, 436, 652
December 4, 2011                                   15
Second Iteration
   Let S0 =S2 = (2,4,1,3). G(S0)=436.
   Let L = {(1,4)}
   New neighborhood
Sequence        (4,2,1,3)   (2,1,4,3)   (2,4,3,1)

w T       j     460         500         608

December 4, 2011                                           16
Third Iteration
    Let S3 = (4,2,1,3), S0 = (2,4,1,3).
    Let L = {(2,4),(1,4)}
    New neighborhood
Sequence        (2,4,1,3)   (4,1,2,3)   (4,2,3,1)

w T       j     436         440           632

Tabu!
December 4, 2011                                           17
Fourth Iteration
    Let S4 = (4,1,2,3), S0 = (2,4,1,3).
    Let L = {(1,2),(2,4)}
    New neighborhood
Sequence        (1,4,2,3)   (4,2,1,3)   (4,1,3,2)

w T       j     402         460         586

December 4, 2011                                           18
Fifth Iteration
    Let S5 = (1,4,2,3), S0 = (1,4,2,3).
    Let L = {(1,4),(1,2)}
    This turns out to be the optimal
schedule
    Tabu search still continues
    Notes:
   Optimal schedule only found via tabu list
   We never know if we have found the optimum!
December 4, 2011                                    19
Genetic Algorithms
    Schedules are individuals that form
populations
    Each individual has associated fitness
    Fit individuals reproduce and have
children in the next generation
    Very fit individuals survive into the next
generation
    Some individuals mutate
December 4, 2011                              20
Total Weighted Tardiness
Single Machine Example
Initial population
   First Generation                         selected randomly

Individual          (2,1,3,4)   (3,4,1,2)     (4,1,3,2)
(sequence)
Fitness
 w T    j   j
652         814            586

December 4, 2011                                                    21
Mutation Operator                                    Fittest
Individual

Individual   (2,1,3,4)   (3,4,1,2)     (4,1,3,2)

Fitness     652         814            586

Reproduction
via mutation

(4,3,1,2)

December 4, 2011                                                  22
Cross-Over Operator                                         Fittest
Individuals

Individual       (2,1,3,4)      (4,3,1,2)        (4,1,3,2)

Fitness         652              758            586

(4,1,3,2)                       (2,1,3,2)
Reproduction                      Infeasible!
via cross-over
(2,1,3,4)                       (4,1,3,4)

December 4, 2011                                                          23
Representing Schedules
   When using GA we often represent
individuals using binary strings

(0 1 1 0 1 0 1 0 1 0 1 0 0 )
(1 0 0 1 1 0 1 0 1 0 1 1 1 )

(0 1 1 0 1 0 1 0 1 0 1 1 1 )

December 4, 2011                            24
Discussion
   Genetic algorithms have been used very
successfully
   Very generic
   Easily programmed
   A method that exploits special structure is
usually faster (if it exists)

December 4, 2011                                     25
Branch and Bound
   Enumerative method
   Guarantees finding the best schedule
   Basic idea:
   Look at a set of schedules
   Develop a bound on the performance
   Discard (fathom) if bound worse than best
schedule found before

December 4, 2011                                   26
Classic Results
   The EDD rule is optimal for 1 || Lm ax
   If jobs have different release dates,
which we denote
1 | r j | Lm ax
then the problem is NP-Hard
   What makes it so much more difficult?

December 4, 2011                               27
1 | r j | Lm ax
Jobs           1     2     3
pj           4     2     5
EDD                        rj           0     3     5
dj           8    14    10

1                 2                  3
0                 5               10                  15

r1         r2    r3          d1    d3            d2

Lm ax  max L1 , L2 , L3   max C1  d1 , C2  d 2 , C3  d 3    Can we
 max 4  8,10  14 ,15  10  max  4,4,5  5             improve?

December 4, 2011                                                       28
Delay Schedule

1                  3                   2
0                  5              10                   15

r1         r2      r3      d1      d3             d2

Lm ax  max L1 , L2 , L3   max C1  d1 , C2  d 2 , C3  d 3 
 max 4  8,16  14 ,10  10  max  4,2,0  3

What makes this problem hard is that
the optimal schedule is not necessarily
a non-delay schedule

December 4, 2011                                                     29
Final Classic Result
   The preemptive EDD rule is optimal for
the preemptive (prmp) version of the
problem
1 | rj , prmp | Lm ax

   Note that in the previous example, the preemptive
EDD rule gives us the optimal schedule

December 4, 2011                                      30
Branch and Bound
   The problem
1 | r j | Lm ax

cannot be solved using a simple dispatching
rule so we will try to solve it using branch and
bound
   To develop a branch and bound procedure:
   Determine how to branch
   Determine how to bound

December 4, 2011                                  31
Data
Jobs              1   2    3    4

pj             4   2    6    5

rj             0   1    3    5

dj             8   12   11   10

December 4, 2011                      32
Branching
(•,•,•,•)

(1,•,•,•)          (2,•,•,•)               (3,•,•,•)   (4,•,•,•)

December 4, 2011                                                   33
Branching
(•,•,•,•)

(1,•,•,•)          (2,•,•,•)               (3,•,•,•)      (4,•,•,•)

r3  3
r4  5
December 4, 2011                                                      34
Branching
(•,•,•,•)

(1,•,•,•)          (2,•,•,•)               (3,•,•,•)   (4,•,•,•)

Need to develop lower bounds on
these nodes and do further branching.

December 4, 2011                                                   35
Bounding (in general)
   Typical way to develop bounds is to relax the
original problem to an easily solvable problem
   Three cases:
   If there is no solution to the relaxed problem there is
no solution to the original problem
   If the optimal solution to the relaxed problem is
feasible for the original problem then it is also
optimal for the original problem
   If the optimal solution to the relaxed problem is not
feasible for the original problem it provides a bound
on its performance
December 4, 2011                                          36
Relaxing the Problem
   The problem
1 | rj , prmp | Lm ax
is a relaxation to the problem 1 | r j | Lm ax

   Not allowing preemption is a constraint in the
original problem but not the relaxed problem
   We know how to solve the relaxed problem
(preemptive EDD rule)

December 4, 2011                                       37
Bounding
   Preemptive EDD rule optimal for the
preemptive version of the problem
   Thus, solution obtained is a lower
bound on the maximum delay
   If preemptive EDD results in a non-
preemptive schedule all nodes with
higher lower bounds can be discarded.

December 4, 2011                          38
Lower Bounds

   Job with EDD is Job 4 but
   Second earliest due date is for Job 3

Job 1
Lm ax  5
Job 2
Job 3
Job 4

0    10       20

December 4, 2011                                    39
Branching
(•,•,•,•)
Lm ax  5

(1,•,•,•)          (2,•,•,•)               (3,•,•,•)        (4,•,•,•)

(1,2,•,•)          (1,3,•,•)                    Lm ax  7

Lm ax  6
(1,3,4,2)        Lm ax  5

December 4, 2011                                                        40
Beam Search
   Branch and Bound:
   Considers every node
   Guarantees optimum
   Usually too slow
   Beam search
   Considers only most promising nodes
    (beam width)
   Does not guarantee convergence
   Much faster

December 4, 2011                          41
Single Machine Example
(Total Weighted Tardiness)

Jobs              1    2    3    4

pj             10   10   13   4

dj             4    2    1    12

wj              14   12   1    12
December 4, 2011                       42
Branching                (Beam width = 2)

(•,•,•,•)

(1,•,•,•)          (2,•,•,•)               (3,•,•,•)   (4,•,•,•)

ATC Rule

(1,4,2,3)          (2,4,1,3)               (3,4,1,2)   (4,1,2,3)

408               436                     814         440

December 4, 2011                                                   43
Beam Search
(•,•,•,•)

(1,•,•,•)           (2,•,•,•)                (3,•,•,•)           (4,•,•,•)

(1,2,•,•)     (1,3,•,•)   (1,4,•,•)           (2,1,•,•)    (2,3,•,•)    (2,4,•,•)

(1,4,2,3)     (1,4,3,2)                    (2,4,1,3)     (2,4,3,1)

December 4, 2011                                                             44
Discussion
   Careful evaluation of nodes (accuracy)
   Crude evaluation of nodes (speed)
    Two-stage procedure
   Filtering
   crude evaluation
   filter width > beam width
   Careful evaluation of remaining nodes

December 4, 2011                               45

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 11 posted: 12/4/2011 language: English pages: 45
How are you planning on using Docstoc?