Weighted Matching and Linear Programming

Similar documents
Minimum Spanning Trees

COMP108 Algorithmic Foundations

Lecture 11 Waves in Periodic Potentials Today: Questions you should be able to address after today s lecture:

TOPIC 5: INTEGRATION

Multi-Section Coupled Line Couplers

FSA. CmSc 365 Theory of Computation. Finite State Automata and Regular Expressions (Chapter 2, Section 2.3) ALPHABET operations: U, concatenation, *

Last time: introduced our first computational model the DFA.

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018

Linear Algebra Existence of the determinant. Expansion according to a row.

INTEGRALS. Chapter 7. d dx. 7.1 Overview Let d dx F (x) = f (x). Then, we write f ( x)

CSE303 - Introduction to the Theory of Computing Sample Solutions for Exercises on Finite Automata

Walk Like a Mathematician Learning Task:

Winter 2016 COMP-250: Introduction to Computer Science. Lecture 23, April 5, 2016

Graph Isomorphism. Graphs - II. Cayley s Formula. Planar Graphs. Outline. Is K 5 planar? The number of labeled trees on n nodes is n n-2

UNIT # 08 (PART - I)

Week 3: Connected Subgraphs

Errata for Second Edition, First Printing

Errata for Second Edition, First Printing

, between the vertical lines x a and x b. Given a demand curve, having price as a function of quantity, p f (x) at height k is the curve f ( x,

Section 3: Antiderivatives of Formulas

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs.

Integration Continued. Integration by Parts Solving Definite Integrals: Area Under a Curve Improper Integrals

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s?

Module graph.py. 1 Introduction. 2 Graph basics. 3 Module graph.py. 3.1 Objects. CS 231 Naomi Nishimura

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes.

cycle that does not cross any edges (including its own), then it has at least

Instructions for Section 1

13. Binary tree, height 4, eight terminal vertices 14. Full binary tree, seven vertices v 7 v13. v 19

CSC Design and Analysis of Algorithms. Example: Change-Making Problem

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V

ME 522 PRINCIPLES OF ROBOTICS. FIRST MIDTERM EXAMINATION April 19, M. Kemal Özgören

Page 1. Question 19.1b Electric Charge II Question 19.2a Conductors I. ConcepTest Clicker Questions Chapter 19. Physics, 4 th Edition James S.

Preview. Graph. Graph. Graph. Graph Representation. Graph Representation 12/3/2018. Graph Graph Representation Graph Search Algorithms

(a) v 1. v a. v i. v s. (b)

Final Exam Solutions

CPSC 665 : An Algorithmist s Toolkit Lecture 4 : 21 Jan Linear Programming

Ch 1.2: Solutions of Some Differential Equations

This Week. Computer Graphics. Introduction. Introduction. Graphics Maths by Example. Graphics Maths by Example

Minimum Spanning Trees

Lecture 4. Conic section

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality:

Chapter 16. 1) is a particular point on the graph of the function. 1. y, where x y 1

Basic Polyhedral theory

Notes on Finite Automata Department of Computer Science Professor Goldberg Textbooks: Introduction to the Theory of Computation by Michael Sipser

PH427/PH527: Periodic systems Spring Overview of the PH427 website (syllabus, assignments etc.) 2. Coupled oscillations.

Why the Junction Tree Algorithm? The Junction Tree Algorithm. Clique Potential Representation. Overview. Chris Williams 1.

12/3/12. Outline. Part 10. Graphs. Circuits. Euler paths/circuits. Euler s bridge problem (Bridges of Konigsberg Problem)

Garnir Polynomial and their Properties

5/9/13. Part 10. Graphs. Outline. Circuits. Introduction Terminology Implementing Graphs

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp

CS 461, Lecture 17. Today s Outline. Example Run

Outline. Circuits. Euler paths/circuits 4/25/12. Part 10. Graphs. Euler s bridge problem (Bridges of Konigsberg Problem)

Chem 104A, Fall 2016, Midterm 1 Key

SOME PARAMETERS ON EQUITABLE COLORING OF PRISM AND CIRCULANT GRAPH.

1 Minimum Cut Problem

