HOME

TheInfoList



OR:

The Recursive Largest First (RLF) algorithm is a
heuristic A heuristic (; ), or heuristic technique, is any approach to problem solving or self-discovery that employs a practical method that is not guaranteed to be optimal, perfect, or rational, but is nevertheless sufficient for reaching an immediat ...
for the
NP-hard In computational complexity theory, NP-hardness ( non-deterministic polynomial-time hardness) is the defining property of a class of problems that are informally "at least as hard as the hardest problems in NP". A simple example of an NP-hard pr ...
graph coloring problem In graph theory, graph coloring is a special case of graph labeling; it is an assignment of labels traditionally called "colors" to elements of a graph subject to certain constraints. In its simplest form, it is a way of coloring the vertices o ...
. It was originally proposed by Frank Leighton in 1979. The RLF algorithm assigns colors to a graph’s vertices by constructing each color class one at a time. It does this by identifying a
maximal independent set In graph theory, a maximal independent set (MIS) or maximal stable set is an independent set that is not a subset of any other independent set. In other words, there is no vertex outside the independent set that may join it because it is maxim ...
of vertices in the graph, assigning these to the same color, and then removing these vertices from the graph. These actions are repeated on the remaining subgraph until no vertices remain. To form high-quality solutions (solutions using few colors), the RLF algorithm uses specialized heuristic rules to try to identify "good quality" independent sets. These heuristics make the RLF algorithm exact for bipartite,
cycle Cycle, cycles, or cyclic may refer to: Anthropology and social sciences * Cyclic history, a theory of history * Cyclical theory, a theory of American political history associated with Arthur Schlesinger, Sr. * Social cycle, various cycles in so ...
, and wheel graphs. In general, however, the algorithm is approximate and may well return solutions that use more colors than the graph’s
chromatic number In graph theory, graph coloring is a special case of graph labeling; it is an assignment of labels traditionally called "colors" to elements of a graph subject to certain constraints. In its simplest form, it is a way of coloring the vertices o ...
.


Description

The algorithm can be described by the following three steps. At the end of this process, \mathcal gives a partition of the vertices representing a feasible , \mathcal, -colouring of the graph G. # Let \mathcal=\emptyset be an empty solution. Also, let G=(V,E) be the graph we wish to color, comprising a vertex set V and an edge set E. # Identify a
maximal independent set In graph theory, a maximal independent set (MIS) or maximal stable set is an independent set that is not a subset of any other independent set. In other words, there is no vertex outside the independent set that may join it because it is maxim ...
S\subseteq V. To do this: ## The first vertex added to S should be the vertex in G that has the largest number of neighbors. ## Subsequent vertices added to S should be chosen as those that (a) are not currently adjacent to any vertex in S, and (b) have a maximal number of neighbors that are adjacent to vertices in S. Ties in condition (b) can be broken by selecting the vertex with the minimum number of neighbors not in S. Vertices are added to S in this way until it is impossible to add further vertices. # Now set \mathcal=\mathcal\cup \ and remove the vertices of S from G. If G still contains vertices, then return to Step 2; otherwise end.


Example

Consider the graph G=(V,E) shown on the right. This is a
wheel graph A wheel is a circular component that is intended to rotate on an axle bearing. The wheel is one of the key components of the wheel and axle which is one of the six simple machines. Wheels, in conjunction with axles, allow heavy objects to be ...
and will therefore be optimally colored by RLF. Executing the algorithm results in the vertices being selected and colored in the following order: # Vertex g (color 1) # Vertex a, c, and then e (color 2) # Vertex b, d, and then f (color 3) This gives the final three-colored solution \mathcal = \.


Performance

Let n be the number of vertices in the graph and let m be the number of edges. Using big O notation, in his original publication Leighton states the complexity of RLF to be \mathcal(n^3); however, this can be improved upon. Much of the expense of this algorithm is due to Step 2, where vertex selection is made according to the heuristic rules stated above. Indeed, each time a vertex is selected for addition to the independent set S, information regarding the neighbors needs to be recalculated for each uncolored vertex. These calculations can be performed in \mathcal(m) time, meaning that the overall complexity of RLF is \mathcal(mn). If the heuristics of Step 2 are replaced with random selection, then the complexity of this algorithm reduces to \mathcal(n+m); however, the resultant algorithm will usually return lower quality solutions compared to those of RLF. It will also now be inexact for bipartite,
cycle Cycle, cycles, or cyclic may refer to: Anthropology and social sciences * Cyclic history, a theory of history * Cyclical theory, a theory of American political history associated with Arthur Schlesinger, Sr. * Social cycle, various cycles in so ...
, and wheel graphs. In an empirical comparison by Lewis in 2021, RLF was shown to produce significantly better vertex colorings than alternative heuristics such as the \mathcal(n+m)
greedy algorithm A greedy algorithm is any algorithm that follows the problem-solving heuristic of making the locally optimal choice at each stage. In many problems, a greedy strategy does not produce an optimal solution, but a greedy heuristic can yield locall ...
and the \mathcal((n + m) \lg n)
DSatur DSatur is a graph colouring algorithm put forward by Daniel Brélaz in 1979. Similarly to the greedy colouring algorithm, DSatur colours the vertices of a graph one after another, adding a previously unused colour when needed. Once a new vertex ...
algorithm on
random graphs In mathematics, random graph is the general term to refer to probability distributions over graphs. Random graphs may be described simply by a probability distribution, or by a random process which generates them. The theory of random graphs ...
. However, runtimes with RLF were also seen to be higher than these alternatives due to its higher overall complexity.


References

{{reflist


External links


''High-Performance Graph Colouring Algorithms''
Suite of graph coloring algorithms (implemented in C++) used in the book
A Guide to Graph Colouring: Algorithms and Applications
' (Springer International Publishers, 2021). 1979 in computing Graph algorithms Graph coloring