approximation algorithms for max-min tiling authors piotr berman, bhaskar dasgupta, s. muthukrishman...

28
Approximation Approximation Algorithms for Algorithms for MAX-MIN tiling MAX-MIN tiling Authors Authors Piotr Berman, Bhaskar DasGupta, Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Published on Journal of Algorithms, 2003 Journal of Algorithms, 2003 Presented by Presented by Sera Kahruman Sera Kahruman

Post on 21-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Approximation Approximation Algorithms for MAX-MIN Algorithms for MAX-MIN

tilingtilingAuthorsAuthors

Piotr Berman, Bhaskar DasGupta,Piotr Berman, Bhaskar DasGupta, S. MuthukrishmanS. Muthukrishman

Published onPublished onJournal of Algorithms, 2003Journal of Algorithms, 2003

Presented byPresented bySera KahrumanSera Kahruman

Page 2: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

OutlineOutline

DefinitionDefinition Approximation algorithms Approximation algorithms

Greedy Slice and DiceGreedy Slice and Dice Recursive slice and dice-Binary space Recursive slice and dice-Binary space

partitioningspartitionings ConclusionConclusion

Page 3: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

OutlineOutline

DefinitionDefinition Approximation algorithms Approximation algorithms

Greedy Slice and DiceGreedy Slice and Dice Recursive slice and dice-Binary space Recursive slice and dice-Binary space

partitioningspartitionings ConclusionConclusion

Page 4: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

DefinitionDefinitionGiven a 2-dimensional array A[1,…,n][1,…,n] Given a 2-dimensional array A[1,…,n][1,…,n]

s.t. each A[i][j] stores a non-negative numbers.t. each A[i][j] stores a non-negative number A A tiletile is a subarray A[l,…,r][t,…,b] of A is a subarray A[l,…,r][t,…,b] of A WeightWeight of a of a tile T, w(T) = tile T, w(T) = sumsum of all array entries in of all array entries in

that tilethat tile A A tilingtiling of A is a collection of tiles of A s.t. each entry of A is a collection of tiles of A s.t. each entry

of A is contained in exactly one tileof A is contained in exactly one tile2 2 3 1 4

1  3  1 1  2

 3  4  5 1 2 

 4  2  1 3 6 

 1  1  3 1  4

Page 5: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Max-Min Tiling ProblemMax-Min Tiling Problem

Given a weight bound W, find a tiling of A Given a weight bound W, find a tiling of A such that:such that:

1.1. Each tile is of weight at least WEach tile is of weight at least W

2.2. The number of tiles is maximizedThe number of tiles is maximized

Max-Min tiling is NP-hard! Max-Min tiling is NP-hard!

Data mining…..an application areaData mining…..an application area

Page 6: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

More definitionsMore definitions

(r, s) approximation of max-min tiling is a (r, s) approximation of max-min tiling is a solution that produces a tiling of A with solution that produces a tiling of A with at at leastleast rp* rp* tiles each of which has weight tiles each of which has weight at at leastleast s(W-c) s(W-c) where; where; p* = max number of tiles used in an optimal p* = max number of tiles used in an optimal

solution solution cc≥0 is a constant≥0 is a constant

Page 7: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Slice and Dice TechniqueSlice and Dice Technique

Partition the input array into a number of Partition the input array into a number of slices (rectangles) using some criteria slices (rectangles) using some criteria (depending on the problem)…..(depending on the problem)…..slicing stepslicing step

Search for a better solution by looking at Search for a better solution by looking at the neighbor slices and repartitioning the the neighbor slices and repartitioning the entries…..entries…..dicing stepdicing step

Page 8: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

OutlineOutline

DefinitionDefinition Approximation algorithmsApproximation algorithms

Greedy Slice and DiceGreedy Slice and Dice Recursive slice and dice-Binary space Recursive slice and dice-Binary space

partitioningspartitionings ConclusionConclusion

Page 9: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Approximation algorithms for Approximation algorithms for Max-Min tiling Max-Min tiling

Greedy slice and diceGreedy slice and dice Linear in number of non-Linear in number of non-

zero entries (m)zero entries (m) Greedily slice the array into Greedily slice the array into

strips and dice each slice strips and dice each slice

Recursive slice and Recursive slice and dice: binary spacedice: binary space partitioningspartitionings

Use BSP of isothetic Use BSP of isothetic rectanglesrectangles

Special case : Every cut of Special case : Every cut of BSP is either a vertical or BSP is either a vertical or horizontal line horizontal line

(r,s) (r,s) approx.approx.

timetime

A is A is arbitraryarbitrary

(1\3,1)(1\3,1) O(m+n)O(m+n)

(4\9,(4\9,

1\3)1\3)

O(nO(n77))

A is A is binarybinary

(1\2,(1\2,

1\4)1\4)

O(nO(n77))

(2\5,1)(2\5,1) O(m+n)O(m+n)

Results

Page 10: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Greedy Slice and Dice AlgorithmGreedy Slice and Dice Algorithm

Observation 1:

Given an instance array A of the MAX-MIN tiling problem, let A’ be the array obtained from A in which every element larger than 1 is replaced by 1. Then, any feasible solution for A’ is also a feasible solution for A and vice versa.