Lecture contents. Bloch theorem k-vector Brillouin zone Almost free-electron model Bands Effective mass Holes. NNSE 508 EM Lecture #9

Oppgavesett kap. 6 (1 av..)

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

Algorithmic and NP-Completeness Aspects of a Total Lict Domination Number of a Graph

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari

Combinatorial Networks Week 1, March 11-12

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1

CIVL 8/ D Boundary Value Problems - Rectangular Elements 1/7

Duality # Second iteration for HW problem. Recall our LP example problem we have been working on, in equality form, is given below.

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula

CONIC SECTIONS. MODULE-IV Co-ordinate Geometry OBJECTIVES. Conic Sections

Mathematics. Mathematics 3. hsn.uk.net. Higher HSN23000

Supplementary Materials

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12

CSI35 Chapter 11 Review

We will see what is meant by standard form very shortly

The University of Sydney MATH2969/2069. Graph Theory Tutorial 5 (Week 12) Solutions 2008

MASSACHUSETTS INSTITUTE OF TECHNOLOGY HAYSTACK OBSERVATORY WESTFORD, MASSACHUSETTS

A Dynamic-Programming Heuristic for Regular Grid-Graph Partitioning

Spanning Tree. Preview. Minimum Spanning Tree. Minimum Spanning Tree. Minimum Spanning Tree. Minimum Spanning Tree 10/17/2017.

On spanning trees and cycles of multicolored point sets with few intersections

Case Study VI Answers PHA 5127 Fall 2006

Elliptical motion, gravity, etc

# 1 ' 10 ' 100. Decimal point = 4 hundred. = 6 tens (or sixty) = 5 ones (or five) = 2 tenths. = 7 hundredths.

1 Introduction to Modulo 7 Arithmetic

The Equitable Dominating Graph

Square of Hamilton cycle in a random graph

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management

a b c cat CAT A B C Aa Bb Cc cat cat Lesson 1 (Part 1) Verbal lesson: Capital Letters Make The Same Sound Lesson 1 (Part 1) continued...

The Matrix Exponential

Pre-Session Review. Part 1: Basic Algebra; Linear Functions and Graphs

Chapter 0. What is the Lebesgue integral about?

0.1. Exercise 1: the distances between four points in a graph

Lecture 3. Limits of Functions and Continuity

The Matrix Exponential

Finding low cost TSP and 2-matching solutions using certain half integer subtour vertices

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

On the Role of Fitness, Precision, Generalization and Simplicity in Process Discovery

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example

Construction of asymmetric orthogonal arrays of strength three via a replacement method

SCHUR S THEOREM REU SUMMER 2005

Transcription:

Wightd Mtching nd Linr Progrmming Jonthn Turnr Mrch 19, 01 W v sn tht mximum siz mtchings cn b found in gnrl grphs using ugmnting pths. In principl, this sm pproch cn b pplid to mximum wight mtchings. Th min diffrnc is tht w nd to choos n ugmnting pth tht producs th lrgst possibl incrs in wight t ch stp. This is illustrtd in Figur 1. Not tht if w ugmnt th c b 4 5 5 d f Figur 1: Mx wight ugmnting pths mtching shown using th pth bcf, w gt lrgr mtching with wight tht is on lrgr thn tht of th originl mtching. On th othr hnd, th ugmnting pth bdf lds to dcrs in th mtching wight. Th ugmnting pth tht producs th lrgst incrs in wight is bdcf. Dfin th wight of n ugmnting pth to b th totl wight of its non-mtching dgs minus th totl wight of its mtching dgs. This pth wight is th nt gin possibl from flipping th dgs in th pth. Suppos M is mx wight mtching of siz k (tht is, mong ll mtchings with k dgs, M hs mximum wight) nd p is mximum wight umnting pth with rspct to M. If w cn show tht flipping th dgs of p yilds mx wight mtching of siz k + 1 thn w could us this to find mximum wight mtchings of rbitrry siz. 1

