Rainbow Perfect and Near-Perfect Matchings in
Complete Graphs with Edges Colored by
Circular Distance
Abstract
Given an edge-colored complete graph on vertices, a perfect (respectively, near-perfect) matching in with an even (respectively, odd) number of vertices is rainbow if all edges have distinct colors. In this paper, we consider an edge coloring of by circular distance, and we denote the resulting complete graph by . We show that when has an even number of vertices, it contains a rainbow perfect matching if and only if or , where is a nonnegative integer. In the case of an odd number of vertices, Kirkman matching is known to be a rainbow near-perfect matching in . However, real-world applications sometimes require multiple rainbow near-perfect matchings. We propose a method for using a recursive algorithm to generate multiple rainbow near-perfect matchings in .
Keywords Rainbow perfect matching Edge-colored complete graph Circular distance Sports scheduling Round-robin tournament
1 Introduction
Given an edge-colored undirected graph , a rainbow matching (or heterochromatic matching) in is a matching (a set of edges without common vertices) such that all edges have distinct colors. While it is possible to find a maximum matching in in polynomial time, computing a maximum rainbow matching is known to be an NP-hard problem. Indeed, the decision version of this problem is a classical example of NP-complete problems, even for edge-colored bipartite graphs [1].
If a graph has an even number of vertices, a rainbow perfect matching in is a rainbow matching that matches all vertices of the graph. If the number of vertices is odd, a rainbow near-perfect matching in is a rainbow matching in which exactly one vertex is unmatched. Note that in this paper, we use RPM to mean either a rainbow perfect matching or a rainbow near-perfect matching in the corresponding graph.
Over the past decade, finding rainbow perfect and near-perfect matchings in edge-colored graphs or hypergraphs has been studied for several classes of graphs, including complete bipartite graphs [2], -partite graphs [3], Dirac bipartite graphs [4], random geometric graphs [5], and -uniform, -partite hypergraphs [6]. Most of the above studies assume that there are more colors used for coloring than there are colors among matchings. If we do not insist on perfect matchings, other studies have demonstrated the existence of large rainbow matchings in arbitrarily edge-colored graphs. Letting denote the minimum color degree of an edge-colored graph , Wang and Li [7] first showed the existence of a rainbow matching whose size is , and conjectured that a tighter lower bound exists if holds. LeSaulnier et al. [8] proved a weaker statement, that an edge-colored graph always contains a rainbow matching of size at least . Kostochka and Yancey [9] completed a proof of Wang and Li’s conjecture. Letting be the size of vertices of a graph , Lo [10] showed that an edge-colored graph contains a rainbow matching of size at least , where . If the graph is properly edge-colored (i.e., no two adjacent edges have the same color), several results [11, 12, 13, 14] have provided lower bounds for the size of a maximum rainbow matching. Other recent studies [15, 16, 17] have focused on finding large rainbow matchings under the stronger assumption that the given is strongly edge-colored. See Kano and Li [18] for a deeper analysis of rainbow subgraphs in an edge-colored graph.
Many results related to rainbow matchings in complete graphs have also been obtained from Ramsey-type problems. Letting denote a matching of size , Fujita et al. [19] determined for and and provided a conjecture regarding , where the anti-Ramsey value is the smallest integer such that for any exact -edge coloring of , there exists a subgraph isomorphic to that is rainbow. Haas and Young [20] confirmed the conjecture regarding for . More Ramsey-type results can be found in a survey by Fujita, Magnant, and Ozeki [21]. To the best of our knowledge, there has been no research on finding RPMs in edge-colored complete graphs with exactly colors. If we consider any exact -edge coloring of where , the results in [19] show that the size of a maximum rainbow matching is bounded by . This indicates that there does not always exist an RPM in by an arbitrary -edge coloring. Thus, we consider RPMs in edge-colored complete graphs by a special -edge coloring, called a circular-distance edge coloring. We show results for the existence and non-existence of such RPMs, and then propose a method for using a recursive algorithm to generate multiple RPMs when is odd.
In this paper, all graphs are simple and undirected. A graph is defined as , where (or ) is the set of vertices and (or ) is the set of edges. We define a vertex set containing vertices as , unless indicated otherwise. Given a graph and a set of distinct colors , the circular-distance edge coloring of a graph is a mapping , where an edge is colored as
(1) |
We denote by the edge-colored complete graph with each edge colored by . According to coloring (1), is colored in exactly colors, and it is not properly colored if . Here, we aim to find an RPM in , that is, a rainbow matching where . Figures 1 and 2 respectively show examples of and with their RPMs.
Given an RPM in , an -rotated matching of denoted by is defined as
(2) |
Figure 3 shows the 1-rotated matching for the RPM in Figure 1(b).
This example shows that if we arrange vertices around a cycle in clockwise order, matches by rotating matching by in the clockwise direction.
If is an RPM in the graph , we observe that the following properties hold from definition (2):
Property 1.1.
is an RPM,
Property 1.2.
,
Property 1.3.
If , ,
Next, we define the reversed matching of as :
(3) |
Figure 4 shows the reversed matching for the RPM in Figure 2(b).
Given an RPM in the graph , the following properties hold by definition (3):
Property 1.4.
The matching is also an RPM in the graph ,
Property 1.5.
.
1.1 Round-robin tournament scheduling problem
In real-world applications, some combinatorial problems and their sub-problems are related to searches for an RPM in . A well-known example is scheduling for round-robin tournaments.
Given teams (where is even), a tournament organizer must decide which games take place in which rounds. The round-robin tournament scheduling problem (RTSP) aims to generate a schedule with rounds such that
-
•
each pair of teams is matched exactly once, and
-
•
each team plays exactly one game in each round.
Translating this problem into the language of graph theory, let each team be a vertex, and let an edge connecting vertices and represent a game between teams and . A perfect matching in the complete graph thus describes a round of games. Therefore, the RTSP with teams is the problem of decomposing the complete graph into perfect matchings [22, 23, 24].
Next, we show that a decomposition of can be formed based on any rainbow near-perfect matching in . Letting vertex be a vertex not matched by ,
(4) |
is a feasible decomposition of . Another decomposition using the reversed RPM can be similarly constructed as
(5) |
Figure 5 shows a feasible schedule for teams (a decomposition of ) using method (4) based on the RPM in Figure 1(b).
The matchings, generated by method (4) or method (5), partition the edge set of into perfect matchings. Kirkman [25] first proposed this framework for scheduling round-robin tournaments. This approach uses a Kirkman matching in as
(6) |
We call a schedule generated from Kirkman matching a Kirkman schedule. Figure 5 shows a Kirkman schedule with 8 teams. A Kirkman matching has the following special properties:
Property 1.6.
A Kirkman matching in is an RPM if and only if or is odd.
Property 1.7.
For an RPM in the graph , if there exists such that , then there exists such that .
1.2 Normalization
Although Kirkman scheduling is popular for generating schedules for round-robin tournaments in European soccer leagues [26], it can produce unbalanced or unfair schedules [27, 28]. Other feasible solutions to the RTSP (non-Kirkman schedules) may thus be needed for the next scheduling stage. To obtain different solutions by using method (4) and method (5), we first design an algorithm that normalizes an RPM using reverse and rotate operations. Algorithm 1 shows details of this normalization. We first clockwise rotate the matching until edge meets (lines 1–4). We then check each edge in in ascending order of their color indexes. For the current edge , if , the normalization finishes and returns ; if , the normalization ends with the current (lines 5–12). The normalization procedure returns the current when all edges have been checked (line 13).
Properties 1.1 and 1.4 ensure that if is an RPM in the graph , the normalization is still an RPM. We call an RPM a normalized PRM (N-RPM) if .
Regarding N-RPMs in the graph , the following properties hold:
Property 1.8.
If two N-RPMs and are different, cannot be obtained from by using -rotate operators and reverse operators,
Property 1.9.
A Kirkman matching is an N-RPM.
2 Rainbow perfect matchings in with an even number of vertices
Letting be a nonnegative integer, we show the results of considering the following two cases:
-
•
or ;
-
•
or .
2.1 Non-existence of an RPM when or
We show the non-existence of RPM in the graph for any .
Theorem 2.1.
For any , no RPM exists in the graph if .
Proof.
We color all vertices in using a function : :
(7) |
First consider the case where . Function obtains black vertices and white ones in . Assume there exists an RPM in ; that is, is a matching in containing colors . According to the edge coloring in (1), edges with colors in occupy black vertices and white ones, because the endpoints of each edge are colored in different colors. The remaining edges in with colors consume an even number of vertices in both white and black, because the endpoints of each edge are same-colored. This contradicts the fact that numbers of white and black vertices in are both even.
A similar result holds for the case of , where using function in (7) obtains black vertices and white ones. Assume there exists an RPM in containing colors . The edges in with colors account for black vertices and white ones because the endpoints of each edge are differently colored. Edges colored in require an even number of both black and white vertices, because the endpoints of each edge are same-colored. This contradicts the fact that the numbers of white and black vertices in are both odd. ∎
2.2 Existence of an RPM when or
First consider the case where . The existence of an RPM is obvious because and are the RPMs in and , respectively. We then focus on and with . For such cases, we design the following matching in the graph :
(8) |
where
(9) | ||||
(10) | ||||
(11) | ||||
(12) |
Theorem 2.2.
For any or with , is an RPM in the graph .
Proof.
Tables 1 and 2 summarize the features of , , and from (9)–(11). The columns “vertices” and “colors” show the covered vertices and colors, respectively.
vertices | colors | size | ||
---|---|---|---|---|
vertices | colors | size | ||
---|---|---|---|---|
For the case where , Table 1 shows that , , and share neither vertices nor colors, and that vertices
and colors
remain unmatched. Edge set satisfies all the remaining requirements, so is an RPM.
For the case where , the same result that is an RPM can be obtained from Table 2 and the definition of . ∎
Figure 6 shows the examples of and .
3 Rainbow near-perfect matchings in with an odd number of vertices
Kirkman proposed Kirkman matching nearly 180 years ago. Property 1.6 indicates that an N-RPM exists in the graph with an odd number of vertices. However, even though multiple N-RPMs in the graph with an odd number of vertices are required in real-world applications, it has not been confirmed whether N-RPMs other than Kirkman matching exist.
In this section, we first show the existence of an RPM through what we call arch-recursive-slide (ARS) matching, whose N-RPM is different from the Kirkman matching when . We then propose an algorithm for generating multiple N-RPMs based on ARS matching.
3.1 Arch-recursive-slide (ARS) matching
In general, any odd number can be expressed as
(13) |
For the graph with an odd number of vertices, we define the ARS matching as
(14) |
where
(15) |
(16) |
(17) |
We show as an example. According to (15)–(16), we obtain
(18) |
(19) |
From recursive formulation (17), to obtain we must compute and beforehand, as
Thus, by using (17), we obtain as
(20) |
Finally, is formed by (18)–(20):
(21) |
The ARS matching is an RPM for the graph because the edges in (21) share no common vertices and cover all colors. Figure 7 shows and its corresponding N-RPM.
In this paper, we call an RPM in a cuttable RPM if
(22) |
holds. A necessary and sufficient condition for (22) is
(23) |
Note that Kirkman matching is not cuttable where , but for any , matchings
(24) |
are cuttable RPMs. Using this definition, we can prove that is an RPM:
Theorem 3.1.
For any odd number , ARS matching is an RPM in the graph .
Proof.
The proof is by mathematical induction. For any , let denote the statement that is a cuttable RPM for each .
Base step (): is true because according to (15)–(17)
Each of these is an RPM in the corresponding graph , all involving edges , satisfy .
Inductive step : Fix some , assuming that
Assumption 3.1.
for any , is a cuttable RPM.
To prove , we must show that for any , is a cuttable RPM in the graph . Table 3 summarizes the features of and according to (15)–(16), such as covered vertices (in the column “vertices”), covered colors (in the column “colors”), and size.
vertices | colors | ||||
---|---|---|---|---|---|
vertices | colors | ||||
Table 3 shows that and share neither common vertices nor colors. The values in the last column indicate that statement holds for all edges . Table 4 lists the unmatched vertices and colors to be considered in , and .
vertices | colors | ||
---|---|---|---|
From and Assumption 3.1, is a cuttable RPM for the graph , using distinct vertices in . Thus, , , , and constructed by (17) cover distinct vertices in the column “vertices” in Table 4.
We next show that all colors in the column “colors” are covered. Assumption 3.1 guarantees that
(25) |
so , , , and constructed by (17) cover all colors in the column “colors” in Table 4. Note that (25) also indicates that
holds for each in , , , and .
Therefore, for each , is an RPM in , and holds for all edges in . ∎
For , all RPMs in the graph are rooted from the same N-RPM. However, if , the N-RPM of ARS matching is different from Kirkman matching in the graph :
Property 3.1.
For any .
Proof.
From the definition of in (16), holds when . When or , edges and belong to . If we arrange vertices around a cycle in clockwise order, these two edges cross each other, and this cannot be changed by applying reverse and rotation operators. However, all edges in Kirkman matching are parallel, so the N-RPM of ARS matching is different from if or . For or , the same holds for edges and in . ∎
3.2 Generating many N-RPMs based on ARS matching
We showed in the previous subsection that the ARS matching is an RPM in if is odd. In this subsection, we propose a method for generating many N-RPMs, based on the idea that valid variants of lead to RPMs whose N-RPMs are different.
Given an RPM in where is odd, we consider the following functions and :
(26) | |||
(27) |
From Property 1.1, Property 1.4, and Theorem 3.1, , rev, and are RPMs in . Note that the four RPMs , , rev(), and are all cuttable, and each is rooted from the same N-RPM by Property 1.8.
We demonstrate how to generate many N-RPMs by example. In (21), we showed that is an RPM in . We used in constructing . If we use , rev and instead of when constructing , RPMs whose N-RPMs are different can be obtained for . Note that other cuttable RPMs such as and in (24) are also valid alternatives to .
Let denote
(28) |
We design a collection of RPMs in the graph as
(29) | ||||
(30) |
Using this method, we obtain different N-RPMs in the graph , where is odd.
The following confirms the size of in detail. For , we obtain from (29); For , we construct based on . Since , holds for . When or , since and hold for , based on has 2 elements. For the other , holds.
From the observations above, we can enumerate the size of as in Table 5, where values in the column “” were confirmed by computational experiments.
1 | |||
2 | |||
4 | |||
8 | |||
16 | |||
32 | |||
64 | |||
128 | |||
256 | |||
512 |
Acknowledgement
This work was supported by JSPS KAKENHI [Grant No.19K11843].
References
- [1] Michael R Garey and David S Johnson. Computers and intractability, volume 174. freeman San Francisco, 1979.
- [2] Guillem Perarnau and Oriol Serra. Rainbow perfect matchings in complete bipartite graphs: existence and counting. Combinatorics, Probability and Computing, 22(5):783–799, 2013.
- [3] María del Pilar Cano Vila, Guillem Perarnau, and Oriol Serra Albó. Rainbow perfect matchings in r-partite graph structures. Electronic notes in discrete mathematics, 54:193–198, 2016.
- [4] Matthew Coulson and Guillem Perarnau. Rainbow matchings in dirac bipartite graphs. Random Structures & Algorithms, 55(2):271–289, 2019.
- [5] Deepak Bal, Patrick Bennett, Xavier Pérez-Giménez, and Paweł Prałat. Rainbow perfect matchings and hamilton cycles in the random geometric graph. Random Structures & Algorithms, 51(4):587–606, 2017.
- [6] Deepak Bal and Alan Frieze. Rainbow matchings and hamilton cycles in random graphs. Random Structures & Algorithms, 48(3):503–523, 2016.
- [7] Guanghui Wang and Hao Li. Heterochromatic matchings in edge-colored graphs. the electronic journal of combinatorics, pages R138–R138, 2008.
- [8] Timothy D LeSaulnier, Christopher Stocker, Paul S Wenger, and Douglas B West. Rainbow matching in edge-colored graphs. The Electronic Journal of Combinatorics [electronic only], 17(1):v17i1n26–pdf, 2010.
- [9] Alexandr Kostochka and Matthew Yancey. Large rainbow matchings in edge-coloured graphs. Combinatorics, Probability and Computing, 21(1-2):255–263, 2012.
- [10] Allan Lo. Existences of rainbow matchings and rainbow matching covers. Discrete Mathematics, 338(11):2119–2124, 2015.
- [11] Guanghui Wang. Rainbow matchings in properly edge colored graphs. the electronic journal of combinatorics, pages P162–P162, 2011.
- [12] Jennifer Diemunsch, Michael Ferrara, Casey Moffatt, Florian Pfender, and Paul S Wenger. Rainbow matchings of sizedelta (g) in properly edge-colored graphs. arXiv preprint arXiv:1108.2521, 2011.
- [13] András Gyárfás and Gábor N Sárközy. Rainbow matchings and cycle-free partial transversals of latin squares. Discrete Mathematics, 327:96–102, 2014.
- [14] Ron Aharoni, Eli Berger, Maria Chudnovsky, David Howard, and Paul Seymour. Large rainbow matchings in general graphs. European Journal of Combinatorics, 79:222–227, 2019.
- [15] Jasine Babu, L Sunil Chandran, and Krishna Vaidyanathan. Rainbow matchings in strongly edge-colored graphs. Discrete Mathematics, 338(7):1191–1196, 2015.
- [16] Guanghui Wang, Guiying Yan, and Xiaowei Yu. Existence of rainbow matchings in strongly edge-colored graphs. Discrete Mathematics, 339(10):2457–2460, 2016.
- [17] Yangyang Cheng, Ta Sheng Tan, and Guanghui Wang. A note on rainbow matchings in strongly edge-colored graphs. Discrete Mathematics, 341(10):2762–2767, 2018.
- [18] Mikio Kano and Xueliang Li. Monochromatic and heterochromatic subgraphs in edge-colored graphs-a survey. Graphs and Combinatorics, 24(4):237–263, 2008.
- [19] Shinya Fujita, Atsushi Kaneko, Ingo Schiermeyer, and Kazuhiro Suzuki. A rainbow -matching in the complete graph with colors. the electronic journal of combinatorics, pages R51–R51, 2009.
- [20] Ruth Haas and Michael Young. The anti-ramsey number of perfect matching. Discrete Mathematics, 312(5):933–937, 2012.
- [21] Shinya Fujita, Colton Magnant, and Kenta Ozeki. Rainbow generalizations of ramsey theory: a survey. Graphs and Combinatorics, 26(1):1–30, 2010.
- [22] Dominique De Werra. Geography, games and graphs. Discrete Applied Mathematics, 2(4):327–337, 1980.
- [23] Dominique De Werra. Scheduling in sports. Studies on Graphs and Discrete Programming, 11:381–395, 1981.
- [24] Tiago Januario, Sebastián Urrutia, Celso C Ribeiro, and Dominique De Werra. Edge coloring: A natural model for sports scheduling. European Journal of Operational Research, 254(1):1–8, 2016.
- [25] T.P. Kirkman. On a problem in combinations. The Cambridge and Dublin Mathematical Journal, 2:191–204, 1847.
- [26] Dries R Goossens and Frits CR Spieksma. Soccer schedules in europe: an overview. Journal of scheduling, 15(5):641–651, 2012.
- [27] Ryuhei Miyashiro and Tomomi Matsui. Minimizing the carry-over effects value in a round-robin tournament. In Proceedings of the 6th International Conference on the Practice and Theory of Automated Timetabling, pages 460–463. PATAT, 2006.
- [28] Erik Lambrechts, Annette MC Ficker, Dries R Goossens, and Frits CR Spieksma. Round-robin tournaments generated by the circle method have maximum carry-over. Mathematical Programming, 172(1-2):277–302, 2018.