30
On-line Bin Covering Algorithms Páll Jensson, Univ. of Iceland In food processing items of irregular sizes are frequently collected and packed into portions of a specified minimal size, i.e. a target weight. The purpose of this study is to develop algorithms to assign the items, usually arriving fast on a conveyor belt, to bins, in order to minimize the overweight. Bin packing and dual bin packing, also called bin covering, are known in the literature as NP-hard problems. Our problem is on-line as the items must be processed in the order they arrive. We discuss several different approaches, among which are knapsack optimization and heuristic methods, and present a new algorithm which has been patented and proved itself in food processing equipment sold worldwide. Numerical results will be given.

On-line Bin Covering Algorithms Páll Jensson, Univ. of Iceland In food processing items of irregular sizes are frequently collected and packed into portions

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

On-line Bin Covering Algorithms

Páll Jensson, Univ. of Iceland

In food processing items of irregular sizes are frequently collected and packed into portions of a specified minimal size, i.e. a target weight. The purpose of this study is to develop algorithms to assign the items, usually arriving fast on a conveyor belt, to bins, in order to minimize the overweight.

 Bin packing and dual bin packing, also called bin covering, are known in the literature as NP-hard problems. Our problem is on-line as the items must be processed in the order they arrive. We discuss several different approaches, among which are knapsack optimization and heuristic methods, and present a new algorithm which has been patented and proved itself in food processing equipment sold worldwide. Numerical results will be given.

Agenda

• Problem background and definition

• Literature, related problems

• The new algorithm (LVP)

• Numerical results

• Other approaches (BFD, MKP, GA)

• Algorithm Comparison

• Future research

Portioning Equipment in Food Processing

• Serial, conveyor (Marel), 1 known, M bins, empirical item weight distribution known

• Flow scale moved away from discharging => N items known, M bins

• Circular discharging, N known, 1 bin (SKP)

• Parallel discharging, N known, 1 bin (SKP)

Problem Definition for (off-line) Bin Covering

For a given list L = (a1, ... an) of items, with

aj (0,1], j {1,...n}, the goal is to pack the

items into a maximum number of bins of size

1, such that each bin is at least filled to 1.

Our Problem is on-line and k-bounded-space

(only k partially filled bins active at any time)

Related Problems

Dual Bin Packing (off-line): Not necessary to pack all items, fixed number of bins, the goal is to minimize number of items used.

Cutting Stock (trim loss)

Container (Vehicle, Pallet) Loading

Knapsack Problems

Literature until 1980

• Kantorovich 1939: First Bin P. (Prod. Plan)

• Brooks 1940: 2-dim. Cutting Stock

• Elion & Christophides 1971: Loading Probl.

• Johnson 1974: “Bin Packing”, NF, BFD,...

• Litton 1977: Carpet Cutting in UK

• Coffman et al. 1978: Min Makespan

• Coffman et al. 1980: NF as Markov chain

Literature after 1980

• Hoffman 1980: FOLD pairing method

• Lee & Lee 1985: Harmonic-algorithms

• Assmann et al. 1984: Dual Bin Packing

• Csirik & Totik 1988: Worst Case Bounds

• Martello & Toth 1990: MTP B&B method

• MÞJ, PJ & TPR 1996: GA for Bin Covering

• Coffman, Garey & Johnson 1997: Survey

Problem Variants/Categories

• Bin Packing – Cutting Stock• Bin Covering – Dual Bin Packing• K-bounded-space – Unbounded• On-line (dynamic) – Off-line• No reject – Reject allowed• N = 1 known items – N>>1 known (distribution

known – not known)• Bounds on number and/or type of items

Empirical distribution, LVP example.

Bin shortage = 70. "Good fill": Overfill < zone=5 gr

0%5%10%15%20%25%30%35%

20 30 40 50 60 70 80

Item weight (gr)

P(20) + P(30) + P(40) + P(50) + P(60) + P(70) + P(80) = 1

LVP Example

• One: P(70)• Two: P(20)*P(50) + P(30)*P(40) +• P(40)*P(30) + P(50)*P(20) • Three: P(20)*P(20)*P(30)*3• P(“Good fill”) = Sum(One + Two + Three)• Note: One bin only!• Unimodal, symmetric: Best prospect if shortage• ~ n*mean, n = 1, 2, 3, ....