To shows this, ssum tht M is mx wight mtching on k + 1 dgs nd lt N b th st of dgs tht is in M or M but not both. Not tht N consists of ltrnting pths nd cycls with rspct to M, nd its cycls ll hv vn lngth. Lt th wight of pth or cycl in N b th totl wight of its dgs tht r not in M minus th totl wight of its dgs tht r in M. Obsrv tht ny vn lngth cycl in N must hv wight 0 sinc othrwis w could incrs th wight of M without incrsing its siz by flipping th dgs in th cycl. Th sm obsrvtion holds for pths of vn lngth. Now, sinc N hs on mor dg from M thn from M, w cn pir up ll but on of th odd lngth pths, so tht ch pir hs n qul numbr of dgs from M nd M. By th sm rgumnt s bfor, ch such pir of pths must hv wight 0. Th rmining pth must b mximum wight ugmnting pth with rspct to M, sinc if it wr not, w could us mx wight ugmnting pth to produc mtching of siz k +1 with lrgr wight thn M. Hnc, w hv th following thorm. Thorm 1 Lt M b mtching of mximum wight mong mtchings of siz k, nd lt p b mximum wight ugmnting pth for M. Thn th mtching obtind by flipping th dgs of p hs mximum wight mong mtchings of siz k + 1. This thorm provids th bsis for wightd mtching lgorithm. Finding mximum wight ugmnting pth is difficult to do dirctly, spcilly for gnrl grphs. Howvr, w cn us linr progrmming dulity to fcilitt th srch for mx wight ugmnting pths. W strt by dfining 0-1 slction vribl x for ch dg in th grph; x = 1 will corrspond to th inclusion of dg in th mtching. Th mtching problm is thn quivlnt to th intgr linr progrm mximiz subjct to wight(x) = x w() ={u,v} x 1 x {0, 1} for ll vrtics u for ll dgs Th objctiv function mximizs th wight of th dgs in th mtching, whil th constrints limit us to on dg pr vrtx. If w rplc th 0-1 constrints on th slction vribls with inqulits of th form x 1 w gt th linr progrm rlxtion of this ILP. W ctully don t nd to includ ths inqulitis xplicitly, sinc th form of th stndrd LP lrdy constrins th x to b non-ngtiv nd consquntly, th othr

constrints prvnt thm from bing lrgr thn 1. Edmonds showd tht for biprtit grphs, th LP rlxtion hs optiml solutions in which ll th slction vribls r intgrs, vn though thy r not constrind to b. Th ssntil proprty tht mks this tru is tht th cofficint mtrix for th linr progrm is totlly unimodulr. Edmonds lso showd similr proprty for gnrl grphs but w will dfr tht for now. W cn us dulity to dvlop n fficint lgorithm for th biprtit cs. Th dul problm is minimiz u z u subjct to z u + z v w() for ll dgs = {u, v} Th dul vribls r rfrrd to s vrtx lbls. For convninc, w dfin z = z u + z v for = {u, v}. Th complmntry slcknss condition tlls us tht for optiml vlus of th priml nd dul vribls, if z > w() thn x must b zro, nd if ={u,v} x 1, z u must b zro. This is quivlnt to sying tht for ny dg in th optiml mtching, z = w() nd for ny fr vrtx u, z u = 0. Morovr, if w cn find vlus of th x nd z u tht stisfy th complmntry slcknss conditions, ths must corrspond to optiml solutions, hnc th x vlus dfin mximum wight mtching. W cn us this to construct n lgorithm tht systmticlly djusts th priml nd dul vribls until th complmntry slcknss conditions r stisfid. Th following thorm cpturs ths obsrvtions. Thorm Lt G = (V, E) b biprtit grph with dg wights w(), lt M b mtching in G, lt ch vrtx u hv non-ngtiv lbl z u nd lt z = z u + z v for = {u, v}. If (1) z w() for ll () z = w() for M () z u = 0 if u is fr thn M is mximum wight mtching. Although, w rrivd t Thorm using LP dulity, it cn ctully b provd indpndntly, without rfrnc to linr progrmming t ll. If N is ny mtching, thn w() z z u z = w() N N u M M