Page 11: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Greedy Slice & Dice AlgorithmGreedy Slice & Dice Algorithm

Scale the array such that W=1 if necessaryScale the array such that W=1 if necessary After scaling w(A) becomes an upper bound After scaling w(A) becomes an upper bound A A good good tile is a tile whose weight is at least 1tile is a tile whose weight is at least 1 The algorithm finds a solution with The algorithm finds a solution with t goodt good tiles tiles

Such that w(A)< r*t + 2Such that w(A)< r*t + 2

Input array : array of row lists where each row i contains an Input array : array of row lists where each row i contains an entry (j, x) for each A[i][j]=x entry (j, x) for each A[i][j]=x > 0 > 0

O( m+n) spaceO( m+n) space m = number of non-zero entriesm = number of non-zero entries

Page 12: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Slicing StepSlicing Step

Slices are composed of complete rowsSlices are composed of complete rows Start with the bottom row and proceed Start with the bottom row and proceed

upwardsupwards Find minimal slicesFind minimal slices Last slice is the remainder slice, others Last slice is the remainder slice, others

regularregular

Page 13: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Example : Slicing stepExample : Slicing step

0.3 0.2 0.2 0.1

0.4 0.6 0.2 0.1

0.2 0.5 0.3 0.4

0.3 0.2 0.3 0.1

0.2 0.5 0.3 0.4

0.3 0.2 0.3 0.1

0.4 0.6 0.2 0.1

0.3 0.2 0.2 0.1

S1

S3

S2

R4

R3

R2

R1

Compute L and the array t where:

•L= number of regular slices

•t[i] = Row index such that Si consists of the rows in between t[i-1] and t[i]

Can compute in O(m +n) time!

Page 14: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Dicing StepDicing Step

Partition each slice Si using the slicing Partition each slice Si using the slicing algorithm considering columns instead of algorithm considering columns instead of rowsrows

V-slices (vertical slices) are producedV-slices (vertical slices) are produced αα(i) = # of V-slices obtained from Si(i) = # of V-slices obtained from Si VVi,1i,1 , …. , V , …. , Vi, i, αα(i)(i) are regular, V are regular, Vi, i, αα(i)+1(i)+1

remainderremainder Combine VCombine Vi, i, αα(i)+1(i)+1 with V with Vi, i, αα(i)(i) for preliminary for preliminary

partitionpartition

Page 15: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Example: Dicing stepExample: Dicing step

0.2 0.5

0.3 0.2

0.3 0.4

0.3 0.1

0.2 0.5 0.3 0.4

0.3 0.2 0.3 0.1

0.4 0.6 0.2 0.1

0.3 0.2 0.2 0.1 0.3 0.2 0.2 0.1

0.2 0.10.4 0.6

Done in O(m+ n) time

Page 16: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Dicing step : Cont’Dicing step : Cont’

Estimate weight of each partEstimate weight of each part w(Vw(VLL

i,ji,j)) < 1< 1

Summation of all w(VSummation of all w(VRRi,ji,j)) of Si < 1of Si < 1

w(Vw(VCCi,ji,j)) ≤ 1≤ 1

L R

C Split each V-slice Split each V-slice VVi,j i,j into 3 partsinto 3 parts

VVLLi,j i,j :: all columns except lastall columns except last

VVRRi,j i,j : last column except its topmost : last column except its topmost

elementelement VVCC

i,j i,j :topmost element of last column:topmost element of last column

Page 17: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Cont’Cont’ Guarantee an approx. ratio of 4 (use at least Guarantee an approx. ratio of 4 (use at least

floor(w(A))/4 floor(w(A))/4 tiles)tiles) Proof :Proof : Let Let tt be the # of tiles obtained using the algorithm be the # of tiles obtained using the algorithm

• w(Si) < 2+ 2w(Si) < 2+ 2αα(i) ≤ 4(i) ≤ 4αα(i) (i) • w(A) < 1 + w(S1)+……..+w(SL)w(A) < 1 + w(S1)+……..+w(SL)

< 1 + 4*(< 1 + 4*(αα(1)+……+ (1)+……+ αα(L) )(L) )< 1 + 4*t< 1 + 4*t

4*t ≥ 4*t ≥ floorfloor(w(A))(w(A))

Do additional dicing to improve the ratioDo additional dicing to improve the ratio

Page 18: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Additional Dicing StepAdditional Dicing Step

Each additional dicing on Si-1USi is done in O(β+2 ) where β is total number non-zeros in Si-1USi

Total running time still O(m+n)

Define

σ(i) =1 if # of tiles increased when Si-1U Si processed

σ(i) =0 ow

Page 19: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Cont’Cont’

With the additional dicing step, approximation With the additional dicing step, approximation ratio becomes 3.ratio becomes 3.Proof:Proof: need to show that need to show that t ≥ t ≥ floorfloor((w(A)+1)/3)((w(A)+1)/3)

w(A) < 3*t + 2w(A) < 3*t + 2

w(Sw(S11)+……..+w(S)+……..+w(SLL) < 3*t + 1) < 3*t + 1

need to show :

