encyclopegia.org

Recursive largest first algorithm

The Recursive Largest First (RLF) algorithm is a heuristic for the NP-hard graph coloring problem. 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 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, 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.

The Recursive Largest First (RLF) algorithm is a heuristic for the NP-hard graph coloring problem. 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 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, 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. ==Description== The algorithm can be described by the following three steps. At the end of this process, \mathcal{S} gives a partition of the vertices representing a feasible |\mathcal{S}| -colouring of the graph G . Let \mathcal{S}=\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 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{S}=\mathcal{S}\cup \{S\} 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 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{S} = \{\{g\}, \{a, c, e\}, \{b, d, f\}\} . ==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{O}(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{O}(m) time, meaning that the overall complexity of RLF is \mathcal{O}(mn) . If the heuristics of Step 2 are replaced with random selection, then the complexity of this algorithm reduces to \mathcal{O}(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, 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{O}(n+m) greedy algorithm and the \mathcal{O}((n + m) \lg n) DSatur algorithm on random graphs. However, runtimes with RLF were also seen to be higher than these alternatives due to its higher overall complexity. ==References== ==External links== GCol An open-source python library for graph coloring featuring RLF. 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).

References

No reference rows published for this article.

Cite this article

MLA

"Recursive largest first algorithm." encyclopegia.org, 2026, https://encyclopegia.org/wiki/recursive-largest-first-algorithm. Accessed 24 November 2026.

Chicago

"Recursive largest first algorithm." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/recursive-largest-first-algorithm.

APA

encyclopegia.org. (2026). Recursive largest first algorithm. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/recursive-largest-first-algorithm

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

List of largest spherical buildings

enwiki · references available

Tokinsko-Stanovoy National Park

enwiki · references available

Sheekey

enwiki · references available

Steve Gilbert (American football)

enwiki · references available

Proeumicrotremus

enwiki · references available

Tufuvai

enwiki · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1369839455 · 0.5 · snapshot enwiki-001369839455

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.