Th first inqulity follows from condition (1) in th thorm; th scond follows from th fct tht N is mtching; th third follows from condition (); nd th finl qulity follows from condition (). An dg = {u, v} with z = z u + z v = w() is clld n qulity dg. Not tht if p = u 0,..., u k+1 is n ugmnting pth, thn conditions (1) nd () in th thorm imply tht th wight of p stisfis th following. wight(p) = (w(u 0, u 1 ) + w(u, u ) + + w(u k, u k+1 )) (w(u 1, u ) + w(u, u 4 ) + + w(u k 1, u k )) = (w(u 0, u 1 ) + w(u, u ) + + w(u k, u k+1 )) (z u1 + z u + + z uk ) (z u0 + z u + + z uk+1 ) (z u1 + z u + + z uk ) = z u0 + z uk+1 Also, not tht if p is constructd ntirly from qulity dgs, its wight is xctly qul to z u0 + z uk+1. Hnc, ny ugmnting pth tht uss only qulity dgs is mx wight pth, whil ny ugmnting pth tht uss t lst on non-qulity dg is not mx wight pth. This lds dirctly to n lgorithm for finding mx wight mtching. At ll tims, w mintin lbls tht stisfy conditions (1) nd () nd w construct collction of trs using only qulity dgs. Whnvr w find such n ugmnting pth, w flip th dgs, s usul. Not tht this mintins th vlidity of condition () bcus ll dgs in th ugmnting pth r qulity dgs. At vrious points in th lgorithm, w my us up ll th qulity dgs, prvnting us from xpnding th collction of trs ny furthr. Whn this hppns, w djust th lbls so s to crt dditionl qulity dgs, tking cr to mintin th vlidity of conditions (1) nd (). Evntully, th lbl djustmnts cus condition () to b stisfid, cusing th lgorithm to trmint. Hr s mor complt dscription. First, initiliz M = {} nd for ll u, lt z u b hlf of th lrgst dg wight. This clrly stisfis conditions (1) nd (). W srch for ugmnting pths by building st of trs rootd t th fr vrtics, s w hv don bfor. At ch stp, w considr prviously unxmind qulity dg = {u, v} with u vn. If v is unrchd, w xtnd th tr by dding nd th mtching dg incidnt to v. If v is vn, thn w hv found n ugmnting pth tht w cn us to xtnd th tr. Evry tim w xtnd th mtching, w discrd th currnt st of trs nd th odd/vn sttus informtion. Howvr, w rtin th vrtx lbls. 4

If th srch xmins ll qulity dgs without finding n ugmnting pth, w djust th vrtx lbls s follows. Lt δ 1 = min{z u u is vn} δ = min{z w() = {u, v}, u is vn, v is unrchd} δ = min{(z w())/ = {u, v}, u is vn, v is vn} δ = min{δ 1, δ, δ } Not tht whil th lgorithm is running, thr must b t lst on vn vrtx, so δ 1 is lwys dfind. Howvr, δ nd δ my b undfind du to th lck of n dg tht stisfis th condition. If ithr or both r not dfind, th dfinition of δ is djustd to ignor th undfind δ i vlus. W djust th lbls by subtrcting δ from th lbls of vn vrtics nd dding δ to th lbl of odd vrtics. Notic tht this mintins th vlidity of condition (), sinc mtching dgs ithr hv both ndpoints unrchd or hv on odd ndpoint nd on vn ndpoint. It lso mintins xisting qulity dgs tht r prt of tr, sinc ths dgs lso connct n vn vrtx to nd n odd on. In ddition, it mintins th vlidity of condition (1), sinc no z u is rducd nough to crt violtion. Not howvr, tht qulity dgs with two odd ndpoints my bcom inqulity dgs, s rsult of lbl djustmnt. Obsrv tht if δ = δ 1, thn ftr th djustmnt, condition () is stisfid, so th currnt mtching is mx wight mtching. If δ = δ < δ 1 or δ = δ < δ 1, th djustmnt producs t lst on nw qulity dg, llowing th srch for n ugmnting pth to rsum. Lt s look t n xmpl of th lgorithm in ction. In Figur w s 4+ 4+ 4+ 4+ x 5 b 4 y 4+ z 4+ d v 4+ 4+ 4+ Figur : Gtting strtd th stt of th lgorithm ftr th first two stps. Th initiliztion st ll vrtx lbls qul to 4. Thn, th first stp discovrd th ugmnting pth 5

