Locating Restricted Facilities on Binary Maps
In this paper we consider several facility location problems with applications to cost and social welfare optimization, when the area map is encoded as a binary (0,1) mxn matrix. We present algorithmic solutions for all the problems. Some cases are t…
Authors: Mugurel Ionut Andreica, Cristina Teodora Andreica, Madalina Ecaterina Andreica
Locating Restricted Facilities on Bin ary Maps Mugurel Ionut Andreica, Polite hnica University of Bucharest, mugurel.andreica@cs.pub.ro Cristina Teodora Andreica, Commercial Academy Satu Mare Madalina Ecaterina Andreica, Academy of Economic Studies, Buchare st Abstract: In this paper we consider several facility location problems with applications to cost and social welfare optimization, when the area map is encoded as a binary (0,1) m x n matrix. W e present algorithmic solutions for all the problems. Some ca ses are too particular to be used in practical situations, but they are at least a starting point for more generic solutions. Keywords: facility location, binar y matrix, maximum perimeter sum rectangle, largest square, larg est diamond . 1 Introduction Lo cating facilities which minimize costs or maximize social welfare have important applications in many situations. I n this pap er we consider the case in which the area map is encoded as a binary m atrix A with m rows and n columns. The encoding could represent clean and polluted area s or desirable and undesirable zones. For this encoding, we consider several facility l ocation problems to which we present optimal algorithmic solutions. Some of the problems are too particular or too restricted to be used in p ratical sit uations directl y , but we believe that they represent a starting point for h andling more general problems. The rest of this paper is structured as follows. In Sections 2-5 we consider several facility location problems (largest squares, diamonds an d rectangles). In Section 6 we compute depth arran gements of connected components in binary maps and in Section 7 we conclude. Related work is presented for each p roblem. 2 Locating Square Fa cilities with Varied Pa tterns W e want to find the largest squ ar e submatrix having a specific propert y. The case when we want to find a monotone square, whose cells are all equal (to 0 or 1) is part of folklore. We also consider two othe r patterns: the largest chessboard p atterned square (where the values of the cell s alternate on each row and column) and the largest square having all 1s on the main diagonal and 0s in the rest of the square. For the monotone square submatrix, we c ompute SQ(i,j)=the side of the lar gest square whose upper left corner is at row i and column j: othe rwis e 1)}, j 1, S Q(i 1), j S Q(i, j), 1, min { S Q(i 1 j)) A (i, 1) j 1, (A (i or j)) A (i, 1) j (A (i, or j)) A (i, j) 1, (A ( i if 1, n) (j or m) (i if 1, j) SQ (i, (1) For the largest „chessboard”, we compute CB(i,j)=the largest chessboard with the upper r ight corner at (i,j): othe rwis e 1 )} , j 1, CB(i 1), j CB (i, j), 1, min {C B(i 1 j)) A (i, 1) j 1, (A (i or j)) A (i, 1) j (A (i, or j)) A (i, j) 1, (A ( i if 1, n) (j or m) (i if 1, j) CB(i, (2) For th e largest squa re with all 1s on the m ain diagonal and all 0s in the rest we compute IM(i,j)=the largest such square with the upper right corner at row i and column j: other wise j)}, 1, DM (i 1 ), j RM(i, 1), j 1, I M (i min {1 0) 1) j 1, (A (i or 1) 1) j (A (i, or 1) j) 1, (A (i if 1, 1) j) (A (i, an d n )) (j o r m) ((i if 1, 0 j) A (i, if 0, j) I M(i, (3) RM(i,j) (DM(i,j)) is the l eng th of the longest s equence of consecutive 0s starting at (i,j) and going right (down): 0) j) (A (i, an d n) (j if 1 ), j RM (i, 1 0) j) (A (i, an d n) (j if , 1 ) 1 j) (A (i, if , 0 j) RM (i, (4) 0) j) (A (i, an d m) (i if j), 1, DM (i 1 0) j) (A (i, an d m) (i if , 1 ) 1 j) (A (i, if , 0 j) D M (i, (5) We can extend the patterns used for com puting the largest squares specific properties to a mor e g eneral case, where on e c an comput e the followin g three values: RM(i,j)=f RM (A(i,j), RM(i,j+1)), DM(i,j)=f DM (A(i,j), DM(i+1,j)), BEST(i,j)=f BEST (A(i,j), A(i+1,j), A(i,j+1), A(i+1,j+1), BEST(i+1,j), BEST(i,j+1), BEST(i+1 , j+1)), where f RM , f DM and f BEST are functions which can be evaluated in O(1) time. This wa y , we obt ain O(m x n) algorithms for computing an opti mal squa re su bmatrix consistent with the definitions of f RM , f DM and f BEST . In [1], all maximal monotone square s are efficientl y found. 3 Locating Diamonds with Various Patterns A diamond is similar to a square rotated by 45 degrees. A diamond with the ce nter at row i and column j and with side leng th L cons ists of all the cells at positions (p,q), such that |p-i|+|q-j|1)=max{v(l 1 ,l 2 )(j), u(l 1 ,l 2 )(j -1)+B(l 1 ,j)+B(l 2 ,j)}; w(l 1 ,l 2 )(j)=u(l 1 ,l 2 )(j -1)+ v(l 1 ,l 2 )(j). The maximum value among all w(l 1 ,l 2 )(j) (1≤l 1
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment