# The Quadratic Assignment Problem (QAP) - PowerPoint PPT Presentation

1 / 34

The Quadratic Assignment Problem (QAP). common mathematical formulation for intra-company location problems cost of an assignment is determined by the distances and the material flows between all given entities

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

### The Quadratic Assignment Problem (QAP)

• common mathematical formulation for intra-company location problems

• cost of an assignment is determined by the distances and the material flows between all given entities

• each assignment decision has direct impact on the decision referring to all other objects

Layout and Design

### The Quadratic Assignment Problem (QAP)

• Activity relationship charts:

• graphical means of representing the desirability of locating pairs of machines/operations near to each other

• common letter codes for classification of “closeness” ratings:

• AAbsolutely necessary. Because two machines/operations use the same equipment or facilities, they must be located near each other.

• EEspecially important. The facilities may for example require the same personnel or records.

• IImportant. The activities may be located in sequence in the normal work flow.

Nahmias, S.: Production and Operations Analysis, 4th ed., McGraw-Hill, 2000, Chapter 10

Layout and Design

### The Quadratic Assignment Problem (QAP)

• common letter codes for classification of “closeness” ratings:

• OOrdinary importance. It would be convenient to have the facilities near each other, but it is not essential.

• UUnimportant. It does not matter whether the facilities are located near each other or not.

• XUndesirable. Locating a wedding department near one that uses flammable liquids would be an example of this category.

• In the original conception of the QAP a number giving the reason for each closeness rating is needed as well.

• In case of closeness rating “X” a negative value would be used to indicate the undesirability of closeness for the according machines/operations.

Nahmias, S.: Production and Operations Analysis, 4th ed., McGraw-Hill, 2000, Chapter 10

Layout and Design

### The Quadratic Assignment Problem (QAP)

• Example: Met Me, Inc., is a franchised chain of fast-food hamburger restaurants. A new restaurant is being located in a growing suburban community near Reston, Virginia. Each restaurant has the following departments:

1.Cooking burgers

2.Cooking fries

3.Packing and storing burgers

4.Drink dispensers

5.Counter servers

6.Drive-up server

Nahmias, S.: Production and Operations Analysis, 4th ed., McGraw-Hill, 2000, Chapter 10

Layout and Design

### The Quadratic Assignment Problem (QAP)

Activity relationship diagram for the example problem:

Nahmias, S.: Production and Operations Analysis, 4th ed., McGraw-Hill, 2000, Chapter 10

Layout and Design

### The Quadratic Assignment Problem (QAP)

• Mathematical formulation:

• we need both distances between the locations and material flow between organizational entities (OE)

• n organizational entities (OE), all of them are of same size and can therefore be interchanged with each other

• n locations, each of which can be provided withe each of the OE (exactly 1)

• thi ... transp. intensity, i.e. material flow between OE h and OE i

• djk ... distance between jand location k (not implicitly symmetric)

• Transportation costs are proportional to transported amount and distance.

Layout and Design

thi.

OE

i

h

...

...

...

djk.

locations

k

j

...

...

...

### The Quadratic Assignment Problem (QAP)

• If OE h is assigned to location jand OE i to location k

• the transportation cost per unit transported from OE h to OE i is determined by djk

• we determine the total transportation cost by multiplying djk with the material flow between OE h zu OE i which is thi

 Cost = thidjk

Layout and Design

thi.

OE

i

h

 Cost = thidjk

...

...

...

djk.

locations

k

j

...

...

...

### The Quadratic Assignment Problem (QAP)

Similar to the LAP:

binary decision variables

If OE h location j (xhj = 1)

and OE i location k(xik = 1)

 Transportation cost per unit transported from OE h to OE i :

 Total transportation cost:

xik = 1

xhj = 1

Layout and Design

### The Quadratic Assignment Problem (QAP)

Objective: Minimize the total transportation costs between all OE

Constraints

Similar to LAP!!!

für h = 1, ... , n ... each OE h assigned to exactly 1 location j

für j = 1, ... , n ... each location jis provided with exactly 1 OE h

= 0 or 1 ... binary decision variable

Layout and Design

A

B

C

### The Quadratic Assignment Problem (QAP)

• Example: Calculate cost for 3 OE (1 ,2 ,3) and 3 locations (A, B, C)

