Graphs of Non-Crossing Perfect Matchings

  • Published on

  • View

  • Download

Embed Size (px)


  • Graphs of Non-Crossing Perfect Matchings*

    C. Hernando1, F. Hurtado2, and Marc Noy3

    1 Department de Matema`tica Aplicada I, Universitat Polite`cnica de Catalunya, Diagonal647, 08028 Barcelona, Spain. e-mail: hernando@ma1.upc.es2;3 Department de Matema`tica Aplicada II, Universitat Polite`cnica de Catalunya, PauGargallo 5, 08028 Barcelona, Spain. e-mails: 2hurtado,

    Abstract. Let Pn be a set of n 2m points that are the vertices of a convex polygon, and letMm be the graph having as vertices all the perfect matchings in the point set Pn whose edgesare straight line segments and do not cross, and edges joining two perfect matchingsM1 andM2 ifM2 M1 a; b c; d a; d b; c for some points a; b; c; d of Pn. We prove thefollowing results about Mm: its diameter is m 1; it is bipartite for every m; the connec-tivity is equal to m 1; it has no Hamilton path for m odd, m > 3; and nally it has aHamilton cycle for every m even, m 4.Key words. Perfect matching, Non-crossing conguration, Gray code

    1. Introduction

    Given a graph G, one can consider an associated graphMG whose vertices arethe perfect matchings of G and where two perfect matchings are adjacent if theirsymmetric dierence is a cycle C of G. In this case one says that C is an alternatingcycle for the two matchings. This denition is closely related to the matchingpolytope MG of G, a polytope whose vertices are the incidence vectors of all thematchings in G, since two perfect matchings are adjacent inMG if, and only if,they are adjacent in the graph of MG [8].

    The graphs MG have been studied in the past and some general results areknown, like the fact that they are always Hamiltonian [9]. Particular attention hasbeen paid to the case in which G is a plane bipartite graph, a situation of par-ticular interest in the study of chemical compounds [10, 15]. Another noteworthyinstance is when G Kn;n, and in this case MKn;n is the graph of the so calledassignment polytope [2, 3].

    In this paper we study a geometric version of the problem. Let Pn be a set ofn 2m points that are the vertices of a convex polygon, and let us consider

    * Partially supported by Proyecto DGES-MEC-PB98-0933

    Graphs and Combinatorics (2002) 18:517532

    Graphs andCombinatorics Springer-Verlag 2002

  • matchings in the point set Pn whose edges are straight line segments. A perfectmatching in Pn is said to be non-crossing if no two of its edges intersect. The pointsof Pn are labeled, consequently two matchings are considered equal only if theyhave exactly the same set of edges. We dene the graphMm as the graph having asvertices the non-crossing perfect matchings of Pn and edges joining M1 and M2 ifM2 M1 a; b c; d a; d b; c for some points a; b; c; d of Pn (seeFig. 1). Observe that in this case the symmetric dierence of M1 and M2 is a cycleof length four. This denition is adopted so that two adjacent matchings dier aslittle as possible, namely only in two edges.

    The graphM4 is depicted in Fig. 2. Some relevant properties can be observed:the graph is bipartite (this is indicated by black and white vertices), it is Hamil-tonian, and every vertex has another vertex at maximum distance 3. Moreover, ithas minimum degree 3 and it can be checked that it is 3-connected. The aim ofthis paper is to establish analogous properties for Mm with m 6.

    In Section 2 we show how to obtain a shortest path in Mm between any twovertices; in fact, our results provide a linear time algorithm for nding shortest








    Fig. 1. Adjacent matchings in M6

    Fig. 2. The graph M4

    518 C. Hernando et al.

  • paths. As a corollary, we prove that every vertex ofMm has eccentricity equal tom 1 and, as a consequence, the diameter ofMm is m 1. In Section 3 we showthat Mm is a bipartite graph for every m, and in Section 4 we prove that theminimum degree and the connectivity ofMm are equal to m 1. Finally, we showin Section 5 that Mm has no Hamilton path for m odd, m > 3, and, drawing onprevious work by Ruskey and Proskurowski [11], we show that Mm is Hamilto-nian for every m even, m 4.

    A result we wish to emphasize is that shortest paths can be easily constructed,which gives as a corollary the determination of the exact value of the diameter forevery m. These problems are usually dicult and have been only partly solved inrelated graphs like graphs of triangulations [7, 14], and graphs of non-crossingspanning trees [1, 5].

    On the other hand, it is well-known that Mm has Cm vertices, whereCm 1m1 2mm

    is a Catalan number. In the paper we make use of several

    bijections between matchings in Mm and other combinatorial objects countedby the Catalan numbers, like plane trees and balanced binary strings. In addi-tion, in our study of Mm we have found a bijection between matchings in Mman certain permutations of length m. This fact has an interesting combinatorialconsequence: it produces a new family of permutations counted by the Catalannumbers, not dened in terms of one forbidden subsequence of length three(see [13]).

    From now on a non-crossing perfect matching will be called simply amatching. The graphMm does not depend on the exact position of the points of Pnand, to x ideas, we take Pn as the set of vertices of a regular n-gon. Edgescorresponding to the sides of the polygon are called boundary edges.

    2. Shortest Paths, Eccentricities and Diameter

    We recall that the distance du; v between two vertices u and v in a graph is thelength r of a shortest path u w0 w1 wr v connecting them, where denotes adjacency. The eccentricity of a vertex v in a graph is the maximum of thedistances between v and any other vertex of the graph, and the diameter is themaximum of the eccentricities.

    In this section we show a simple method for nding shortest paths between anytwo vertices in Mm and, as a consequence, we obtain the exact value of thediameter. Before that we need to introduce some denitions and notations. If e isan edge not belonging to a matching M in Mm, but one of its neighbors M

    contains e, we say that M is obtained by insertion of e into M , and we use thenotation M e for the matching M. If e belongs to M we simply deneM e M .

    Observe that the insertion of an arbitrary edge e into a given matching isnot always possible, but it is certainly feasible when e is a boundary edge.In this case, if M M 0 and e is one of the edges exchanged, thenM e M 0 e. If M M 0 but e is not exchanged, then it can be checked thatM e M 0 e.

    Graphs of Non-Crossing Perfect Matchings 519

  • The insertion of a sequence of edges is recursively dened by

    M e1; e2; . . . ; er M e1; e2; . . . ; er1 er:

    Lemma 2.1. Let M 0 and M 00 be inMm and suppose they share the boundary edge e.Then all the matchings in any shortest path between M 0 and M 00 contain e.

    Proof. Let dM 0;M 00 d and let

    M 0 M0 M1 Md M 00

    be a shortest path between M 0 and M 00. Suppose that e does not belong to somematching in the path and let Mi be the rst one with this property. Consider nowthe sequence

    M 0 M0 e M1 e Md e M 00:

    By the remarks before Lemma 2.1, consecutive matchings in this sequence areeither equal or adjacent, but Mi1 e Mi e, and this gives a path of lengthsmaller than d, a contradiction. (

    Let M be in Mm. Let us consider the set E1 of boundary edges in M , andremove the endpoints of E1 both from Pn and from M . This gives a new point setwith a new matching, and we can similarly dene the current boundary edges E2and repeat the process. A disassembly sequence for the matching M is any se-quence e1; . . . ; em consisting of all the edges in M , with the property that all theedges in E1 come rst, next all the edges in E2, and so on.

    Observe that a disassembly sequence e1; . . . ; em for a matching M can beinserted into any other matching M 0, and that M 0 e1; . . . ; em M .Theorem 2.2. Let e1; . . . ; em be a disassembly sequence for a matching M, and letM 0 be any other matching. Then

    M 0 M 0 e1 M 0 e1; e2 M 0 e1; . . . ; em M

    is a shortest path between M 0 and M , where it is understood that some of theadjacencies in the above expression can be equalities.

    Proof. Let

    M 0 M0 M1 Md M

    be a shortest path P 0 between M 0 and M .Let us assume rst that e1 does not belong to M 0, and prove that there is a

    shortest path from M 0 to M in which the rst step is the insertion of e1. As e1belongs to M but not to M 0, there is an i > 0 such that Mi is the rst matching inthe sequence containing e1. In the sequence

    520 C. Hernando et al.

  • M 0 M0 e1 M1 e1 Md e1 M ;

    the equality M 0 M0 from the original path has been replaced by the properadjacency M 0 M0 e1, but the adjacency Mi1 Mi has been replaced by theequality Mi1 e1 Mi e1, therefore the length remains unchanged and we stillhave a shortest path.

    If e1 belongs toM 0, the rst step in the path P 0 is simply an equality. Henceforthwe see that in any case there is a path from M 0 toM starting by the insertion of e1.By Lemma 2.1 we know that all matchings in shortest paths from M 0 e1 to Mcontain e1. The same argument shows that there is a path fromM 0 e1 toM startingby the insertion of e2, and the repetition of the process proves the claim. (

    Remark that the above result provides in fact a linear time algorithm fornding shortest paths.

    Corollary 2.3. If two matchings M and M 0 inMm have exactly k edges in common,then

    dM ;M 0 m k 1:

    Proof. Observe that the path in the statement of Theorem 2.2 involves no ex-change when an edge already in M is to be inserted; this gives dM ;M 0 m k.But in the nal step, when only two edges have to be inserted, a single exchangeinserts in fact two edges. Hence dM ;M 0 m k 1. (

    This implies that the diameter is at most m 1. We show now that this is infact the exact value of the diameter.

    The union M1 [M2 of two matchings inMm is the union C1 Ck of edgedisjoint cycles, in which the edges from M1 and the edges from M2 alternate ineach cycle (an edge e in both M1 and M2 gives a double edge in M1 [M2, whichwe consider as a cycle of length 2). This decomposition is closely related to thedistance between the two matchings:

    Theorem 2.4. If M1 and M2 are such that M1 [M2 C1 Ck then

    dM1;M2 12


    i1lengthCi 2:

    Proof. The result is obvious for m 2, for m > 2 we distinguish two cases.If M1 and M2 share a boundary edge e, we remove the endpoints of e from the

    point set Pn, and from bothM1 andM2, then apply induction to the resulting pointset and matchings. Otherwise, let e be a boundary edge in M2 but not in M1. Weknow from Theorem 2.2 that there is a shortest path between M1 and M2 in whichwe rst move from M1 to M1 e. The cycle in M1 [M2 containing e becomes in

    Graphs of Non-Crossing Perfect Matchings 521

  • M1 e [M2 the double edge e plus a cycle with length equal to lengthC 2; wenow apply the previous case to M1 e and M2. (

    The preceding result is now applied to a special situation, which gives as aconsequence the lower bound for the diameter. Dene the rotation of an edge i; jas the edge i 1; j 1, addition being modulo 2m. Given a matching M 2Mm,its rotation M is the matching consisting of all the edges of M rotated.

    Theorem 2.5. Let M 2Mm and let M be its rotation. Then dM ;M m 1.

    Proof. Let r be an oriented line, not crossed by any edge in M , and leti; i 1; . . . ; i p be the points in Pn to the left of r. We claim that the union of theedges in M to the left of r, together with its rotations, is an alternating pathstarting at i, going through all the points to the left of r, and ending in i p 1(Fig. 3a). Observe that applying the claim to the edges to the right of r we get asimilar path from i p 1 to i. The concatenation of the two paths shows thatM [M is a single cycle of length n 2m, and Theorem 2.4 implies the result.


    i+p i+p+1









    (a) (b)

    Fig. 3. Edges in M are continuous; edges in the rotate matching M are dashed





    Fig. 4. Plane tree associated to a matching

    522 C. Hernando et al.

  • The claim is obvious when p 1, and we proceed by induction on p. Ifi; i p is an edge in M , we can take a line parallel to r leaving exactly the pointsi 1; . . . ; i p 1 to its left; by induction this gives by rotation a path from i 1to i p, which can be concatenated with the edge i; i p and its rotationi 1; i p 1. If i; i p is not an edge in M we can nd a number q and twooriented lines r0 and r00, non crossed by any edge of M , such that r0 has exactly thepoints i; . . . ; i q to its left and r00 the points i q 1; . . . ; i p (Fig. 3b). Now weapply induction to these two portions and concatenate the two resulting paths.(

    Corollary 2.6. The eccentricity of every vertex in Mm is equal to m 1, and thediameter of Mm is equal to m 1.

    3. Mm is a Bipartite Graph

    In this section we show thatMm is a bipartite graph for all m. To this end we use aclassical bijection between non-crossing perfect matchings and plane trees. Given amatching M in Mm dene a plane tree tM with m 1 nodes as follows: there is anode of tM for every edge ofM , plus a root q that is placed outside the edge 1; 2m.Join q to all the nodes corresponding to edges visible from q and proceed recur-sively (see Fig. 4, where the edges of tM are dashed and the root is in grey).

    Recall that the height of a node in a tree is the distance from the root, and thepath length of a tree is the sum of the heights of all its nodes. Let us denote thepath length of a tree t by pt. For instance, ptM 10 in the matching of Fig. 4.

    Lemma 3.1. If M and M 0 are adjacent in Mm, then the path lengths of tM and tM 0have dierent parity.

    Proof. Suppose M 0 M ab cd ad bc, and suppose the node in tM corre-sponding to c; d is a descendant of the node corresponding to a; b. If we let Cbe the set of vertices of Pn to the right of the edge c; d, then it is straightforwardto check that

    ptM ptM 0 1 2jCj:

    The other cases are treated similarly. (

    Partition the matchings in Mm according to whether the path length of theassociated tree is even or odd. The previous lemma says that all the edges arebetween the two parts of the partition, and as a corollary we have:

    Corollary 3.2. The graph Mm is bipartite for every m.

    Let us mention a dierent proof of this result. Label the points of Pn asf1; 10; 2; 20; . . . ;m;m0g in circular order, and let M be any (non-crossing perfect)matching. Then, because of parity considerations, any point i in f1; . . . ;mg hasto be matched in M with a point j0 in f10; . . . ;m0g. If we set ri j, thisdenes a permutation r rM of n letters. It is easy to check that if M and

    Graphs of Non-Crossing Perfect Matchings 523

  • M 0 are adjacent in Mm then rM and rM 0 dier in a single transposition(but not conversely), hence they have dierent parity. This establishes thebipartition.

    This proof has an interesting consequence. It is well known that the number ofnon-crossing perfect matchings of Pn is the Catalan number 1m1


    . The above

    correspondence then gives a family of permutations that is counted by the Catalannumbers. All the families of permutations w...


View more >