.5+.5+.5.5+.5+.5.5+ x 5 b 4.5 y.5+ z.5.5+ x 5 b 5.5 y.5+ z.5+ d v.5+.5.5 d v.5+.5.5 4 4 + x 5 b y z 1+ x 5 b y z d v +.5.5 d v 1+.5.5 Figur : Exmpl of lbling lgorithm from b to u nd ddd {b, u} to th mtching. Th scond stp ddd th dgs {b, y} nd {b, u} to th tr rootd t y. Not tht ths r th only qulity dgs t this point, so ftr th scond stp, th lgorithm rlbls vrtics. In this cs, δ = 0.5 nd dgs {c, z} nd {, v} bcom qulity dgs. Ths r lso ugmnting pths, so th lgorithm finds thm nd ugmnts th mtching. It thn rbuilds th tr consisting of dgs {b, u} nd {b, v} giving th stt shown in th top lft of Figur. At this point, w must gin pus to rlbl th vrtics. In this cs, δ = 1, mking {c, y} n qulity dg, llowing th tr to xpndd furthr, giving us th stt shown in top right of th figur. Onc mor, w must rlbl th vrtics, this tim using δ = 0.5. This, mks {, u} n qulity dg nd lds to th ugmnting pth uby nd th stt shown in th bottom lft of th figur. Two mor stps producs th finl mtching shown in th bottom right of th figur. Now lt s considr how to implmnt this most fficintly. W cn us hps to quickly dtrmin th δ i vlus whn rlbling is rquird. Lt h 1, b hp contining ll th vn vrtics with z(u) s th ky for vrtx u. W ll mintin scond hp h 1,o for th odd vrtics. Lt h b hp contining ll dgs with on vn nd on un-

rchd ndpoint, nd lt ky() = z w(). Lt h b hp contining ll dgs with two vn ndpoints, nd lt ky() = z w(). W cn lso us ths hps to updt th lbls fficintly if w us hp with n fficint ddtokys oprtion. This oprtion dds vlu x to th kys of ll itms in hp nd llows th lbls to b djustd implicitly. Whn w rmov vrtx u from h 1, or h 1,o, its ky vlu is usd to updt th lbl z u, but whil u is in ithr of th hps, its lbl vlu is rprsntd implicitly by th ky of th hp itm. W ll xplin ltr how to xtnd th d-hp to implmnt ddtokys in constnt tim. This mks ch lbl djustmnt constnt tim oprtion. Now, thr r t most n/ ugmnting pth srchs nd within ch srch, ll but th lst stp ithr xtnds th tr or prforms rlbling. Whn xtnding th tr, w mk on unrchd vrtx odd nd nothr on vn. Ths must lso b ddd to ithr h 1,o or h 1,. In ddition, th dgs incidnt to th nw vn vrtx must b xmind, nd ddd to h or h s pproprit (w my hv to rmov n dg from h hr lso). Sinc no vrtx bcoms vn mor thn onc in n ugmnting pth srch, ths hp oprtions contribut O(m log n) to th tim for ch pth srch nd O(mn log n) ltogthr. Th tim for ch rlbling oprtion is O(1). During ny singl ugmnting pth srch, n dg cn bcom n qulity dg t most on tim. Sinc ll but th lst rlbling oprtion crts t lst on nw qulity dg, th numbr of rlbling oprtions pr ugmnting pth srch is t most m nd so th run tim for ll rlbling oprtions is O(mn). Th rmining oprtions nd hnc th ovrll run tim is O(mn log n). Wht rmins is to xplin how th d-hp cn b xtndd to implmnt ddtokys in constnt tim. This cn b don by dding singl vribl to th hp. Ech ddtokys(x) dds x to. Whn n itm is insrtd into th hp with ky of k, w substitut k s th intrnl ky vlu stord in th hp. Subsqunt ddtokys oprtion do not chng this stord ky vlu, just th vlu of. To rcovr th tru vlu of hp itm s ky, w simply dd th currnt vlu of to th stord ky.