Distances between locations djk

Material flow thi

1 possible solution: 1  A, 2  B, 3  C, i.e. x1A = 1, x2B = 1, x3C = 1, all other xij = 0

All constraints are fulfilled.

Total transportation cost: 0*0 + 1*1 + 2*1 + 1*2 + 0*0 + 1*2 + 3*3 + 1*1 + 0*0 = 17

Layout and Design

2  A

3  B

1  C

### The Quadratic Assignment Problem (QAP)

This solution is not optimal since OE 1 and 3 (which have a high degree of material flow) are assigned to locations A and C (which have the highest distance between them).

A better solution would be.: 1  C, 2  A and 3  B, i.e. x1C= 1, x2A= 1, x3B= 1.

with total transportation cost: 0*0 + 3*1 + 1*1 + 2*2 + 0*0 + 2*1 + 1*3 + 1*1 + 0*0 = 14

Material flow

Distances

Layout and Design

### The Quadratic Assignment Problem (QAP)

We resorted the matrix

such that row and columns appear the following sequence 1  C, 2  A and 3  B, i.e C, A, B(it is advisable to perform the resorting in 2 steps: first rows than columns or the other way round)

Layout and Design

### The Quadratic Assignment Problem (QAP)

Starting heuristics:

• refer to the combination of one of the following possibilities to select an OE and a location.

• the core is defined by the already chosen OE

• After each iteration another OE is added to the core due to one of the following priorities

Layout and Design

### Selection of (non-assigned) OE

A1those having the maximum sum of material flow to all (other) OE

A2a) those having the maximum material flow to the last-assigned OE

b) those having the maximum material flow to an assigned OE

A3those having the maximum material flow to all assigned OE (core)

A4random choice

Layout and Design

### Selection of (non-assigned) locations

B1those having the minimum total distance to all other locations

B2those being neighbouring to the last-chosen location

B3a) those leading to the minimum sum of transportation cost to the core

b) like a) but furthermore we try to exchange the location with neigboured OE

c) a location (empty or allocated) such that the sum of transportation costs within the new core is minimized (in case an allocated location is selected, the displaced OE is assigned to an empty location)

B4random choice

Layout and Design

### Example

Combination of A1 and B1:

• Arrange all OE according to decreasing sum of material flow

• Arrange all locations according to increasing distance to all other locations

• Manhatten-distance between locations. (matrix is symmetric -> consideration of the matrix triangle is sufficient)

Layout and Design

Sum of material flow between 15 and 51

### Example – Material flow

3

10

3

20

5

15

4

7

4

4

Sequence of OE (according to decreasing material flow): 3, 5, 2, 7, 4, 6, 8, 9, 1

Layout and Design

### Example - Distances

18

15

18

15

12

E

15

18

15

18

Sequence of locations (according to increasing distances): E, B, D, F, H, A, C, G, I

Layout and Design

### Example - Assignment

• Sequence of OE: 3, 5, 2, 7, 4, 6, 8, 9, 1

• Sequence of locations: E, B, D, F, H, A, C, G, I

• Assignment:

Layout and Design

### Example – Total costs

OE 1 and 5 are assigned to locations I and B

 3 (Distance 1-5) * 3 (Flow I-B)

Total cost = 61

Layout and Design

### The Quadratic Assignment Problem (QAP)

• Improvement heuristics:

• Try to improve solutions by exchanging OE-pairs (see the introducing example)

• Check if the exchange of locations of 2 OE reduces costs.

• Exchange of OE-triples only if computational time is acceptable.

• There are a number of possibilities to determine OE-pairs (which should be checked for an exchange of locations):

Layout and Design

### The Quadratic Assignment Problem (QAP)

• Selection of pairs for potential exchanges:

C1all n(n - 1)/2 pairs

C2a subset of pairs

C3random choice

• Selection of pairs which finally are exchanged:

D1that pair whose exchange of locations leads to the highest cost reduction. (best pair)

D2the first pair whose exchange of locations leads to a cost reduction (first pair)

Layout and Design

### The Quadratic Assignment Problem (QAP)

• Solution quality

• Combination of C1 and D1:

• Quite high degree of computational effort.

• Relatively good solution quality

• Combination of C1 and D1 is the equivalent to 2-opt method for the TSP

• CRAFT :

