You are on page 1of 4

Diskrete Optimering mbv Soek Heuristiese Metodes /

Search Heuristics for Discrete Optimization

Verbeterings soek algoritmes / Improving search algorithms

Definisies / definitions:

Skuif versameling M / Move set M :

Moet gedefinieer word bv spesifieke versameling, of volgens sekere reëls soos bv ruil indekse,
volgorde, posisie, .. ens.

Must be defined – specific given set or according to rules (swap sequence,indexes, etc)

Omgewing / Neighborhood : Die huidige oplossing en alle punte wat bereik kan word met een
skuif ∆x є M vorm die omgewing.

The current solution and all reachable from it in a single move ∆x є M comprise its
neighborhood.

Algoritme (maksimering) / Algorithm (maximizing)

t = 1 :Kies enige toelaatbare beginpunt / choose any feasible starting point x(0), LB = Z(1)

Stap 1 / step 1: Skuif mbv toelaatbare ∆x є M, x(t) + ∆x en Z(t) die doelfunksiewaarde. (*) vir
maksimum toename . Gaan na stap 3 indien geen toelaatbare moontlike skuif /

Choose any feasible move ∆x є M, x(t) + ∆x and Z(t) the objective function value. (*) for
maximum improvement. Go to step 3 if no possible feasible move

Stap 2 / step 2 :Gaan na stap 3 indien geen toelaatbare ∆x є M verbetering gee nie, anders
x(t+1) = x*(t) + ∆x: LB = Z*(t): t → t+1 . Gaan na stap 1 /

Goto step 3 if no improvement, else x(t+1) = x*(t) + ∆x : LB = Z*(t): t → t+1 . Go to step 1

Stap 3 / step 3: Stop. LB is lokale maksimum. / Stop. LB is local maximum.


Voorbeeld 1/ Example 1:

Maks / Max Z= [20 -4 14] x


oa/st [2 1 4] x ≤ 5
x є {0,1}

M = {(1,0,0), (-1,0,0), (0,1,0), (0,-1,0), (0,0,1), (0,0,-1)};

x(1) = (1,1,0), toelaatbaar/ feasible, LB=Z=16

X = nie toelaatbaar / not feasible

(1,1,0) + (1,0,0) = (2,1,0) X


(1,1,0) + (-1,0,0) = (0,1,0); Z =-4
(1,1,0) + (0,1,0) = (1,2,0) X
(1,1,0) + (0,-1,0) = (1,0,0); Z* = 20, LB = 20
(1,1,0) + (0,0,1) = (1,1,1) X
(1,1,0) + (0,0,-1) = (1,1,-1) X

x(2)= (1,0,0)
Geen verbetering word verder verkry met ∆x є M, (1,0,0) is lokale maksimum
No further improvement with ∆x є M, (1,0,0) is local maximum.

Ruil indekse paargewys / pairwise index swapping :

x(1) = (1,1,0), Z=16; x(2) = (0,1,1), Z = 10; x(3) = (1,0,1) ,X


Geen verbetering, x(1) is lokale optimum / No improvement, x(1) is local optimum

Voorbeeld 2 / Example 2 :TSP Minimeer / Minimize

A B C D E
A - 13 15 8 12
B 13 - 14 16 8
C 15 14 - 9 6
D 8 16 9 - 8
E 12 8 6 8 -

Optimaal / optimal Z* = 44, x* = (A-D-C-E-B-A) mbv /using B+B

M ≈ {ruil indekse paargewys / pairwise interchanges}

t=1 x(1) = (A-B-C-D-E-A), Z=56, UB = 56

A↔B :(1) (B-A-C-D-E-B) Z=53


A↔C :(2) (C-B-A-D-E-C) Z*=49, UB = 49
A↔D :(3) (D-B-C-A-E-D) Z=65
A↔E :(4) (E-B-C-D-A-E) Z=51
B↔C :(5)=(3) (A-C-B-D-E-A)
B↔D :(6)=(4) (A-D-C-B-E-A)
B↔E :(7) (A-E-C-D-B-A) Z=56
C↔D :(8)=(7) (A-B-D-C-E-A)
C↔E :(9)=(1) (A-B-E-D-C-A)
D↔E :(10)=(2) (A-B-C-E-D-A)

10 moontlikhede, slegs 5 is uniek / 10 possibilities, only 5 unique

t=2 x(2) = (C-B-A-D-E-C) Z = 49

C↔B (B-C-A-D-E-B) Z=53


C↔A (A-B-C-D-E-A) Z=56
C↔D (D-B-A-C-E-D) Z=58
C↔E (E-B-A-D-C-E) Z*=44, UB = 44
B↔E (C-E-A-D-B-C) Z=56

t=3 x(3)=(E-B-A-D-C-E) optimaal van B+B metode / optimal from B+B method

Voorbeeld 3 / example 3 : Rugsak probleem / Knapsack problem

Maks / Max [18 25 11 14] x


oa/st [2 2 1 1] x ≤ 3
x є {0,1}

M ≈ {enkel komplement skuif / single complement move}

t=1: x(1) = (1,0,0,0) Z=18, LB =18

Toelaatbare omgewing / feasible neighbors :

(0,0,0,0) Z=0
(1,0,1,0) Z=29
(1,0,0,1) Z*=32 (LB=32)

t=2: x(2) = (1,0,0,1)

Toelaatbare omgewing / feasible neighbors :

(0,0,0,1) Z=14
(1,0,0,0) Z=18

Geen verbetering / no improvement

lokale maks. / local maximum 32


Meervoudige beginpunte Soektog / Multistart Search

Maks / Max [18 25 11 14] x


oa/st [2 2 1 1] x ≤ 3
x є {0,1}

Beginpunte / initial solutions : (1,0,0,0); (0,1,0,0) en (0,0,1,0)

Van hierbo is lokale maks Z=32, beginpunt (1,0,0,0), LB = 32


From above local max Z =32, initial solution (1,0,0,0), LB = 32

Beginpunt x(1) = (0,1,0,0):


Toelaatbare omgewing / feasible neighbors:
(0,0,0,0) →Z=0; (0,1,1,0) → Z=36; (0,1,0,1) → Z=39
x(2) = (0,1,0,1), Z = 39
Toelaatbare omgewing / feasible neighbors:
(0,0,0,1) → Z =14; (0,1,0,0) → Z = 25
LB =39

Beginpunt x(1) = (0,0,1,0):


Toelaatbare omgewing / feasible neighbors:
(1,0,1.0) →Z=29; (0,1,1,0) → Z=36; (0,0,0,0) →Z=0; (0,0,1,1) → Z=25
x(2)=(0,1,1,0); Z=36
Toelaatbare omgewing / feasible neighbors:
(0,0,1,0) → Z =11; (0,1,0,0) → Z =25
LB =39

Lokale maks / local max Z=39

You might also like