algorithm for finding min max partition

Upload: vcsubman

Post on 05-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/31/2019 Algorithm for Finding Min Max Partition

    1/1

    Date: 03/21/2012

    Suppose ij C, i has possible states 1, . . . , m, j has possible states 1, . . . , n, given bij, find 1 possible

    (i, j) arg mini,j [max(xi,xj):i(xi)=j(xj) bij(xi, xj)]:

    Algorithm:

    Initialize M {{(i, xi)} : xi {1, . . . , m}} {{(j, xj)} : xj {1, . . . , n}}

    (i.e. set M as the set of all singletons)

    Define list L as(u1, v1, bij(u1, v1)), . . . , (umn, vmn, bij(umn, vmn) {(xi, xj, bij(xi, xj)) : xi {1, . . . , m} , xj {1, . . . , n}}sorted by bij(xi, xj) in descending order

    for k = 1 to mn{

    find (as in union-find) m1, m2 M such that uk m1, vk m2

    if m1 = m2 then{

    if replacing m1, m2 with m1 m2 in M causes i or j to have invalid parition then{

    merge the rest of the states to form a valid partitionbreak

    }remove m1, m2 from M and add m1 m2 to M

    }}

    The procedure above terminates with M = {A, B} such that A B = and A, B = .

    Define i, j as i(xi) = 1 iff (xi, xj, bij(xi, xj)) A for some xj (otherwise i(xi) = 0), and

    j as j(xj) = 1 iff (xi, xj, bij(xi, xj)) A for some xi (otherwise i(xj) = 0). If i, j are valid partitions

    of nodes i, j, then (i, j) arg mini,j [max(xi,xj):i(xi)=j(xj) bij(xi, xj)].

    Proof of correctness:

    Suppose the algorithm terminates at K-th iteration and returns valid partitions i, j, then by construction,

    (uK, vK) arg max(xi,xj):i(xi)=j(xj) bij(xi, xj) (because L is sorted in descending order and the algorithm

    returns i, j such that i(up) = j(vp) for all pairs of (up, vp) seen before (uK, vK)).

    Suppose

    i,

    j such that max(xi,xj):i(xi)=

    j(xj)

    bij(xi, xj) < bij(uK, vK), then s {1, . . . , m n} such that

    (us, vs) arg max(xi,xj):i(xi)=

    j(xj)

    bij(xi, xj).

    Because bij(us, vs) < bij(uK, vK) implies K < s, hence t {1, . . . , K }, bij(ut, vt) > bij(us, vs),

    (again because L is sorted in descending order), and (us, vs) arg max(xi,xj):

    i(xi)=

    j(xj) bij(xi, xj)t {1, . . . , K },

    i(ut) =

    j(vt).

    However, since the algorithm above terminates when merging the K-th pair of states in L would cause

    1 variable to have an invalid partition,

    i,

    j cannot

    be valid partitions of i, j.

    Therefore if i, j are valid partitions, then (i, j) arg mini,j [max(xi,xj):i(xi)=j(xj) bij(xi, xj)].

    QED.