Grt Thortil Is In Computr Sin Vitor Amhik CS 15-251 Ltur 9 Grphs - II Crngi Mllon Univrsity Grph Isomorphism finition. Two simpl grphs G n H r isomorphi G H if thr is vrtx ijtion V H ->V G tht prsrvs jny n non-jny struturs. Cyly s Formul Th numr of ll trs on n nos is n n-2 Put nothr wy, it ounts th numr of spnning trs of omplt grph K n. 4 3 1 2 5 6 P = 5, 1, 1, 5 W prov it y fining ijtion twn th st of Prϋfr squns n th st of ll trs. Plnr Grphs Thorm: In ny onnt plnr grph with V vrtis, gs n F fs, thn V + F = 2 Thorm: In ny onnt plnr grph with t lst 3 vrtis: 3 V - 6 Lmm: In ny onnt plnr grph with t lst 3 vrtis: 3 F 2 Is K 5 plnr? K 5 hs 5 vrtis n 10 gs, thus = 10 3x5 6 = 9 whih is fls, thrfor K 5 is not plnr. Outlin Biprtit Grphs Kurtowski Thorm Grph Coloring Biprtit Mthing 1
Biprtit Grphs A grph is iprtit if th vrtis n prtition into two sts V 1 n V 2 suh tht ll gs go only twn V 1 n V 2 (no gs go from V 1 to V 1 or from V 2 to V 2 ) Th omplt iprtit grphs K m,n hv th proprty tht two vrtis r jnt if n only if thy o not long togthr in th iprtition susts. Is K 3,3 plnr? Thorm: In ny onnt plnr grph with t lst 3 vrtis: 3 V - 6 K 3,3 hs 5 vrtis n 9 gs, thus = 9 3x6 6 = 12 Not onlusiv! Is K 3,3 plnr? (g, f) 2, sin h g is ssoit with t most 2 fs (g, f) 4 F, sin grph ontins no simpl tringl rgions of 3 gs. From ulr s thorm: V + F = 2 F = 2 + 9 6 = 5. Contrition! It follows, tht 4 F 2 n for K 3,3 w hv 4F 18 F 4.5 Plnr Biprtit Grphs Th prvious xmpl stlish two simpl ritri for tsting whthr givn plnr grph is iprtit. Thorm. In ny iprtit plnr grph with t lst 3 vrtis: 2 V - 4 Lmm: In ny iprtit plnr grph with t lst 3 vrtis: 4 F 2 Kurtowski Thorm (1930) Thorm. A grph is plnr if n only if it ontins no sugrph isomorphi to suivision of K 5 or K 3,3. Suivision n Contrtion finition. Suiviing n g mns insrting nw vrtx (of gr two) into this g. B A Ptrsn grph For ny grph on V vrtis thr r ffiint lgorithms for hking if th grph is plnr. Th st on runs in linr tim O(V) C 2
Thorm. A grph is plnr if n only if it ontins no sugrph isomorphi to suivision of K 5 or K 3,3. B C A Ptrsn grph Rmov B to gt sugrph Thorm. A grph is plnr if n only if it ontins no sugrph isomorphi to suivision of K 5 or K 3,3. A is suiviing (,) A C is suiviing (,) C is suiviing (,) Thorm. A grph is plnr if n only if it ontins no sugrph isomorphi to suivision of K 5 or K 3,3. Suivision n Contrtion finition. Suiviing n g mns insrting nw vrtx (of gr two) into this g. finition. An g ontrtion is n oprtion whih rmovs n g from grph whil simultnously mrging th two vrtis it us to onnt. Wgnr Thorm Thorm. Grph G is plnr if n only if it ontins no sugrph tht n ontrt to on of th two Kurtowski sugrphs. Coloring Plnr Grphs A oloring of grph is n ssignmnt of olor to h vrtx suh tht no nighoring vrtis hv th sm olor Is th Ptrsn grph plnr? 3
Grph Coloring Thorm: Any simpl plnr grph n olor with 6 olors. Proof. (y inution on th numr of vrtis). If G hs six or lss vrtis, thn th rsult is ovious. Suppos tht ll suh grphs with V-1 vrtis r 6-olorl Rmov vrtx of gr lss thn 6, us IH. Put it k, sin it hs t most 5 jnt vrtis, w hv nough olors. Q Grph Coloring Thorm : vry simpl plnr grph hs vrtx of gr t most 5. Proof. g(v k ) = 2 2 (3 V 6) Avrg gr: 1/V g(v k ) 6 12/V < 6 Thus, thr xists vrtx of gr t most 5. Grph Coloring Thorm: Any simpl plnr grph n olor with lss thn or qul to 5 olors. Proof. (rpt th 6-olors proof) Pik vrtx v of gr 5. Ll th vrtis jnt to v s x 1, x 2, x 3, x 4 n x 5. Assum tht x 4 n x 5 r not jnt to h othr. Why w n ssum this? If thy ll jnt, w gt K 5. Rmov gs (v, x 1 ), (v, x 2 ) n (v, x 3 ). Contrt gs (v, x 4 ), (v, x 5 ). Vrtis v, x 4, x 5 will rpl y y, so nighors of v, x 4, x 5 will nighors of y. W otin nw grph H with two lss vrtis. By IH th grph H n olor with 5 olors. Nxt, w ssign y-olor to x 4 n x 5 W giv v olor iffrnt from ll olors us on th four vrtis x 1, x 2, x 3 n y. Q 4 Color Thorm (1976) Thorm: Any simpl plnr grph n olor with lss thn or qul to 4 olors. It ws provn in 1976 y K. Appl n W. Hkn. Thy us spil-purpos omputr progrm. Sin tht tim omputr sintists hv n working on vloping forml progrm proof of orrtnss. Th i is to writ o tht sris not only wht th mhin shoul o, ut lso why it shoul oing it. In 2005 suh proof hs n vlop y Gonthir, using th Coq proof systm. Biprtit Mthing A grph is iprtit if th vrtis n prtition into two isjoint (lso ll inpnnt) sts V 1 n V 2 suh tht ll gs go only twn V 1 n V 2 (no gs go from V 1 to V 1 or from V 2 to V 2 ) Prsonnl Prolm. You r th oss of ompny. Th ompny hs M workrs n N jos. h workr is qulifi to o som jos, ut not othrs. How will you ssign jos to h workr? 4
Biprtit Grphs Thorm. A grph is iprtit iff it os not hv n o lngth yl. Proof. ) If it s iprtit n hs yl, its lngth must vn. Biprtit Grphs Thorm. A grph is iprtit iff it os not hv n o lngth yl. ) Fix vrtx v. fin two sts of vrtis A ={w V vn lngth shortst pth from v to w} B ={w V o lngth shortst pth from v to w} If x n y from A, thy nnot jnt. By ontrition. Thr will n o lngth yl. Th sm rgumnt for B. Ths sts provi iprtition. Biprtit Mthing finition. A sust of gs is mthing if no two gs hv ommon vrtx (mutully isjoint). Is tr lwys iprtit grph? finition. A mximum mthing is mthing with th lrgst possil numr of gs Biprtit Mthing finition. A prft mthing is mthing in whih h no hs xtly on g inint on it. A prft mthing is lik ijtion, whih rquirs tht V 1 = V 2 n in whih s its invrs is lso ijtion. Hll s (mrrig) Thorm Thorm. (without proof) Lt G iprtit with V 1 n V 2. For ny st S V 1, lt N(S) not th st of vrtis jnt to vrtis in S. Thn, G hs prft mthing if n only if S N(S) for vry S V 1. 5
Altrnting Pth A mthing M hs som mth n som unmth vrtis. (y1,x2),(y3,x4) Altrnting pth hs gs ltrnting twn M n - M. Pth x1, y1, x2, y3, x4 is ltrnting. Augmnting Mthing If mthing M (in grn) hs n ugmnting pth, thn w gt lrgr mthing y swpping th gs on th ugmnting pth. An ltrnting pth is ugmnting if oth of its npoints r fr vrtis. x1 x2 x3 x4 x1 x2 x3 x4 x1 x2 x3 x4 Pth x1, y1, x2, y3, x4, y4 is ugmnting. y1 y2 y3 y4 y1 y2 y3 y4 y1 y2 y3 y4 Hungrin Algorithm Th lgorithm strts with ny mthing n onstruts tr vi rth-first srh to fin n ugmnting pth. If th srh sus, thn it yils mthing hving on mor g thn th originl. Thn w srh gin (it most it hppns is V/2) for nw ugmnting pth. If th srh is unsussful, thn th lgorithm trmints n must th lrgst-siz mthing tht xists. Wht is th runtim omplxity of th Hungrin lgorithm? Complxity of BFS O(V+) W run it V/2 tims This, th runtim is O(V ). Proof of Corrtnss Th lgorithm lrly trmints, sin w mth on vrtx pr stp. Suppos tht thr wr nothr mthing M1 tht us mor gs thn M. Ovrlp M n M1 - th rsult is union of yls n pths. Rook Attk This prolm sks us to pl mximum numr of rooks (thy mov horizontlly n vrtilly) on hssor with som squrs ut out (forin positions) Thr is pth tht hv mor M1 gs thn from M. This pth is n ugmnting pth. Contrition. 6
Rook Attk This prolm sks us to pl mximum numr of rooks on hssor with som squrs ut out. r1 r2 1 2 Plnr Grphs Kurtowski Thorm Grph Coloring Biprtit Grphs Biprtit Mthing Th numr of non-ttking rooks quls th numr of gs in mthing. r3 3 Hr s Wht You N to Know 7