arXiv:2610.39753cs.DSOct 2026

Manuscript Offprint

arXiv:2610.39753

Four-Coloring Planar Graphs in Linear Time

Yuta Inoue, Ken-ichi Kawarabayashi, Atsuyuki Miyashita, Bojan Mohar, Carsten Thomassen, Mikkel Thorup

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The famous Four Color Theorem (4CT) states that any planar graph can be colored with four colors, but how do we find a 4-coloring? In our previous paper [FOCS'26], we presented a simple combinatorial algorithm to 4-color planar graphs in O(nlog⁡n)O(n \log n) time. We improve it here to O(n)O(n) time, which is optimal.

The algorithm from our previous paper is based on proving that every planar triangulation has a linear number of reducible configurations or obstructing cycles. The bottleneck for the algorithm is that we need O(log⁡n)O(\log n) Kempe changes to extend a recursive 4-coloring to the reducible configurations. Each Kempe change can involve a constant fraction of the graph and takes linear time.

Here we show that all O(log⁡n)O(\log n) Kempe changes can be identified and implemented in O(n)O(n) time. The idea is to spend O(n)O(n) time to preprocess the graph so that we can identify and simulate each good Kempe change in O(n/log⁡n)O(n/\log n) amortized time. Thus, we implement all O(log⁡n)O(\log n) Kempe changes in O(n)O(n) total time. Based on this, we implement the whole 4-coloring in linear time.

We note that creating such a representation for fast identification and simulation of the right Kempe changes is a challenge of data structures, unlike the previous paper that builds on a new graph theoretic understanding of reducible configurations.

*The University of Tokyo, Tokyo, Japan, yutainoue@is.s.u-tokyo.ac.jp.

Supported by JSPS Kakenhi 26K21777 and JP25K24465, by JST ASPIRE JPMJAP2302, and by Hirose Foundation Scholarship.

†^{\dagger}National Institute of Informatics & The University of Tokyo, Tokyo, Japan, k_keniti@nii.ac.jp.

Supported by Alexander von Humboldt Foundation (Humboldt Research Award), JSPS Kakenhi 26K21777 and JP25K24465, and by JST ASPIRE JPMJAP2302.

‡^{\ddagger}The University of Tokyo, Tokyo, Japan, miyashita-atsuyuki869@is.s.u-tokyo.ac.jp.

Supported by JSPS Kakenhi 26K21777 and JP25K24465, by JST ASPIRE JPMJAP2302, and by JSPS KAKENHI 26KJ0817.

§^{§}Simon Fraser University, Burnaby, BC, Canada & FMF, University of Ljubljana, Slovenia, mohar@sfu.ca.

Supported in part by NSERC Discovery Grant R832714 (Canada), by the ERC Synergy grant (European Union, ERC, KARST, project number 101071836), and by the Research Project N1-0218 of ARIS (Slovenia).

9^{9}Technical University of Denmark, ctho@dtu.dk

1^{1}University of Copenhagen, Denmark, mikkel2thorup@gmail.com.

Supported by VILLUM Foundation grant 54451, Basic Algorithms Research Copenhagen (BARC).

1 Introduction

The celebrated Four Color Theorem (4CT) was conjectured by Francis Guthrie in 1852 (see [14, 20] for some of the early history), and remained open for more than 100 years, until Appel and Haken found a proof [2, 4] in 1976. The theorem states that every planar map or graph with no loops can be colored with four colors. So 4-coloring is always possible, but how do we 4-color a concrete planar graph? There is no easy answer. In fact, historically, it has been so complicated that it has led to many proposed counterexamples to 4CT.

Robertson, Sanders, Seymour, and Thomas [17, 18] found a simpler proof and proved in 1997 that a 4-coloring can be found in quadratic time.

In a preceding paper [9], we proved that 4-coloring can be done in O(nlog⁡n)O(n \log n) time. In this paper, we show how to do it in linear time, that is,

Theorem 1 We can 4-color a planar graph of order n in O(n)O(n) time.

This optimal time bound builds on the graph-theoretic results from [9] which yielded a combinatorial O(nlog⁡n)O(n \log n) time solution. Our improvement to O(n)O(n) time is based on a new efficient data structure. More precisely, we use the word RAM model with word length Θ(log⁡n)\Theta(\log n). The unit-cost operations are the standard AC0AC^0 operations available in an imperative programming language such as C [12]: direct and indirect addressing, conditional jump, addition, bitwise Boolean operations, and shifts (called the Practical RAM in [15]).