• Well-known (heuristic) solution method

• For problems where OE are of similar size CRAFT equals a combination of C1 and D1

Layout and Design

### The Quadratic Assignment Problem (QAP)

• Random Choice (C3 and D2):

• Quite good results

• the fact that sometimes the best exchange of all exchanges which have been checked leads to an increase of costs is no disadvantage, because it reduces the risk to be trapped in local optima

• The basic idea and several adaptions/combinations of A, B, C, and D are discussed in literature

Layout and Design

### „Umlaufmethode“

• Heurisitic method

• Combination of starting and improvement heuristics

• Components:

• Initialization (i = 1):Those OE having the maximum sum of material flow [A1] is assigned to the centre of locations (i.e. the location having the minimum sum of distances to all other locations [B1]).

• Iteration i (i = 2, ... , n): assign OE i

Layout and Design

### „Umlaufmethode“

Part 1: Selection of OE and of free location:

• select those OE with the maximum sum of material flow to all OE assigned to the core [A3]

• assign the selected OE to a free location so that the sum of transportation costs to the core (within the core) is minimized [B3a]

Layout and Design

### „Umlaufmethode“

Part 2: Improvement step in iteration i = 4:

• check pair wise exchanges of the last-assigned OE with all other OE in the core [C2]wenn eine Verbesserung gefunden ist, führe diese Änderung durch und beginne wieder mit Teil 2 [D2]

• if an improvement is found, the exchange is conducted and we start again with Part 2 [D2]

Layout and Design

### Example – Part 1

Initialization (i = 1):

E = centre

Assign OE 3 to centre.

Layout and Design

### Sequence of assignment

5

7

2

4

9

1

6

8

i = 9

3

0

0

0

0

0

0

i = 3: 2 highest mat.flow to core (3,5)

2

i = 1: assign 3 first

i = 5

0

1

1

i = 2: 5 highest mat.flow to 3

2

0

0

0

i = 6

2

4

i = 4

1

0

0

i = 7

0

0

0

0

0

i = 8

0

0

0

Layout and Design

### Example – PArt 1Iterationi = 2

The maximum material flow to OE 3 is from OE 5

• Distances dBE = dDE = dFE = dHE = 1 equally minimal select D,

• In iteration i = 2 OE 5 is assigned to D-5.

Layout and Design

### Example – Part 1Iterationi = 3

The maximum material flow to the core (3,5) is from OE 2

• Select location X, such that dXEt23 + dXDt25 = dXE3 + dXD2 is minimal: (A, B, G od. H)X = AdAE3 + dAD2 = 23 + 12 = 8X = BdBE3 + dBD2 = 13 + 22 = 7X = FdFE3 + dFD2 = 13 + 22 = 7X = GdGE3 + dGD2 = 23 + 12 = 8X = HdHE3 + dHD2 = 13 + 22 = 7

• B, F or H  B is selected

• In iteration i = 3 we assign OE to B

Layout and Design

### Example – Part 1Iterationi = 4

The maximum material flow to the core (2,3,5) is from OE 7 (2, 3, 5)

• Select location X, such thath dXEt73 + dXDt75 + dXBt72 = dXE0 + dXD2 + dXB4 is minimal

• according to the given map -> A is the best choice

• In iteration i = 4 we tentatively assign OE 7 to location A

Layout and Design

### Example – Part 2

Try to exchange A with E, B or D and calculate the according costs:Original assignement (Part 1):

E-3, D-5, B-2, A-7Cost =15+13+20+22+12+14 = 18tryE-3, D-5, A-2, B-7 Cost = 15+23+10+12+22+14 = 21tryE-3, A-5, B-2, D-7 Cost = 25+13+10+12+12+24 = 25tryA-3, D-5, B-2, E-7 Cost = 15+13+20+22+12+14 = 18

• Exchanging A with E would be possible but does not lead to a reduction of costs. Thus, we do not perform any exchange but go on with the solution determined in part 1…and so on…

Layout and Design

### Example – Part 2

• After 8 iterations withoutpart 2: Cost = 54

• With part 2 (last-assigned OE (9) is to be exchanged with OE 4): Cost = 51

• While a manual calculation of larger problems is obviously quite time consuming an implementation and therefore computerized calculation is relatively simple

Layout and Design