Fura Uiversity Electroic Joural of Udergraduate Matheatics Volue 00, 1996 6-16 MAXIMUM MATCHINGS IN COMPLETE MULTIPARTITE GRAPHS DAVID SITTON Abstract. How ay edges ca there be i a axiu atchig i a coplete ultipartite graph? Several cases where the aswer is kow are discussed, ad the a ew forula is give which aswers this questio. 1. Itroductio Suppose we have a copay that has several departets, ad for soe project, we wat the eployees fro differet departets workig i pairs. If o eployee works i ore tha oe departet, the how ay siultaeous pairs of eployeescawehavewithoeployeeiorethaoepair? Thatis,whatisthe axiu uber of pairs? Whe ca all eployees be paired? We will treat this as a proble i graph theory. We will see that eployees correspod to vertices, ad pairs of eployees correspod to edges. Siilarly, departets relate to vertexpartitio sets i a ultipartite graph that represets the copay. Furtherore, we will cosider the coplete ultipartite graph because we allow ay pair of eployees i differet departets to be paired together. Fially, we will see that vertexdisjoit edges correspod to disjoit pairs of eployees. Thus our goal is to fid a atchig, that is, a set of vertexdisjoit edges, of largest size. We will use stadard otatio ad defiitios fro graph theory [1] to look at this proble. I essece, i this paper, we look at how ay edges there ca be i a axiu atchig i a coplete ultipartite graph. We first look at several cases i which the aswer is kow. Except for results which are cited, all of the theores are origial. Fially, i our coclusio, we provide a ew theore which solves this proble with a siple forula. 2. Basic Defiitios First, we defie a graph to be a fiite set of objects, called vertices, together with a collectio of uordered pairs of vertices, called edges. Pictorially, edges ca be viewed as lie segets coectig the vertices. (See Figure 1.) A graph is ultipartite if the set of vertices i the graph ca be divided ito o-epty subsets, called parts, such that o two vertices i the sae part have a edge coectig the. (See Figure 2.) Furtherore, a coplete ultipartite graph is a ultipartite graph such that ay two vertices that are ot i the sae part have a edge coectig the. We will deote a coplete ultipartite graph with parts by K 1, 2,..., where i is the uber of vertices i the i th part of the graph. Because it will be helpful later, we will assue without loss of geerality Received by the editors Jue 8, 1996. 6
MAXIMUM MATCHINGS IN COMPLETE MULTIPARTITE GRAPHS 7 that 1 1 2. Furtherore, we will call the th part the axiu part. A exaple of a coplete ultipartite graph would be K 2,2,3. (See Figure 3.) Figure1 AGraph. Figure 2 A 3-Partite Graph. Figure 3 A Coplete 3-Partite Graph. Two edges are said to be vertex disjoit if they do ot have a vertexi coo. We call a set of pairwise vertexdisjoit edges a atchig. Clearly, every edge coects two vertices, ad every vertexi a atchig lies o exactly oe edge by the defiitio of vertexdisjoit edges. (See Figure 4.) So if E equals the total uber of edges i a atchig, ad if V equals the total uber of vertices i the sae atchig, the V =2E. A atchig is called axiu if there is o other atchig cotaiig ore edges. I Figure 5, the thick lies represet a axiu atchig i the graph with vertices A, B, C, ad D. (See Figure 5.)
8 DAVID SITTON Figure 4 VertexDisjoit Edges. A B A B C D C D Figure 5 A Matchig. 3. A Useful Lea We will let M be the uber of edges i, i.e. the size of, a axiu atchig. Notice the, that 2M is the largest uber of vertices used by ay atchig of a give graph. Sice o vertexca be used ore tha oce i a atchig, the uber of vertices used i a axiu atchig ust be less tha or equal to the total uber of vertices i the graph. [1] Lea 1. Let T be the total uber of vertices i a graph ad let M be the uber of edges i a axiu atchig of the graph. The M T/2, where x is the greatest iteger less tha or equal to x. That is, the uber of edges i a axiu atchig of the graph is less tha or equal to oe half the total uber of vertices i the graph. Observe that if a atchig uses all vertices, or all but oe vertex, the o larger atchig ca be produced, so the atchig ust be axial. So whe lookig for axiu atchigs, we will try to fid atchigs that use all but possibly oe vertex. 4. Matchigs i Coplete Graphs A coplete graph is a graph for which every two vertices i the vertexset have a edge coectig the. Thus a coplete graph has all possible edges. Note that a coplete graph is just a coplete ultipartite graph for which every part cosists of a sigle vertex. What is M i a coplete graph?
MAXIMUM MATCHINGS IN COMPLETE MULTIPARTITE GRAPHS 9 To fid a axiu atchig, take two vertices of the graph ad coect the, the repeat this process for the reaiig vertices util either oe or o vertices reai. Clearly this produces a axiu atchig, because a larger atchig would require ore vertices tha are i the graph. Hece, if there is a eve uber of vertices i the graph, M = T/2 (o uused vertices), ad if there is a odd uber of vertices i the graph, the oly T 1 vertices are used, so M =(T 1)/2. Thus M = T/2. 5. Matchigs for Coplete Multipartite Graphs Now cosider a axiu atchig i a coplete ultipartite graph with T total vertices ad a arbitrary uber of parts. (See Figure 6.) The size of the axiu atchig has the sae upper boud of T/2. But, ca a axiu atchig always use all but at ost oe vertex? To aswer this, cosider the case of K 2,3,7. Sice o two vertices i the part with 7 vertices ca be coected by a edge, all vertices i a axiu atchig fro the part with 7 vertices ust be coected to vertices fro the other two parts. However, there are oly 5 such vertices, so at least 2 of the vertices fro the part with 7 vertices ca ot be used i ay axiu atchig. Clearly, M (T 2)/2 = T/2 1 < T/2, ad hece soe ethod of calculatig M other tha searchig for a atchig usig all but possibly oe of the vertices is ecessary. (See Figure 7.) 1 2 3 Figure 6 A Coplete Multipartite Graph K 1, 2,...,. dav7.eps Figure 7 A Maxiu Matchig for the Trivial Case K 2,3,7. As we saw i the previous sectio, the difficulty with fidig M for the coplete ultipartite graph K 2,3,7 was that the axiu part had ore vertices tha all of the other parts cobied. Clearly, wheever the axiu part i a coplete ultipartite graph has ore vertices tha all the other parts cobied, a axiu atchig that uses all vertices caot be foud. Note fro the exaple, K 2,3,7, that the least uber of vertices are left uused whe all edges i the atchig use vertices i the axiu part. Thus, for ay coplete ultipartite graph with ore vertices i oe part tha i all the other parts cobied, a axiu atchig is obtaied by coectig all vertices ot i the axiu part to vertices i the axiu part. This atchig uses all vertices ot i the axiu part, ad
10 DAVID SITTON each of its edges is coected to a vertexi the largest part. Thus, ay axiu atchig i this graph has as ay edges as the total uber of vertices ot i the axiu part. This case will be called the trivial case. Theore 1. Let K 1, 2,..., be a coplete ultipartite graph with i vertices i the i th part, labeled so that 1 2.If 1 + 2 + + 1, the: (i) the uber of edges i ay axiu atchig is M = 1 + 2 + + 1 ; (ii) a axiu atchig is obtaied by coectig all vertices i the parts with 1, 2,, 1 vertices to vertices i the part with vertices. Now cosider the 2-partite (bipartite) case, the coplete bipartite graph K,, where. This satisfies the trivial case with M =. (See Figure 8.) [1] Figure 8 A Maxiu Matchig for the Bipartite Case K,. 6. The Notrivial Coplete Multipartite Graph: 6.1. The 3-Partite Case. Cosider the otrivial case, the case i which the axiu part has fewer vertices tha the saller parts cobied. Note that a atchig usig all vertices, except possibly oe, ust be axial. So we will try to fid a algorith to produce such a atchig if possible ad if it exists, we kow that M = T/2. First, cosider the otrivial, coplete ultipartite graph with 3 parts, K l,,, with l ad <l+. We assue first that there are a eve uber of vertices i this graph. For coveiece, let parts I, II, ad III be the parts with l,, ad vertices, respectively. Now, to produce a atchig i the graph we choose l vertexdisjoit edges betwee parts II ad III. (See Figure 9.) Now parts I ad II both have l vertices available ad part III has ( l)vertices available. The subgraph cotaiig oly the uatched vertices, K l,l, ( l), is otrivial because ( l) <l+ ( l) =l + l =2l. Note that sice ( l) = + + l 2, we see that part III has a eve uber of vertices. So we choose a = 1 2 ( ( l)) edges betwee parts I ad III; ad we choose the sae uber of edges betwee parts II ad III. (See Figure 10.)
MAXIMUM MATCHINGS IN COMPLETE MULTIPARTITE GRAPHS 11 I II l III -l edges Figure 9 Costructio of a Maxiu Matchig for a 3-Partite Graph. I II l a edges III a edges -l edges Figure 10 Costructig a Maxiu Matchig Step Two: a =[ ( l)]/2. Now l edges were put i the atchig by the first selectio procedure, ad ( l) edges put i the atchig by the secod selectio procedure. Furtherore, we ow have a coplete bipartite graph cosistig of all available vertices fro the origial graph that are ot yet used i the atchig. Furtherore, both parts I ad II i the bipartite graph of available vertices ad edges have the sae uber of vertices, k = l 1 2 ( ( l)) vertices. So we choose k edges betwee parts I ad II as we did i the trivial case. Now, all vertices i the graph have bee used i the costructed atchig, so M = T/2=(l + + )/2. (See Figure 11)
12 DAVID SITTON I II l l-a edges a edges III a edges -l edges Figure 11 Costructig a Maxiu Matchig: Step Three. Now cosider the case whe l++ is odd. We kow <+l so +(l 1). So we choose oe vertexfro part I to be excluded fro the atchig. We have a otrivial coplete 3-partite graph with a eve uber of vertices if l>1, ad a coplete bipartite graph if l = 1. Both of these cases are discussed above. If = +(l 1), the we have the trivial case. Otherwise, a axiu atchig i a coplete 3-partite graph uses all but at ost oe vertex. Therefore, M = T/2. Theore 2. If K l,, is a otrivial coplete 3-partite graph with l (ad <l+ ), the (i) M = T/2 ; ad (ii) a axiu atchig is obtaied by the followig algorith: Step 1: If T is odd, the ark off oe vertexi the part with l vertices to be excluded. Let l = l if T is eve ad l = l 1ifT is odd. Step 2: Coect 1 2 (l + ) vertices fro the part with vertices to the part with l vertices. Step 3: Coect all reaiig vertices i the parts with ad l vertices to the vertices i the reaiig part. We ow have produced a axiu atchig for ay otrivial coplete 3- partite graph. We ote that for ay axiu atchig i a otrivial, 3-partite graph with a odd uber of vertices, the excluded vertex ca coe fro ay of the three parts. Furtherore, if there are a eve uber of vertices, the sae uber of edges ust be used betwee ay two parts i the graph for ay axiu atchig chose, because by coectig vertices betwee the saller parts, we get a trivial 3 partite subgraph with the axiu part havig exactly the sae uber of vertices as the other two parts cobied, expressed as K,. 6.2. Four or More Parts. Now we would like to use the theore i the previous sectio to fid axiu atchigs for all otrivial, ultipartite graphs. We will use the priciple of atheatical iductio to fid such a atchig. Observe that K, always has a axiu atchig of size usig all vertices. Furtherore, as we saw above, the graph K l,, with a eve uber of vertices has a axiu atchig of size T/2 usig all vertices. Suppose for a give 3, we kow that for ay otrivial, coplete ultipartite graph with or 1parts,K 1, 2,..., 1 or K 1, 2,...,, the size of a axiu atchig is M = T/2. Now cosider a arbitrary otrivial ultipartite graph
MAXIMUM MATCHINGS IN COMPLETE MULTIPARTITE GRAPHS 13 with +1 parts, K 1, 2,...,, +1 Figure 12.) with 1 2 +1. (See 1 2 +1 Figure 12 A Coplete Multipartite Graph with +1Parts. Sice this graph is otrivial, +1 < 1 + 2 + + 1 +. Suppose there are eve uber of vertices i this graph. Choose 1 vertexdisjoit edges betwee the parts of size 1 ad +1. (See Figure 13.) 1 2 edges 1 +1 Figure 13 Costructig a Maxiu Matchig: Step Oe. The reaiig vertices correspod to the sectio of the coplete ultipartite graph with parts: K = K 2, 3,...,, +1 1. This graph has either or 1parts. Sice +1 4, there ust be parts with 2 ad 3 vertices, ad with +1 1 vertices if 1 +1, i this graph. It is the sufficiet to show that all reaiig vertices ca be used i the atchig. Furtherore, to do this it is oly ecessary to show that the K is otrivial sice it has or 1 parts. But sice { i } +1 i=1 is ootoic odecreasig, the axiu part has either +1 1 or vertices. Ad, we kow that +1 < 1 + 2 + 3+ + subtractig 1 fro both sides yields +1 1 < 2 + 3 + +. So if the axiu part has +1 1 vertices, the K is otrivial. Suppose is the largest copoet. The there are two cases: (i) +1 = 1,iwhich case we are left with a ultipartite graph with 1 parts; ad (ii) +1 1. Cosider the first case, +1 = 1. The K is has 1parts,ad +1 = 1, so 1 = 2 = = = +1. Hece, the axiu part has
14 DAVID SITTON vertices ad = 2 < 2 + 3 + + so K is otrivial, sice K ust have at least 2 parts, 2 ad. Now cosider the secod case, +1 1 ad is the size of the part with the ost vertices. Sice 1 2, clearly ( +1 1 )+ 2 + + 1 = +1 +( 2 1 )+ 3 + + 1 +1 + 3 + + 1 > +1. So if the axiu part has vertices, the K is a otrivial coplete ultipartite graph with either or 1parts. By iductio, all vertices will be used i ay axiu atchig of this graph. Furtherore, by akig such a atchig ad addig the 1 edges betwee parts of size 1 ad +1 etioed above, a axiu atchig usig all vertices i the origial graph is obtaied. Hece, ay otrivial coplete ultipartite graph with a eve uber of vertices has a axiu atchig usig all vertices i the graph. Now suppose T is odd. The choose the vertexto be excluded fro the axiu atchig to be fro the part with 1 vertices. Sice K is otrivial, ad sice there are a odd uber of vertices, we kow that +1 < 1 + 2 + +. Therefore +1 ( 1 1) + 2 + 3 + +,sok = K 1 1, 2, 3,..., +1 is a otrivial graph, ow with a eve uber of vertices. Ad sice 3, it has either +1parts,or parts if 1 = 1. So we ca fid a axiu atchig for K as we did above. Cosequetly, we have obtaied a axiu atchig for K usig all but oe vertex. Therefore, for ay otrivial coplete ultipartite graph, we ca fid a axiu atchig usig all but at ost oe vertex. Hece for ay otrivial coplete ultipartite graph, M = T/2. Theore 3. Give ay coplete ultipartite graph, K 1, 2,...,,where 1 2 ad < 1 + 2 + + 1, the followig hold: (i) M = T/2 ; ad (ii) the followig algorith produces a atchig of size M : Step 1: If there are a odd uber of vertices, reove oe vertexfro the sallest part ad the relabel the parts that still have uused vertices i order of icreasig size. Step 2: If there are exactly two oepty parts, coect all vertices i oe part to vertices i the other ad stop. Step 3: If there are exactly three oepty parts, follow the procedure outlied i the 3-part theore, ad stop. Step 4: Coect all vertices fro a part with 1 vertices to the axiu part, ad the relabel reaiig parts i order of icreasig size. Retur to Step 2. 6.3. Alterative proof: I the proof of this theore, we have put edges ito a atchig ad looked at graphs with fewer vertices, ad fewer parts, util o vertices reaied. We will ow look at aother proof of this theore, oe which just reduces the uber of parts i the graph ad iserts the edges at the ed. Suppose that give ay otrivial coplete ultipartite graph with parts, M = T/2. The, suppose we have a graph K 1, 2,...,, +1 with 1 2 +1, +1 < 1 + 2 + +,ad>3. Cosider the coplete ultipartite graph with parts, K = K 1+ 2, 3,...,, +1. (See Figure 14.)
MAXIMUM MATCHINGS IN COMPLETE MULTIPARTITE GRAPHS 15 1 2 +1 Figure 14 Costructig a Maxiu Matchig: Alterative Step Oe This clearly is the origial + 1-partite graph with all edges betwee 1 ad 2 reoved. Clearly i K the axiu part is either +1 or 1 + 2. Note that +1 < 1 + 2 + 3 + +.Furtherore, 1 ad 2 +1 so sice >3, we kow that 1 + 2 + +1 < 3 + 4 + + + +1. Therefore, the axiu part i the graph K 1+ 2, 3, 4,...,, +1 has fewer vertices tha the su of the vertices i all of the other parts. Thus we have a otrivial ultipartite graph with parts. Hece, all vertices, (except oe possible odd vertex), i the graph will be used i ay axiu atchig of K. Cosequetly, the sae is true for the coplete ultipartite graph with +1 parts, K 1, 2,...,, +1.ThuswekowM = T/2 for the coplete ultipartite graph with + 1 parts. So, by iductio, for ay otrivial coplete ultipartite graph, all but at ost oe vertexwill be uused i ay axiu atchig, or M = T/2. The iportace of this proof is that we get a uch ore geeral stateet about where edges go i the axiu atchig. The first proof says that if all edges i the part with the least vertices are coected to vertices i the axiu part, ad this process is repeated, the evetually a otrivial coplete ultipartite graph with either 2 or 3 parts is obtaied for which we kow the arrageet of the edges i a axiu atchig. So i essece we kow the exact arrageet of the edges for a particular axiu atchig of ay coplete ultipartite graph. The secod proof shows that the parts ca be cobied ito fewer parts with ore vertices per part util we have a otrivial coplete ultipartite graph with 3 parts, ad the a axiu atchig ca be produced. So usig this secod proof we ca fid ay differet edge arrageets for a axiu atchig i ay coplete ultipartite graph. 7. Cobiatio of Results: We ow cosider the ultipartite graph K 1, 2,..., where 1 2. If the axiu part is trivially large, > 1 i=1 i, the we see that the size of ay axiu atchig is M = 1 i=1 i = 2 1 2 i=1 i < ( + 1 i=1 i)/2 = ( i=1 i)/2 = T/2. Hece i this case, the size of ay axiu atchig
16 DAVID SITTON ust be M = i{ 1 i=1 i, 1 2 i=1 i }. Suppose istead, that the axiu part is ot trivially large, < 1 i=1 i. The the size of ay axiu atchig is M = 1 2 i=1 i 1 2 [( 1 i=1 i)+ ] < 1 2 (2 1 i=1 i)= 1 i=1 i. Hece i this case, the size of ay axiu atchig ust be M = i{ 1 i=1 i, 1 2 i=1 i }. Fially, if whe the axiu part has exactly the sae uber of vertices as the total uber of vertices i the saller parts, = 1 i=1 i, the the size of ay axiu atchig is M = 1 2 i=1 i = 1 2 ( 1 i=1 i + )= 1 2 (2 1 i=1 i) = 1 i=1 i. Thus, the size of ay axiu atchig is M =i{ 1 i=1 i, 1 2 i=1 i }. Sice there are o other possibilities for the size of the axiu part i a coplete ultipartite graph, we get the followig: Theore 4. Give ay coplete ultipartite graph K 1, 2,...,,with vertices i the axiu part, the size of a axiu atchig is 1 M =i{ i, 1 i }. 2 i=1 Refereces [1] Chartrad, Gary ad Lesiak, Lida. Graphs ad Digraphs. Wadsworth, Ic., Belot, Califoria (1986). [2] Lovász, L. ad Pluer, M. D. Matchig Theory. North-Hollad, New York (1986). David Sitto: Udergraduate at The Uiversity of Souther Mississippi Sposor: Jeffrey L. Stuart, Uiversity of Souther Mississippi Dept. of Matheatics E-ail address: Jeffrey Stuart@bull.cc.us.edu i=1