Prospect Function Pf, one bin

• w =shortage, z =zone, f(w) = pmf (fmin,fmax)• Pf(w,z) = P(Bin w fills with overfill < z)• Pf(w,z) = 0 if w < – z, = 1 if –z < w < 0,

• = i Pf(w+i) if 0 < w, i = 0...z• Pf(w) = 0 if w < 0, = 1 if w = 0,

• = c f(c)(w) if w > 0, c = fmin...fmax • (pmf convoluted with it self c times)

Recursive Convolution

• Pf(w) = 0 if w < 0, =1 if w = 0,

• = i f(i)Pf(w-i) if w > 0,

• i = fmin...min(w,fmax)

• Prospect function is true probability for one bin and for the Next Fit algorithm

• Examples: N(100,15) and U(75,125)

Prospect Function, many bins

• M bins, w = (w1,...,wM), next item weight=a

• Max i Pf(wi – xia,z)

• i xi = 1, xi binary

• PR: max Pf(wi – xia,z) / Pf(wi,z) => bin i

• Max i Pf(wi – xia,z) =>

• PD: max Pf(wi – xia,z) – Pf(wi,z) => bin i

LVP Prospect Algorithm

• Test fit next item into all active bins

• Assign item to bin with max PR (or PD), i.e. maximal prospect improvement

• If bin fills then close it and activate new

• Check “age” of partially filled bins

• Update empirical distribution as needed

• Behaviour: “Surfing the Prospect peaks”!

Best Fit Decreasing with Backtracking

• Test fit first item into each bin, calculate shortages, and then for each test fit:

• Sort next N items descending, largest first• Sort bins ascending, least shortage first• Put next item into first bin into which it fits• If item is too big for all, try next item etc• If all items are too big, backtrack, i.e. find

smaller next last item.

Generating Imaginary Items

• Used when N=1 is known or N is small and distribution is known

• Generate N2 dummy items and add to list• Three generation methods:

– 1. Retrospective (use the last N2 items)– 2. Simulation (from the empirical distribution)– 3. Scenario (construct N2 items such that their

histogram ~ empirical distribution)

BFD compared with LVP, 4 bins

0

10

20

30

40

50

60

70

80

400 500 600 700 800 900 1000 1100 1200 1300 1400 1500

Bin Size (gr)

Ave

rag

e B

in O

verf

ill

(gr)

BFD

LPV

Knapsack Models for Bin Covering

• SKP: min z = kakxk (min overweight)

kakxk >= W (target weight)

xk = 0/1

MKP: min z = kakixik

kakxik >=Wi i (fill all active bins)

ixik <=1 k (use items <= once)

xik = 0/1 (assign item k to bin i)

Knapsack solved for N>1 known

• SKP for circular/parallel discharge (M=1)• MKP/B&B for N>1 and M>1 (if flow scale

is moved away):– 1. Upper Bound: Fill one bin at a time with

SKP (start with least shortage)– 2. Lower Bound: Same as 1. but using items

more than once => infeasibility (Also: Fill one sum-of-all-bin with SKP)

– Branch on items assigned to > 1 bin

MKP compared with LVP

• Imaginary items used in MKP if N=1 or if N is small

• LVP better if N < 3

• MKP better if N > 8

• More work needed

Genetic Algorithm(Eva Hlín Dereksdóttir)

• Coding: Items numbered with bin numbers

• No. of generations adaptive (initially 50)

• Uniform Crossover (40%)

• P(mutation) = 1/N, N=no. of known items

• Population = 1.5*N

• Tournament Selection

• Evaluation Function: Min Ave. Overweight

GA Results

• No better to know more items N than M bins can take

• Choice of Evalution Function important

• Reject would help (20% of bins => 75% of total overfill)

• Adaptive no of generations => speed

• Also assign >1 in each round => speed

Algorithm Comparison, 4 bins, items N(200,21)

0

20

40

60

80

100

120

Bin Size (gr)

Ave

rag

e B

in O

verf

ill

(gr)

GA20

DSMKP

LVP

Future Research

• Modify LVP to solve other problems (more than one type of items, Bin Packing)

• Markov Decision Process Modeling of Bin Covering

• Perfect Packing with LVP?

• More work on Knapsack

• More work on GA