Proved by induction!!!

Since

Page 20: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

OutlineOutline

DefinitionDefinition Approximation algorithms Approximation algorithms

Greedy Slice and DiceGreedy Slice and Dice Recursive slice and dice-Binary space Recursive slice and dice-Binary space

partitioningspartitionings ConclusionConclusion

Page 21: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Recursive Slice & DiceRecursive Slice & Dice Based on binary space partitioning of a set of isothetic rectanglesBased on binary space partitioning of a set of isothetic rectangles

isothetic rectangle = rectangle with edges parallel to principal axes isothetic rectangle = rectangle with edges parallel to principal axes

Given a rectangular region Given a rectangular region RR containing a set of containing a set of nn disjoint isothetic disjoint isothetic rectangles, rectangles, a BSP of Ra BSP of R consists of recursively partitioning consists of recursively partitioning RR by a by a horizontal or vertical line into 2 sub regions and continuing in this horizontal or vertical line into 2 sub regions and continuing in this manner for all the sub regions until each obtained region has at manner for all the sub regions until each obtained region has at most 1 rectangle. If a rectangle is cut by a line, it is split into disjoint most 1 rectangle. If a rectangle is cut by a line, it is split into disjoint rectanglesrectangles

Size(BSP)= # of regions produced Size(BSP)= # of regions produced A set of rectangles form a tiling if they partition some rectangular A set of rectangles form a tiling if they partition some rectangular

region R.region R. Use dynamic programming – min size BSP in O(nUse dynamic programming – min size BSP in O(n55) time.) time.

Page 22: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

TheoremsTheorems

Proof of Theorem 3:

Consider an optimal solution OPT using p* tiles. So there exists a BSP of OPT that has at most 2p* regions in which each rectangle of OPT is cut into at most 4 pieces( from thm 2)

If a rectangle is cut into i pieces, at least one piece has weight at least W/i.

fraction of rectangles which has a weight of at least W/4 = 1/2

fraction of rectangles which has a weight of at least W/3 = 4/9

Page 23: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Recursive Slice & DiceRecursive Slice & Dice

How to compute such a BSP of A?How to compute such a BSP of A? DefinitionsDefinitions

HBP : Hierarchical binary partitionHBP : Hierarchical binary partition An HBP of an array is either the entire array or the unions of HBPs An HBP of an array is either the entire array or the unions of HBPs

of the two sub arrays of the array.of the two sub arrays of the array.

ΓΓ(I,j,k,l,p)(I,j,k,l,p) = HBP of the sub array A[ i,.,j ][ k,…,l ] in which there = HBP of the sub array A[ i,.,j ][ k,…,l ] in which there exists p tiles of weight at least s*W.exists p tiles of weight at least s*W.

A BSP of OPT is also a HBP of AA BSP of OPT is also a HBP of A

Use dynamic programming to find Use dynamic programming to find {{ΓΓ(1,n,1,n,p) | (1,n,1,n,p) | 0 0 ≤ p ≤ n2≤ p ≤ n2 }}

Page 24: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

Time analysisTime analysis

There are at most O(nThere are at most O(n44) sub arrays of A) sub arrays of A If the weight of the sub array If the weight of the sub array A[ i,.,j ][ k,..,l ] is at least A[ i,.,j ][ k,..,l ] is at least

s*W, then s*W, then # of ways to construct a HBP of it is # of ways to construct a HBP of it is (j - i) + (l – k ) + 3 ≤ 2n-1…………O( n )(j - i) + (l – k ) + 3 ≤ 2n-1…………O( n )

0 0 ≤ p ≤ n≤ p ≤ n22

Since we are looking for the answer for each p,Since we are looking for the answer for each p,Total running time is O(Total running time is O(nn44 * * n * nn * n22)=O()=O(nn77 ) )

Page 25: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

OutlineOutline

DefinitionDefinition Approximation algorithms Approximation algorithms

Greedy Slice and DiceGreedy Slice and Dice Recursive slice and dice-Binary space Recursive slice and dice-Binary space

partitioningspartitionings ConclusionConclusion

Page 26: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

ConclusionConclusion

Authors introduce two approximation Authors introduce two approximation algorithms for MAX-MIN tiling problem algorithms for MAX-MIN tiling problem using slice and dice techniqueusing slice and dice technique

They state that efficient approximation They state that efficient approximation algorithms for this problem in higher algorithms for this problem in higher dimensions can be improved using dimensions can be improved using variations of this approach variations of this approach

Page 27: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

QUESTIONS ???QUESTIONS ???

Page 28: Approximation Algorithms for MAX-MIN tiling Authors Piotr Berman, Bhaskar DasGupta, S. Muthukrishman S. Muthukrishman Published on Journal of Algorithms,

HomeworkHomework

1.1. Formulate MAX-MIN tiling problem as an Formulate MAX-MIN tiling problem as an optimization problem.optimization problem.

2.2. In the paper, authors also mention MIN-In the paper, authors also mention MIN-MAX tiling problem. Define MIN-MAX MAX tiling problem. Define MIN-MAX tiling problem and state the main tiling problem and state the main differences between the two problems.differences between the two problems.