Indian Institute of Technology, Kanpur, India and [email protected] \CopyrightDebarsho Sannyasi \ccsdesc[100]G.2.2 Graph Theory \supplement\ArticleNo1
Improved Approximation Algorithms for
Weighted Edge Coloring of Graphs
Abstract
We study weighted edge coloring of graphs, where we are given an undirected edge-weighted general multi-graph with weights . The goal is to find a proper weighted coloring of the edges with as few colors as possible. An edge coloring is called a proper weighted coloring if the sum of the weights of the edges incident to a vertex of any color is at most one.
In the online setting, the edges are revealed one by one and have to be colored irrevocably as soon as they are revealed. We show that colors are enough when the maximum number of neighbors of a vertex over all the vertices is and where is the maximum over all vertices of the minimum number of unit-sized bins needed to pack the weights of the incident edges to that vertex. We also prove the tightness of our analysis. This improves upon the previous best upper bound of by Correa and Goemans [STOC 2004].
For the offline case, we show that for a simple graph with edge disjoint cycles, colors are sufficient and for a multi-graph tree, we show that colors are sufficient.
keywords:
Edge coloring, Bin packing, Clos networks, Online algorithms, Graph algorithms.category:
\relatedversion1 Introduction
Edge-coloring problem has been one of the foundational problems in graph theory and discrete mathematics since its appearance in 1880 [21] in connection with the four-color problem. In this paper, we study weighted edge coloring problem which generalizes both unweighted edge-coloring and classical bin packing problem. In the online version of the weighted edge coloring problem for general undirected multi-graphs, we are given a graph . At each instance, a new edge is revealed, and we need to assign a color to this edge at this instant itself. Colors assigned to edges can not be changed in future. Weight of each edge . Let be the maximum over all vertices of the minimum number of unit-sized bins needed to pack the weights of the incident edges to that vertex. We need to color the edges while maintaining the condition that the sum of weights of edges incident to a vertex and colored with same color must not exceed 1 at any moment. This is called a proper coloring of the graph. Our overall objective is to minimize the number of colors used.
The problem specially finds prominence in 3-stage Clos networks [7] which reduces to weighted edge coloring of bipartite graphs. We refer the reader to Correa and
Goemans [9] for detailed discussion of this reduction and connection with Clos networks.
For a given edge weighted undirected graph with all edge weights , consider the following notations which will be followed in this paper-
-
•
m :=
-
•
n :=
For the offline weighted edge coloring problem, Feige and Singh [11] proved a upper bound for bipartite graphs. Later Khan and Singh [18] proved an upper bound of for bipartite graphs. Khan [17] also showed that colors are sufficient when all items have weights . The current best lower bound for the offline version is for bipartite graphs. For online weighted edge coloring, Correa and Goemans [9] proved an upper bound of which improved upon by Gao and Hwang [13]. The best known lower bound for the online version is by Tsai, Wang, and Hwang [22].
1.1 Our contributions
We design a new algorithm for this problem and prove that colors are sufficient if the maximum number of neighbors of a vertex over all vertices is . This asymptotically improves upon the previous best [9]. We achieve this improvement using HARMONICM (with ) online bin packing algorithm [19] as a routine in our main algorithm. Most of the previous results, both in the offline and online settings used - instead. Along with that, we present an instance to show that our analysis is tight for our algorithm.
For the offline version of the problem, we prove that colors are sufficient for an undirected simple (no multi-edges between 2 vertices) graph with edge disjoint cycles and colors are sufficient for undirected multi-graph trees.
1.2 Related Works
When all the graph is a bipartite graph with only two vertices then the problem reduces to classical bin packing problem, which is well-studied in both offline [10, 16, 14] and online setting [3, 1, 2]. There are many other related generalizations of bin packing [5, 4, 12]. We refer the readers to [8, 6] for a survey on bin packing. For results on edge-coloring, we refer the readers to [20, 15].
2 Preliminaries
In our algorithms presented in this paper, we either use the NEXT-FIT or the online bin packing algorithms to assign colors to the edges. We present these subroutines briefly here along with few results which will be used in our analysis.
2.1 NEXT-FIT algorithm
- is an online bin packing algorithm in which items of weight arrive one by one and we need to fit it into an unit-sized bin at the instant of arriving itself. We fit items of size into unit-sized bins, in which at any instant we have a single open/active bin where we can place the incoming items. Also, let be the optimal number of unit-sized bins required for all the items known at hindsight. Let at an instant, item appear and we have an open bin . If fits into , then fit in . Else, close the bin and take a new fresh bin as the current open bin. Closed bins are never used again. Place into the new bin.
Lemma 2.1.
bins are sufficient using -.
Proof 2.2.
Let the current open bin be which already has weight in it and at this instant a new item of weight arrives. If a new bin is required for accommodating item , then we must have , else a new bin won’t be required. Let the new bin be . We then close the current bin and we fit the item in . The final weight in will be . So, the sum of weights in and is atleast . In the same way, in general the sum of final weights of any 2 consecutive bins is greater than 1. Now assume on contradiction, that at some instant, there is a requirement for opening the bin, then the total weight of all the items which have already arrived will be greater than , which is a contradiction.
2.2 HARMONICM algorithm
We refer reader to [19] to know more about HARMONICM algorithm. Essentially, here we have types/categories of items based on their size and at any instant we have open/active bins, one for each type to place the incoming items of that type. If the incoming item belongs to type , then it is placed in the bin designated for type items. If it can not be placed, then the current bin of type is closed and a new bin of type is formed and the item is placed in it. Any closed bins are never used again.
Lemma 2.3.
If , then bins are sufficient [19].
2.3 Definitions
Now we define some terminologies which we would use in our algorithms and their analysis. From now we always take if we talk about the algorithm which uses HARMONICM. Also, terms like bins and colors are used interchangeably. Coloring an edge with a color is analogous to fitting an item in a bin.
Definition 2.4.
(Simple graphs and Multi-graphs): An undirected graph is called a simple graph if there is atmost 1 edge between any pair of vertices. An undirected multi-graph can have multiple edges between any pair of vertices.
Definition 2.5.
(Open, Closed and Empty colors):
When using NEXT-FIT, we maintain a single active color between any pair of neighbouring vertices at all time. So, if a vertex has neighbours at an instant, then it will have active colors, one with each neighbour. This active color is also called the open color between a pair of neighbouring vertices. Let at an instant, an edge arrive between vertices and . We first try to color with the current open color between and . If it violates the condition of proper coloring, then we close the current open color between and and create a new open color between them. If is the first edge between and , then we introduce a new open color between them and assign that color to . The colors which are closed in this manner are called closed colors and they are never used again. We can say that all these colors are taken from a set/palette. Our main goal is to provide an upper bound to the sufficient size of the palette. Colors which are neither open nor closed are called empty colors. Empty colors are part of the palette and act like candidates for being an open color in the future.
When using HARMONICM, the definitions are very similar as above. The only change is that now at any instant, between any two neighbouring vertices, we have open colors between them corresponding to each type/category instead of just 1 open color as in NEXT-FIT. So, if a vertex has neighbours at an instant, then it will have active colors, with each neighbour. Let at an instant, edge arrive which is a type edge. We first try to color with the type open color between and . If this violates the condition for proper coloring, then we close the type color between and and introduce a new type color between and . If edge is the first type edge between and , then we introduce a type color between and in order to color the edges of type between and .
3 Online Weighted Edge Coloring
Reiterating the online Weighted edge coloring problem, let be the underlying undirected multi-graph. Each edge appear/arrive one by one in an online manner. Each edge has weight . is the maximum over all vertices of the minumum number of unit-sized bins needed to pack the weights of the incident edges to that vertex. At an instant, let edge of weight arrive. We need to color such that the invariant/condition that sum of weights of edges incident to any vertex and colored with the same color must not exceed is maintained at all times. We wish to find an upper bound for the sufficient number of colors required for the above procedure. Essentially, we present algorithms. One uses NEXT-FIT online bin packing procedure in which we show that colors are enough, where is the maximum number of neighbors of a vertex over all vertices. The other algorithm uses HARMONICM online bin packing procedure in which we show that colors are enough (taking ), definition of being the same. So, if we can achieve an asymptotic competitive ratio of and respectively beating the previous best 5 as mentioned before. In our analysis we take value of to be . As we will see both the algorithms and their analysis are very similar.
3.1 Algorithm
We first present our algorithm which uses -. Let be the maximum number of neighbours of a vertex over all vertices. We have a palette of colors numbered from 1 to .
Now we present our algorithm which uses . Let be the maximum number of neighbours of a vertex over all vertices. We have a palette of colors numbered from 1 to . This algorithm is very similar to the previous algorithm. The only difference is that now we have types/categories of edges based on its weight which we have to take into account. For each type we have an open color between a pair of neighbouring vertices.
In the next section, we would prove that palette size of and is sufficient for the algorithms using - and respectively.
3.2 Analysis
Consider the following lemmas.
Lemma 3.1.
In an online bin packing instance, if we partition all items into non-empty types, and introduce a requirement that two items of different types cannot be packed in a single bin, then bins are sufficient using NEXT-FIT. Also, at all times, we have exactly open bins, thus there can be at most closed bins at any instant.
Proof 3.2.
Assign open bins at the start, named , where bin would accommodate items of type . On the arrival of an item of type , if the current bin is unable to fit the item, then close the bin , and replace it with another new bin, which will now be named . Place the item in this new bin of type . Carry on this procedure for all items.
At last there will be open bins, and the number of closed bins will be . Otherwise, if number of closed bins is , then it would be a contradiction to the bound guaranteed by Lemma 2.1. This is because here we are essentially following the same rules as standard NEXT-FIT, the only difference is upon arrival of an item of type , we are checking the bin instead of a common open bin for all items in standard NEXT-FIT. Using the standard NEXT-FIT, first produce the items of type 1, then type 2 and so on till type . So, if closed bins are required, then in this case also will be required contradicting Lemma 2.1.
Thus, overall we need at most different bins for all items under this scenario. In other words, at most closed bins as we have exactly open bins.
Corollary 3.3.
Let be the maximum number of neighbors of a vertex over all vertices of . Now we will first present the analysis for the algorithm which uses - and prove our claim that colors are sufficient. The bound using would easily follow by just replacing with and with in the following analysis.
Lemma 3.4.
For any vertex of the graph, the number of closed bins used by is at most at any instant.
Proof 3.5.
The number of open bins is clearly at most because has at most neighbours. So, specifically, we need to show that number of closed bins used by is at most . Actually, this follows directly from Lemma 3.1. We can relate the types in Lemma 3.1 with neighbours here, and the items with the edges.
We will prove it by contradiction. Let at an instant, edge incident to arrive which causes it’s bin to close in order to fit edge . The claim is that such an instant can occur. Let suppose such an incident indeed occur. Now, take all the items which were previously packed in the closed bins and the item . Then, imagine producing all these items (i.e. edges) in the same order as they arrive in the original graph scenario, and try to pack these items using NEXT-FIT along with the condition that there are types (corresponding to neighbour vertices) and items of 2 different types cannot be placed together. We would then have to close the when the item arrives leading to closed bins, which is a contradiction to Lemma 3.1.
Now we arrive at our main theorem.
Theorem 3.6.
For online edge arrival scenario of proper weighted coloring of graphs, colors are sufficient using (with ) and colors are sufficient using - algorithm for a proper coloring solution. is the maximum number of neighbours over all the vertices of the graph and is the maximum over all vertices of minimum number of bins required to pack all edges incident to a vertex such that sum of weights packed in each bin .
Proof 3.7.
When using NEXT-FIT, let at an instant, edge arrive, and let = number of closed bins used by and = number of closed bins used by and let bin be the current open bin between and , all just before arrival of edge .
If edge is able to fit in bin , then fit edge in bin and continue. Else, close bin . Replace it with a new bin and fit edge in the new bin.
Now, we need to prove that if we have a palette of colors, then the new bin can be found from this palette without any violations. In other words, colors are sufficient. From Lemma 3.4, we have and . Vertex has at most open bins and vertex has at most open bins just before arrival of . So, just before arrival of , the sum of closed and open bins for both vertices and is (It is indeed because of the common open bin between and ). So, given our pool of colors, we will always be able to find a new color without any violations to either vertices. Also, and are the only vertices where a violation can occur at this step and thus we care about only these.
If a new bin is selected, then and both increments by but the number of open bins for both remains at most . Though and increase by , it is guaranteed that they never reach . Because it would be a violation to Lemma 3.4 as then , contradicting Lemma 3.4.
In other words, the above arguments imply that if a specific vertex has closed bins, then none of it’s open bins will be forced to close. Because a bin is closed only when another new bin in opened and thus leading to a contradiction of Lemma 3.4.
Finally, we can say that colors are enough (indeed colors are enough). The bound directly follows for (with ) with the exact same arguments as above, just replace with and with . Also as described in Algorithm 2, take into account the type of edge arriving. An edge of type must be fit into the open bin of type between and .
Corollary 3.8.
From Theorem 3.6 we get, if , we have a competitive ratio of using (with ) and using -.
In other words, the new best asymptotic competitive ratio is , an improvement over previous best of .
3.3 Tightness of Analysis
The number is the greatest lower bound for the worst-case performance ratio of any -space online bin packing algorithm [19]. For , the best bound is [19]. Now, we would be constructing an example where at least colors are required when using our coloring algorithm with . In other words, where the competitive ratio is . is chosen for simplicity in expressing the procedure, else following the below construction idea, competitive ratio very close to can be achieved by increasing the value of .
Choose positive integers and such that , , and are integers. One thing to note here is that on the arrival of an edge , if can not fit in the current open bin between and , then the algorithm should provide a deterministic way of choosing the next open bin between them. The way is that the algorithm chooses the least numbered bin possible as the next new open bin between and . Below are the steps of construction of the tight example taking .
-
•
Let and be the first two vertices. Introduce edges only between them such that the number of closed bins for them be . Choose these bins in a contiguous manner starting from the first bin. This can be achieved because we have the bound equal to as stated above. Also note that due to the lower bound, the number of closed bins for a vertex can be at least up to . (may be even more depending upon the value of ).
-
•
Like this form another pairs of vertices and for . So, now we have pairs of vertices, with each pair having the first bins as closed bins between them.
-
•
Now we introduce a new vertex with multiple edges between vertices and such that the number of closed bins needed by is . Now can not choose these bins from the first bins as then it would create a clash with vertex . So, chooses bins from to . Then, introduce multiple edges between vertices and such that closed bins are required. With similar reasoning as before, chooses these bins to be from to . Then, introduce multiple edges between vertices and such that closed bins are required. With similar reasoning as before, chooses these bins to be from to . Carry on this procedure for all for .
-
•
Thus now vertex has used bins from to . So, in total bins are used in the whole algorithm leading to a competitive ratio of (because ).
Note that here the number of neighbours of . Also, is chosen so that we don’t care about the open bins between any pair of neighbour vertices in any of the above steps.
4 Offline Weighted Edge Coloring
In the offline version of the problem, we are given the whole undirected graph upfront. We need to assign colors to each edge maintaining the condition of proper coloring. The current best upper bound is given by Khan and Singh [18] for bipartite graphs. We will present improved algorithms with better upper bounds for some special graphs.
4.1 Simple graph with edge disjoint cycles
Theorem 4.1.
Given an undirected simple graph (no multi-edges between 2 vertices) with edge disjoint cycles, it can colored using colors.
Proof 4.2.
We have a palette of colors numbered from 1 to . Consider a simpler example where we are given an undirected simple graph with no cycles that is is a undirected simple tree. Let vertex be the root vertex (if not given, choose any vertex as ). We will traverse in a BFS manner starting from the root node . Whenever visiting a node , we will color the edges incident to it.
Consider any step of this traversal where we visit node . Let the child nodes of be and let be the parent node of (if ). As we are traversing in a BFS manner, the edge must have been already colored and none of the edges are colored (which we have to color in this step). So, with respect to , its only one of the incident edges have been colored. So, by the definition of , all the remaining edges incident to can be colored taking at most colors in total from palette . This will not create any violations in any of the child nodes, as only one of the edges of each child node is colored in this step. Carry on this procedure for each node visited and eventually we have colored all the edges of the tree. Thus, we can properly color a undirected simple tree in colors.
Now if we also have edge disjoint cycles, then this case is very similar to the above. The only difference is that when visiting a node , it might happen that two of its edges have already been assigned different colors. But it might happen that the optimal packing of edges incident to in unit-sized bins assign same colors to these two already colored edges or vice-versa. It might also happen that when we color the edges between the current vertex and any of its child node, a clash might occur at the child node. This is because now 2 edges of a child node may be colored before visiting that child node which may create a violation. Thus we place an extra color in palette to overcome this violation. Thus, colors are sufficient in this case.
This result can be further generalised. If we are given an undirected simple graph . Let be the maximum number of cycles an edge is a part of taken over all the edges. Then while traversing the graph in a BFS manner, it may happen that edges have already been colored. So, in the worst case scenario, we would require colors for properly coloring all the edges in this case.
4.2 Multi-graph tree
Theorem 4.3.
Given an undirected multi-graph tree , it can be properly colored using colors using NEXT-FIT and using colors using HARMONICM (with ). Below we present the algorithms and their analysis.
Proof 4.4.
Let be the root vertex (assign any of the vertex as root vertex randomly if not specified). Below we present the algorithms achieving the above upper bounds along with their analysis. The algorithm starts from the root vertex and visits all the nodes in a BFS manner. When visiting a node, it colors the edges incident to it.
First let us consider when we use NEXT-FIT. Let there be a palette having colors numbered from 1 to . Whenever a new color is required from , we chose the least numbered color which does not create any violations. We claim that the size of is sufficient to properly color all the edges. When visiting a node . Let the child nodes of be and let vertex be the parent node of if is not the root vertex. As we are traversing in a BFS manner, none of the edges between and its child node will be colored (they have to be colored in this step) whereas the edges between and parent node must have already been colored when was visited.
We will color the edges between and its child nodes in a specific order in which we consider one child node at a time and color the edges between them. First color the edges between and in a NEXT-FIT manner. This means that at any moment there is an active/open color between and and present the edges between them in an online fashion (though we have all the edges beforehand) and color them using NEXT-FIT. As the edges between and have already been colored, let the colors used for them be numbered from to . Note that it would a continuous range of colors due to the way we are coloring the edges each child node at a time, and the way of choosing the new color when required from palette . Keep as the initial open color between and and carry on the procedure as explained above. When all the edges between and have been colored, let the colors used for this be numbered from to . Now move on to the next child node with as the initial open color between them. Carry on the this procedure for all the child nodes of .
We claim that if the above algorithm is followed, then the number of colors used by will be atmost which are taken from palette without creating any violations. This can be seen with the help of Lemma 2.1. Lemma 2.1 claims that when items are presented in an online manner and we pack them using NEXT-FIT, then atmost bins are required. It is an easy observation that we are doing the same thing here when visiting vertex . The items are the edges and the bins are the colors. As is the parent node of , must have been visited earlier than . At that step when considering the edges between and , following the above algorithm, these edges are presented in an online manner and colored using NEXT-FIT. So, when we visit in the current step, some of its edges have already been colored using NEXT-FIT, and now we color the remaining incident edges again using NEXT-FIT. Thus, the overall effect with respect to is that all its incident edges are colored in a NEXT-FIT manner thus taking atmost colors. The term is there because the first color ( in the above example) might not be fully utilized with respect to . This holds true for any node visited during BFS traversal. And thus by induction, all the edges of can be colored properly using only the colors from palette .
Finally for the case when we use (with ), the algorithm and analysis is very similar to the above. The only differences are that now we follow packing, by taking into consideration the types of items/edges. So, at any moment there would be open bins instead of just 1, each corresponding to a unique type. From Lemma 2.3, the upper bound guarantee is . So, the palette size of will be sufficient for properly coloring all the edges without any violations. Below we present both the algorithms in a concise form.
5 Conclusion
-
•
In all the algorithms above, we have used either NEXT-FIT or . The only differences between them is that there is a single open bin/color in case of NEXT-FIT whereas there are 12 open bins/colors in case of each for each type of items. Due to this distinction, the upper bound guarantees are different as we saw in Lemma 2.1 and Lemma 2.3. Because of this the algorithms and their analysis when using both are very similar. We just need to take into consideration the type of items when using and we replace the upper bound with in the analysis along with replacing open color with open colors at any moment.
-
•
Note that the weighted edge coloring problem with its condition of proper coloring is a kind of global constraint as for a connected component, assigning a color to an edge might depend on or might affect the colors assigned to edges incident to some distant vertex. But in the above algorithms, we just considered any arbitrary step, and we show that there won’t be any violations in that step for which we only have to consider the local neighbourhood. Then as this is true for any step, there is no violations occurring in the whole algorithm by induction.
-
•
In Section 3, we presented better upper bounds for offline weighted edge coloring using online bin packing algorithms like NEXT-FIT and . Thus, though its an offline problem, still online heuristics can help to come up with better bounds.
6 Acknowledgment
The author wants to thank Prof. Arindam Khan, IISc Bangalore, for his continuous support, guidance and regular feedback.
References
- [1] Susanne Albers, Arindam Khan, and Leon Ladewig. Improved online algorithms for knapsack and GAP in the random order model. In APPROX/RANDOM, pages 22:1–22:23, 2019.
- [2] Susanne Albers, Arindam Khan, and Leon Ladewig. Best fit bin packing with random order revisited. In MFCS, pages 7:1–7:15, 2020.
- [3] János Balogh, József Békési, György Dósa, Leah Epstein, and Asaf Levin. A new and improved algorithm for online bin packing. In ESA, pages 5:1–5:14, 2018.
- [4] Nikhil Bansal, Marek Eliás, and Arindam Khan. Improved approximation for vector bin packing. In SODA, pages 1561–1579, 2016.
- [5] Nikhil Bansal and Arindam Khan. Improved approximation algorithm for two-dimensional bin packing. In SODA, pages 13–25, 2014.
- [6] Henrik I. Christensen, Arindam Khan, Sebastian Pokutta, and Prasad Tetali. Approximation and online algorithms for multidimensional bin packing: A survey. Computer Science Review, 24:63–79, 2017.
- [7] Charles Clos. A study of non-blocking switching networks. Bell System Technical Journal, 32(2):406–424, 1953.
- [8] Edward G Coffman, János Csirik, Gábor Galambos, Silvano Martello, and Daniele Vigo. Bin packing approximation algorithms: survey and classification. In Handbook of combinatorial optimization, pages 455–531. Springer New York, 2013.
- [9] José R Correa and Michel X Goemans. Improved bounds on nonblocking 3-stage clos networks. SIAM Journal on Computing, 37(3):870–894, 2007.
- [10] W Fernandez De La Vega and George S. Lueker. Bin packing can be solved within 1+ in linear time. Combinatorica, 1(4):349–355, 1981.
- [11] Uriel Feige and Mohit Singh. Edge coloring and decompositions of weighted graphs. In European Symposium on Algorithms, pages 405–416. Springer, 2008.
- [12] Waldo Gálvez, Fabrizio Grandoni, Afrouz Jabal Ameli, Klaus Jansen, Arindam Khan, and Malin Rau. A tight (3/2+) approximation for skewed strip packing. In APPROX/RANDOM, pages 44:1–44:18, 2020.
- [13] Biao Gao and Frank K Hwang. Wide-sense nonblocking for multirate 3-stage clos networks. Theoretical Computer Science, 182(1-2):171–182, 1997.
- [14] Rebecca Hoberg and Thomas Rothvoss. A logarithmic additive integrality gap for bin packing. In SODA, pages 2616–2625, 2017.
- [15] Tommy R Jensen and Bjarne Toft. Graph coloring problems, volume 39. John Wiley & Sons, 2011.
- [16] Narendra Karmarkar and Richard M Karp. An efficient approximation scheme for the one-dimensional bin-packing problem. In FOCS, pages 312–320, 1982.
- [17] Arindam Khan. Approximation algorithms for multidimensional bin packing. PhD thesis, Georgia Institute of Technology, Atlanta, GA, USA, 2016.
- [18] Arindam Khan and Mohit Singh. On weighted bipartite edge coloring. In FSTTCS, pages 136–150, 2015.
- [19] Chan C Lee and Der-Tsai Lee. A simple on-line bin-packing algorithm. Journal of the ACM (JACM), 32(3):562–572, 1985.
- [20] Michael Stiebitz, Diego Scheide, Bjarne Toft, and Lene M Favrholdt. Graph edge coloring: Vizing’s theorem and Goldberg’s conjecture, volume 75. John Wiley & Sons, 2012.
- [21] Peter Guthrie Tait. Remarks on the colouring of maps. In Proc. Roy. Soc. Edinburgh, volume 10, pages 501–503, 1880.
- [22] Kuo-Hui Tsai, Da-Wei Wang, and Frank Hwang. Lower bounds for wide-sense nonblocking clos network. Theoretical computer science, 261(2):323–328, 2001.