Diameter of the inversion graph

Frédéric Havet, Florian Hörsch, Clément Rambaud

► To cite this version:

Frédéric Havet, Florian Hörsch, Clément Rambaud. Diameter of the inversion graph. 2024. hal-04819261

HAL Id: hal-04819261

https://inria.hal.science/hal-04819261v1

Preprint submitted on 4 Dec 2024

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Diameter of the inversion graph

Frédéric Havet¹, Florian Hörsch², and Clément Rambaud¹

¹Université Côte d'Azur, CNRS, Inria, I3S, Sophia Antipolis, France

²CISPA, Saarbrücken, Germany

**Abstract**

In an oriented graph $\vec{G}$, the inversion of a subset $X$ of vertices consists in reversing the orientation of all arcs with both endvertices in $X$. The inversion graph of a labelled graph $G$, denoted by $\mathcal{I}(G)$, is the graph whose vertices are the labelled orientations of $G$ in which two labelled orientations $\vec{G}_1$ and $\vec{G}_2$ of $G$ are adjacent if and only if there is an inversion $X$ transforming $\vec{G}_1$ into $\vec{G}_2$. In this paper, we study the inversion diameter of a graph which is the diameter of its inversion graph denoted by $\text{diam}(\mathcal{I}(G))$. We show that the inversion diameter is tied to the star chromatic number, the acyclic chromatic number and the oriented chromatic number. Thus a graph class has bounded inversion diameter if and only if it also has bounded star chromatic number, acyclic chromatic number and oriented chromatic number. We give some upper bounds on the inversion diameter of a graph $G$ contained in one of the following graph classes: planar graphs ($\text{diam}(\mathcal{I}(G)) \le 12$), planar graphs of girth 8 ($\text{diam}(\mathcal{I}(G)) \le 3$), graphs with maximum degree $\Delta$ ($\text{diam}(\mathcal{I}(G)) \le 2\Delta - 1$), graphs with treewidth at mots $t$ ($\text{diam}(\mathcal{I}(G)) \le 2t$).

We also show that determining the inversion diameter of a given graph is NP-hard.

**Keywords:** inversion graph; diameter; orientation; reconfiguration.

# 1 Introduction

The concept of inversion was defined by Belkhechine et al. in [BBBP10] as follows. In an oriented graph $\vec{G}$, if $X$ is a set of vertices of $\vec{G}$, the **inversion** of $X$ consists in reversing the orientation of all arcs with both endvertices in $X$. In particular, the reversal of a single arc is an inversion. Belkhechine et al. in [BBBP10] studied the **inversion number**, denoted by $\text{inv}(D)$, which is the minimum number of inversions that transform $\vec{G}$ into a directed acyclic graph. In particular, they proved that for every fixed $k$, determining whether a given tournament $T$ has inversion number at most $k$ is polynomial-time solvable. In contrast, Bang-Jensen et al. [BdSH21] proved that deciding whether a given oriented graph has inversion number 1 is NP-complete. The maximum $\text{inv}(n)$ of the inversion numbers of all oriented graphs of order $n$ has also been investigated. Independently, Aubian et al. [AHH+22] and Alon et al. [APS+24] proved $n - 2\sqrt{n \log n} \le \text{inv}(n) \le n - [\log(n+1)]$. Recently Duron et al. [DHHR23] studied the minimum number of inversions to make a digraph $k$-arc-strong or $k$-strong.

In this paper, we study the maximum number of required inversions to transform an orientation of a given graph into another orientation of this graph. Formally, let $G$ be a graph with vertices labelled $v_1, \dots, v_n$. The **(labelled) inversion graph** of $G$, denoted by $\mathcal{I}(G)$, is the graph whose vertices are the labelled orientations of $G$ in which two labelled orientations $\vec{G}_1$ and $\vec{G}_2$ of $G$ are adjacent if and only if there is an inversion $X$ transforming $\vec{G}_1$ into $\vec{G}_2$. The **(labelled) inversion diameter** of $G$ is the diameter of $\mathcal{I}(G)$, denote by $\text{diam}(\mathcal{I}(G))$. We prove various bounds on $\text{diam}(\mathcal{I}(G))$ depending on the structure of $G$.

We first determine the maximum inversion diameter over all graphs on $n$ vertices.

**Theorem 1.1.** Let $G$ be a graph on $n$ vertices. Then $\text{diam}(\mathcal{I}(G)) \le n - 1$.

This bound is tight for complete graphs (Theorem 2.3).
For sparser graphs, one can expect much better bounds. Actually, we characterise classes of graphs having bounded inversion diameter. Indeed, we prove that the inversion diameter is tied<fnref n="1" /> to some well-studied parameters, namely the star chromatic number $\chi_s$, the acyclic chromatic number $\chi_a$, and the oriented chromatic number $\chi_o$.

Recall that a **star-forest** is a forest whose components have diameter at most 2. The **star chromatic number** $\chi_s(G)$ (resp. **acyclic chromatic number** $\chi_a(G)$) of a graph $G$ is the least integer $k$ such that $G$ has a proper $k$-vertex-colouring in which any union of two colour classes induces a star-forest (resp. a forest).

The **oriented chromatic number** $\chi_o(D)$ of an oriented graph $D$ is the minimum integer $k$ for which there exists a proper colouring $\phi : V(D) \to [k]$ such that for all $i, j \in [k]$, the arcs linking $\phi^{-1}(i)$ and $\phi^{-1}(j)$ either are all oriented from $\phi^{-1}(i)$ to $\phi^{-1}(j)$ or are all oriented from $\phi^{-1}(j)$ to $\phi^{-1}(i)$. Equivalently, $\chi_o(D)$ is the least integer $k$ such that there exists a homomorphism from $D$ to a tournament on $k$ vertices. The **oriented chromatic number** $\chi_o(G)$ of a graph $G$ is the maximum of $\chi_o(\vec{G})$ over all orientations $\vec{G}$ of $G$. The star chromatic number, acyclic chromatic number, and oriented chromatic number are known to be tied [Grü73, RS94, KSZ97], and we add to this list of equivalent parameters the inversion diameter.

**Theorem 1.2.** Let $\mathcal{G}$ be a class of graphs. The following are equivalent.

* There is a constant $C$ such that $\mathrm{diam}(\mathcal{I}(G)) \le C$ for every $G \in \mathcal{G}$.

* There is a constant $C_s$ such that $\chi_s(G) \le C_s$ for every $G \in \mathcal{G}$.

* There is a constant $C_a$ such that $\chi_a(G) \le C_a$ for every $G \in \mathcal{G}$.

* There is a constant $C_o$ such that $\chi_o(G) \le C_o$ for every $G \in \mathcal{G}$.

As a consequence, graphs of bounded maximum degree, graphs of bounded treewidth, planar graphs, have all bounded inversion diameter. Since these theoretical bounds are not very accurate, we show more precise upper bounds for these specific classes. In particular, we show:

a) $\mathrm{diam}(\mathcal{I}(G)) \le 12$ for every planar graph $G$ (Corollary 8.5), and there are planar graphs with inversion diameter at least 5 (Proposition 8.6);

b) $\mathrm{diam}(\mathcal{I}(G)) \le 3$ for every planar graph $G$ of girth at least 8 (Theorem 8.8), and there are planar graphs of arbitrary large girth with inversion diameter 3 (Proposition 8.9);

c) $\mathrm{diam}(\mathcal{I}(G)) \le 2\Delta - 1$ for every graph $G$ with maximum degree at most $\Delta \ge 1$ (Theorem 6.1), and $\mathrm{diam}(\mathcal{I}(G)) = \Delta(G)$ for every complete graph $G$ (Theorem 2.3);

d) $\mathrm{diam}(\mathcal{I}(G)) \le 2t$ for every graph $G$ of treewidth at most $t$ (Theorem 7.1), and for every $t \ge 2$, there are graphs of treewidth $t$ with inversion diameter $t+2$ (Theorem 7.5).

We also show that determining the inversion diameter of a given graph is NP-hard, and that determining whether two given orientations of a given bipartite planar graph are at distance at most 2 in its inversion graph is NP-complete (Corollary 9.5).

**Structure of the paper** In Section 2, we give an algebraic characterisation of the inversion diameter that will be used throughout the paper, and we apply it to determine the inversion diameter of balanced complete multipartite graphs, including complete graph. In Section 3, we show that despite the fact that there are 2-degenerate graphs with arbitrary high inversion diameter, a slightly stronger notion of degeneracy is an upper bound on the inversion diameter. This fact is one of our main tools to upper bound the inversion diameter. In Section 4, we show that the inversion diameter is tied to the star chromatic number, the acyclic chromatic number, and the oriented chromatic number. We thus characterise the classes of graphs having inversion diameter bounded by a constant. In Section 5, we improve the bounds on the inversion diameter as functions of $\chi_s$ and $\chi_a$ given in the previous section. In Section 6, we show that $\mathrm{diam}(\mathcal{I}(G)) \le 2\Delta(G) - 1$ for every graph $G$ with at least one edge, and we improve this bound for

<footnote n="1">¹Two graph parameters $\gamma_1$ and $\gamma_2$ are **tied** if there are two functions $f_1$ and $f_2$ such that $\gamma_1(G) \le f_1(\gamma_2(G))$ and $\gamma_2(G) \le f_2(\gamma_1(G))$ for every graph $G$.</footnote>
$\Delta(G) \le 3$. In Section 8, we show various bounds for the maximum inversion diameter of graphs in some minor-closed classes. In particular, we show the above-mentioned results on planar graphs (items a) and b)) and bounded-treewidth graph (item c)). In Section 9, we show that computing distances in $\mathcal{I}(G)$ is hard. More precisely, for every $k \ge 2$, it is NP-hard to determine if two given orientations are at distance at most $k$, and it is NP-hard to determine if $\text{diam}(\mathcal{I}(G)) \le k$. This is a consequence of Theorem 9.4 which expresses the inversion diameter of $G^{(1)}$, the graph obtained from a graph $G$ by subdividing every edge once, in term of $\chi(G)$, which is well-known to be hard to compute.

**Notation** For every positive integer $k$, we denote by $[k]$ the set $\{1, \dots, k\}$. We denote by $\log(\cdot)$ the logarithm in base 2. Given a graph $G$, we denote by $V(G)$ its vertex set and by $E(G)$ its edge set. Graphs do not contain loops or multiple edges, otherwise, we speak of *multigraphs*. Similarly, given a digraph $D$ we denote by $V(D)$ its vertex set and by $A(D)$ its arc set. If $X$ is a set of vertices in $G$ (resp. $D$), we denote by $G\langle X \rangle$ (resp. $D\langle X \rangle$) the subgraph (resp. subdigraph) induced by $X$.

We denote by $\delta(G)$ the minimum degree of $G$ and by $\delta^*(G)$ the **degeneracy** of $G$, which is $\max\{\delta(H) \mid H \text{ subgraph of } G\}$. Equivalently, $\delta^*(G) \le d$ if and only if there is an ordering $(v_1, \dots, v_n)$ of $V(G)$ such that for every $i \in [n]$, $v_i$ has at most $d$ neighbours in $\{v_j \mid j < i\}$. We also denote by $\text{Ad}(G)$ the average degree of $G$, that is $\frac{2|\text{Ad}(G)|}{|V(G)|}$, and by $\text{Mad}(G)$ the maximum over all subgraphs $H$ of $G$ with at least one vertex of $\text{Ad}(H)$. Note that $\text{Mad}(G)/2 \le \delta^*(G) \le \text{Mad}(G)$.

More generally, we use standard notations in graph theory, and we refer the reader to [BM08] for undefined notion or notation, such as the parameters $\delta, \Delta, \chi$.

Consider now an oriented graph $\vec{G}$ and some $X \subseteq V(\vec{G})$. We denote by $\text{Inv}(\vec{G}; X)$ the result of the inversion of $X$ in $\vec{G}$, and more generally, if $X_1, \dots, X_t$ are sets of vertices in $\vec{G}$, $\text{Inv}(\vec{G}; (X_i)_{i \in [t]})$ is the oriented graph resulting from the inversion of $X_1, X_2, \dots, X_t$. Note that $\text{Inv}(\vec{G}; (X_i)_{i \in [t]})$ does not depend on the ordering of $X_1, \dots, X_t$, since an arc $uv$ is reversed if and only if $|\{i \in [t] \mid u, v \in X_i\}|$ is odd.

We will often use arguments from linear algebra. The vectors and matrices considered will always be over the field $\mathbb{F}_2$ with two elements 0 and 1. Given a matrix $M$, we denote by $\text{rk}(M)$ its rank over $\mathbb{F}_2$. We denote by $\mathbf{0}$ the vector in $\mathbb{F}_2^d$ constant to 0, for $d$ a positive integer that will be clear from the context. Moreover, given two vectors $\mathbf{x} = (x_1, \dots, x_d), \mathbf{y} = (y_1, \dots, y_d)$ of same dimension $d$, we denote by $\mathbf{x} \cdot \mathbf{y}$ their scalar product, that is $\sum_{i=1}^d x_i y_i$.

## 2 Some tools and complete multipartite graphs

In this section, we introduce some tools to compute $\text{diam}(\mathcal{I}(G))$, and we apply them on some highly structured graphs.

Let $\vec{G}_1$ and $\vec{G}_2$ be two orientations of a graph $G$. If an edge $e$ has the same orientation in $\vec{G}_1$ and $\vec{G}_2$, we say that $\vec{G}_1$ and $\vec{G}_2$ **agree** on $e$; otherwise we say that they **disagree** on $e$. We denote by $E_{\vec{G}_1}$ the set of edges of $G$ on which $\vec{G}_1$ and $\vec{G}_2$ agree and by $E_{\vec{G}_2}$ the set of edges of $G$ on which $\vec{G}_1$ and $\vec{G}_2$ disagree.

Theorem 1.1 follows directly from the following lemma and an immediate induction.

**Lemma 2.1.** Let $G$ be a graph and $v$ a vertex in $G$. Then $\text{diam}(\mathcal{I}(G)) \le \text{diam}(\mathcal{I}(G - v)) + 1$.

*Proof.* Let $\vec{G}_1$ and $\vec{G}_2$ be two orientations of $G$. Let $X'$ be the set of neighbours of $w$ of $v$ such that $\vec{G}_1$ and $\vec{G}_2$ disagree on $vw$. Set $X = X' \cup \{v\}$. Note that $v$ has the same out-neighbours and the same in-neighbours in $\text{Inv}(\vec{G}_1; X)$ and $\vec{G}_2$. Now let $\mathcal{X}$ be a collection of $\text{diam}(\mathcal{I}(G - v))$ subsets of $V(G - v)$ such that $\text{Inv}(\text{Inv}(\vec{G}_1; X) - v; \mathcal{X}) = \vec{G}_2 - v$. We obtain $\text{Inv}(\vec{G}_1; \mathcal{X} \cup \{X\}) = \vec{G}_2$ and hence the statement follows. $\square$

Now we give a fundamental observation that allows us to use tools from linear algebra to bound $\text{diam}(\mathcal{I}(G))$.

**Observation 2.2.** For every graph $G$, for every positive integer $t$, the following are equivalent.

1. $\text{diam}(\mathcal{I}(G)) \le t$.
2. For every function $\pi: E(G) \to \mathbb{F}_2$, there is a family $(\mathbf{u})_{u \in V(G)}$ of vectors in $\mathbb{F}_2^t$ such that

$$ \pi(uv) = \mathbf{u} \cdot \mathbf{v} $$

for every edge $uv \in E(G)$.

*Proof.* First suppose that $\text{diam}(\mathcal{I}(G)) \le t$, and let $\pi: E(G) \to \mathbb{F}_2$. Let $\vec{G}_1, \vec{G}_2$ be two orientations of $G$ such that, for every edge $uv \in E(G)$, $\vec{G}_1$ and $\vec{G}_2$ agree on $uv$ if and only if $\pi(uv) = 0$. By assumption, there are sets $X_1, \dots, X_t \subseteq V(G)$ such that $\vec{G}_1 = \text{Inv}(\vec{G}_2; X_1, \dots, X_t)$. For every vertex $u \in V(G)$, we define $\mathbf{u}$ to be the vector in $\mathbb{F}_2^t$ whose $i^{\text{th}}$ coordinate is 1 if and only if $u \in X_i$, for every $i \in [t]$. Now observe that for every edge $uv \in E(G)$, $uv$ is reversed by the inversions $X_1, \dots, X_t$ if and only if $\mathbf{u} \cdot \mathbf{v} = 1$. Hence $\mathbf{u} \cdot \mathbf{v} = \pi(uv)$.

Reciprocally, given two orientations $\vec{G}_1$ and $\vec{G}_2$ of $G$, for every edge $uv \in E(G)$, let $\pi(uv) = 0$ if and only if $\vec{G}_1$ and $\vec{G}_2$ agree on $uv$. By assumption, there is a family $(\mathbf{u})_{u \in V(G)}$ of vectors in $\mathbb{F}_2^t$ such that $\pi(uv) = \mathbf{u} \cdot \mathbf{v}$ for every edge $uv \in E(G)$. We define $X_i = \{u \in V(G) \mid \mathbf{u}_i = 1\}$ for every $i \in [t]$. Then for every edge $uv \in E(G)$, $uv$ is reversed by the inversions $X_1, \dots, X_t$ if and only if $\mathbf{u} \cdot \mathbf{v} = 1$, and so $\vec{G}_2 = \text{Inv}(\vec{G}_1; X_1, \dots, X_t)$. This proves that $\text{diam}(\mathcal{I}(G)) \le t$. $\square$

We now fully determine the inversion diameter of balanced complete multipartite graphs. The purpose of this result is two-fold. Firstly, its proof may serve as a warm-up exercise for the following sections. Secondly, it gives in particular the inversion diameter of complete graphs, which serve as tightness examples in several results in the following sections. We denote by $K_r[\vec{K}_t]$ the complete $r$-partite graph in which every part has size $t$.

**Theorem 2.3.** For all positive integers $r$ and $t$, we have $\text{diam}(\mathcal{I}(K_r[\vec{K}_t])) = (r-1)t$.

*Proof.* Let the graph $G$ be defined by $V(G) = [r] \times [t]$, and $E(G) = \{(i, j)(i', j') \mid i \neq i'\}$. Observe that $G$ is isomorphic to $K_r[\vec{K}_t]$. By repeatedly applying Lemma 2.1 for all vertices in $V(G) \setminus \{(1) \times [t]\}$ and using the fact that the inversion diameter of edgeless graphs is 0, we have $\text{diam}(\mathcal{I}(G)) \le (r-1)t + \text{diam}(\mathcal{I}(\vec{K}_t)) = (r-1)t$. Let us now prove that $\text{diam}(\mathcal{I}(G)) \ge (r-1)t$.

Consider the function $\pi: E(G) \to \mathbb{F}_2$ defined by $\pi((i, j)(i', j')) = 1$ if and only if $|i' - i| = 1$ and $j = j'$, for all $i, i' \in [r]$ and $j, j' \in [t]$ with $i \neq i'$. Suppose that there is a family $(\mathbf{v}_{i,j})_{i \in [r], j \in [t]}$ of vectors in $\mathbb{F}_2^t$ such that $\pi((i, j)(i', j')) = \mathbf{v}_{i,j} \cdot \mathbf{v}_{i',j'}$ for every $i, i' \in [r]$ and $j, j' \in [t]$ with $i \neq i'$. Let $U$ be the matrix whose column $(i, j)$ is the vector $\mathbf{v}_{i,j}$ (in the lexicographic order $(1, 1), (1, 2), \dots, (r, t)$). Then $U^\top \cdot U$ is of the form

$$ U^\top \cdot U = \begin{pmatrix} \star & I_t & 0 & \dots & 0 \\ I_t & \star & I_t & \dots & \vdots \\ 0 & I_t & \dots & \dots & 0 \\ \vdots & \vdots & \ddots & \star & I_t \\ 0 & \dots & 0 & I_t & \star \end{pmatrix} $$

As $U^\top \cdot U$ contains an $(r-1)t \times (r-1)t$ upper triangular matrix whose diagonal is constant to 1, we obtain that $U^\top \cdot U$ has rank at least $(r-1)t$. It follows that $k \ge \text{rk}(U) \ge \text{rk}(U^\top \cdot U) \ge (r-1)t$. Using Observation 2.2, this proves that $\text{diam}(\mathcal{I}(G)) \ge (r-1)t$. $\square$

# 3 Bounds in terms of degeneracy and strong degeneracy

In this section, we study the relationship between the inversion diameter of a graph $G$ and its degeneracy. Note that the degeneracy of a graph is strongly related to its maximum average degree, as $\delta^*(G) \le \text{Mad}(G) \le 2\delta^*(G)$ holds for every graph $G$. In Proposition 3.1, we show that bounded degeneracy (or maximum average degree) alone is not enough to bound the inversion diameter of a graph. On the other hand, in Theorem 3.2, we show that a bounded inversion diameter implies bounded degeneracy (and bounded maximum average degree). Afterwards, we introduce a new notion of degeneracy, which we call strong degeneracy. In Theorem 3.3, we show that, in contrast to the classic notion of degeneracy, bounded strong degeneracy guarantees a bounded inversion diameter. Theorem 3.3 will serve as a valuable tool
in several parts of this article. As a first application of Theorem 3.3, we prove in Corollary 3.4 that in
graphs of bounded degeneracy, the maximum inversion diameter is logarithmic in the maximum degree.

We start by proving that the inversion diameter of a graph $G$ cannot be upper bounded by a function of $\delta^*(G)$ or $\mathrm{Mad}(G)$.

**Proposition 3.1.** For every integer $\ell$, there exists a graph $G$ with $\delta^*(G) \le 2$ and $\mathrm{diam}(\mathcal{I}(G)) \ge \ell$.

*Proof.* Let $G$ be the graph obtained from $K_{2^{\ell-1}+1}$ by subdividing every edge $e$ once, thereby creating a vertex $x_e$. We call the vertices of $K_{2^{\ell-1}+1}$ the original vertices of $G$. One can easily check that $\delta^*(G) \le 2$.

Let $\vec{G}_1$ be an orientation of $G$ where $d_{\vec{G}_1}^{-}(x_e) = 1$ for all $e \in E(K_{2^{\ell-1}+1})$ and let $\vec{G}_2$ be an orientation of $G$ where $d_{\vec{G}_2}^{-}(x_e) = 2$ for all $e \in E(K_{2^{\ell-1}+1})$. Suppose that there exist $X_1, \dots, X_t \subseteq V(G)$ such that $\mathrm{Inv}(\vec{G}_1; X_1, \dots, X_t) = \vec{G}_2$ for some $t < \ell$. By the pigeon-hole principle, there exist two original vertices $u$ and $v$ such that $\{i \mid u \in X_i\} = \{i \mid v \in X_i\}$. It follows that $d_{\mathrm{Inv}(\vec{G}_1; X_1, \dots, X_t)}^{-}(x_{uv}) = 1$. This is a contradiction to the assumption that $\mathrm{Inv}(\vec{G}_1; X_1, \dots, X_t) = \vec{G}_2$. Hence $\mathrm{diam}(\mathcal{I}(G)) \ge \ell$. $\square$

Conversely, the following result shows that the inversion diameter grows with the maximum average degree and the degeneracy.

**Theorem 3.2.** $\mathrm{diam}(\mathcal{I}(G)) \ge \mathrm{Mad}(G)/2$ for every graph $G$.

*Proof.* Set $M = \mathrm{Mad}(G)$. Let $H$ be a subgraph of $G$ such that $\mathrm{Ad}(H) = M$. Let $n$ be the number of vertices of $H$. The number of edges of $H$ is $\frac{1}{2}Mn$. Hence $H$ has $2^{Mn/2}$ orientations. On the other hand, starting from an arbitrary orientation $\vec{G}$ of $G$, we have $2^n$ possible choices of subsets of $V(G)$ to invert. Hence a simple induction shows that, for any positive integer $t$, we have that at most $2^{nt}$ orientations can be obtained from $\vec{G}$ through $t$ inversions. This yields that if $t = \mathrm{diam}(\mathcal{I}(H))$, then $H$ has at most $2^{nt}$ orientations. Thus $t \ge M/2$.

Finally, since $H$ is a subgraph of $G$, we have $\mathrm{diam}(\mathcal{I}(G)) \ge \mathrm{diam}(\mathcal{I}(H)) \ge M/2$. $\square$

However, a stronger version of degeneracy permits to bound $\mathrm{diam}(\mathcal{I}(G))$. First, we need a few definitions.

Let $G$ be a graph and let $<$ be a total ordering on $V(G)$. For every pair $u, u'$ of vertices in $G$, let $N_{<u'}(u) = \{v \in N(u) \mid v < u'\}$ and $N_{>u'}(u) = \{v \in N(u) \mid v > u'\}$. We simply write $N_{<}(u)$ for $N_{<u}(u)$ and $N_{>}(u)$ for $N_{>u}(u)$. The ordering $<$ is **t-strong** if for every $u \in V(G)$

* $|N_{<}(u)| + \log(|\{X \subseteq V(G) \mid \exists v \in N_{>}(u), X \subseteq N_{<u}(v)\}|) < t$ if $N_{>}(u) \ne \emptyset$, and

* $|N_{<}(u)| \le t$ otherwise.

A graph is **strongly t-degenerate** if there is a *t*-strong ordering of its vertices. We now show that this stronger version of degeneracy is sufficient to provide a bound for the inversion diameter.

**Theorem 3.3.** Let $G$ be a graph and let $t$ be a positive integer. If $G$ is strongly $t$-degenerate, then $\mathrm{diam}(\mathcal{I}(G)) \le t$.

*Proof.* Consider a function $\pi: E(G) \to \mathbb{F}_2$. By Observation 2.2, it is enough to show the existence of a family $(\mathbf{u})_{u \in V(G)}$ of vectors in $\mathbb{F}_2^t$ such that $\mathbf{u} \cdot \mathbf{v} = \pi(uv)$ for every edge $uv$ of $G$. Let $<$ be a $t$-strong ordering of $V(G)$ and let $(v_1, \dots, v_n)$ be the vertices of $V(G)$ as they appear in this order. We iteratively construct vectors $\mathbf{v}_1, \dots, \mathbf{v}_n \in \mathbb{F}_2^t$ maintaining the following invariant: for $i \in [n]$

1. for every $k \in \{i+1, \dots, n\}$, the vectors $(\mathbf{v}_j)_{v_j \in N_{<v_i}(v_k)}$ are linearly independent, and

2. $\mathbf{v}_j \cdot \mathbf{v}_k = \pi(v_j v_k)$ for every edge $v_j v_k$ of $G$ with $j, k \le i$.

For $i=n$, this will imply that $\mathrm{diam}(\mathcal{I}(G)) \le t$ by Observation 2.2.

For $i=1$, we take $\mathbf{v}_1 \in \mathbb{F}_2^t \setminus \{0\}$ arbitrarily. Now suppose $i>1$ and that $\mathbf{v}_1, \dots, \mathbf{v}_{i-1}$ have already been constructed. Since the vectors $(\mathbf{v}_j)_{v_j \in N_{<}(v_i)}$ are linearly independent, the set of vectors $\mathbf{x} \in \mathbb{F}_2^t$ satisfying $\mathbf{v}_j \cdot \mathbf{x} = \pi(v_i v_j)$ for every $v_j \in N_{<}(v_i)$ forms an affine space $A$ of dimension at least $t - |N_{<}(v_i)|$. To satisfy the second condition, we must choose $\mathbf{v}_i$ in $A$. Note that $|A| \ge 2^{t - |N_{<}(v_i)|} \ge 1$ because $<$ is $t$-strong. Observe that if $N_{>}(v_i) = \emptyset$, then the first condition trivially holds, and so we can choose any vector in $A$ for $\mathbf{v}_i$.
Henceforth, we may assume that $N_>(v_i) \neq \emptyset$. For every $v_j \in N_>(v_i)$, the first condition of the invariant says that $\mathbf{v}_i$ must be outside the vector space $U_j$ spanned by $(\mathbf{v}_k)_{v_k \in N_>(v_j), k<i}$. Thus it is enough to take $\mathbf{v}_i$ not in $U = \bigcup_{v_j \in N_>(v_i)} U_j$. Now observe that for every $\mathbf{y} \in U$, there is a vertex $v_j \in N_>(v_i)$ and a set $X \subseteq \{v_k \in N(v_j) \mid k < i\}$ such that $\mathbf{y} = \sum_{x \in X} \mathbf{x}$. Hence $|U| \le |\{X \subseteq V(G) \mid \exists v_j \in N_>(v_i), X \subseteq N_{<v_i}(v_j)\}|$. Since $<$ is $t$-strong, we obtain that $|A| = 2^{t-|N_{<}(v_i)|} > |\{X \subseteq V(G) \mid \exists v_j \in N_>(v_i), X \subseteq N_{<}(v_j)\}| \ge |U|$. We deduce that $A \setminus U \neq \emptyset$ and there is a vector $\mathbf{v}_i$ satisfying the invariant. The statement now follows for $i=n$. $\square$

As a first consequence of this proposition, we prove that graphs of bounded degeneracy have inversion diameter at most logarithmic in the maximum degree.

**Corollary 3.4.** $\mathrm{diam}(\mathcal{I}(G)) \le 2\delta^*(G) - 1 + \lfloor \log(\Delta(G)) \rfloor$ for every graph $G$ with at least one edge.

*Proof.* Let $d = \delta^*(G)$, let $t = 2\delta^*(G) - 1 + \lfloor \log(\Delta(G)) \rfloor$, and let $<$ be an ordering of $V(G)$ witnessing the fact that $\delta^*(G) \le d$. If $\Delta(G) = 1$, then one can easily check that $\mathrm{diam}(\mathcal{I}(G)) \le 1 \le 2d-1$. Now assume $\Delta(G) \ge 2$. For every vertex $u \in V(G)$, we have $|N_<(u)| \le d$ by definition. Moreover, if $N_>(u) \neq \emptyset$ then $|\{X \subseteq V(G) \mid \exists v \in N_>(u), X \subseteq N_{<v}(u)\}| \le 1 + \sum_{v \in N(u), u < v} (2^{|N_{<v}(v)|} - 1) \le 1 + \Delta(G)(2^{d-1} - 1) < \Delta(G)2^{d-1}$ (since $\Delta(G) \ge 2$). Finally, since $t \ge 2d-1 + \log(\Delta(G))$, the ordering $<$ is $t$-strong, and the result follows from Theorem 3.3. $\square$

# 4 Tying the inversion diameter

The aim of this section is to prove that the inversion diameter of a graph behaves asymptotically in the same way as three other graph parameters which have been studied before. More precisely, we show the following result relating the inversion diameter of a graph to its star chromatic number, its acyclic chromatic number, and its oriented chromatic number.

**Theorem 4.1.** The inversion diameter is tied to the star chromatic number, the acyclic chromatic number, and the oriented chromatic number.

Observe that Theorem 4.1 directly implies Theorem 1.2. In order to prove Theorem 4.1, we first give some simple preliminary results on the inversion diameter of forests in Section 4.1. These observations will also be reused in some later sections. After, in Section 4.2, we give the main proof of Theorem 4.1.

## 4.1 Forests

**Theorem 4.2.** If $F$ is a forest, then $\mathrm{diam}(\mathcal{I}(F)) \le 2$.

*Proof.* Let $\vec{F}_1$ and $\vec{F}_2$ be two orientations of a forest $F$. Recall that $E_\neq$ is the set of edges on which $\vec{F}_1$ and $\vec{F}_2$ disagree. Consider the graph $H_\neq$ whose vertices are connected components of $(V(F), E_\neq)$, and where two such connected components $C$ and $C'$ are connected if and only if there is an edge $uv$ in $E(F)$ with $u \in C$ and $v \in C'$. Observe that $H_\neq$ is a minor of $F$, and so is a forest. In particular, $H_\neq$ is bipartite. Let $(X'_1, X'_2)$ be a bipartition of $H_\neq$ and let $(X_1, X_2)$ the partition of $V(F)$ where a vertex is contained in $X_i$ if it is contained in a component of $H_\neq$ that belongs to $X'_i$ for $i=1,2$. For every edge $uv$ in $E(F)$, we have $uv \in E_\neq$ if and only if $\{u, v\} \subseteq X_1$ or $\{u, v\} \subseteq X_2$. Thus $\mathrm{Inv}(\vec{F}_1; (X_1, X_2)) = \vec{F}_2$. $\square$

We next give a simple characterisation of the graphs whose inversion diameter is at most 1. A **star forest** is a graph whose connected components are all isomorphic to a star (including $K_1$ and $K_2$).

**Proposition 4.3.** Let $G$ be a graph.

(i) $\mathrm{diam}(\mathcal{I}(G)) = 0$ if and only if $G$ has no edges.

(ii) $\mathrm{diam}(\mathcal{I}(G)) \le 1$ if and only if $G$ is a star forest.

*Proof.* (i) holds trivially. Let us prove (ii). It is easy to see that if $G$ is a star-forest, then $\mathrm{diam}(\mathcal{I}(G)) \le 1$. Assume now that $G$ is not a star forest. Then $F$ has a subgraph which is isomorphic to either the complete graph on three vertices $K_3$, or the path on four vertices $P_4$. Now $\mathrm{diam}(\mathcal{I}(K_3)) = 2$ by Theorem 2.3, and $\mathrm{diam}(\mathcal{I}(P_4)) = 2$ since two orientations of $P_4$ agreeing only on its middle edge are at distance 2. Thus $\mathrm{diam}(\mathcal{I}(G)) \ge \min\{\mathrm{diam}(\mathcal{I}(K_3)), \mathrm{diam}(\mathcal{I}(P_4))\} = 2$. $\square$
We now use Theorem 4.2 and Proposition 4.3 to completely determine the inversion diameter of forests.

**Corollary 4.4.** If F is a forest, then

$$ \mathrm{diam}(\mathcal{I}(F)) = \begin{cases} 0 & \text{if } F \text{ has no edge,} \\ 1 & \text{if } F \text{ is a star forest with at least one edge,} \\ 2 & \text{otherwise.} \end{cases} $$

## 4.2 Proof of Theorem 4.1

In this section, we prove that the inversion diameter of a graph is tied to its star chromatic number, its acyclic chromatic number, and its oriented chromatic number. We first show in Corollary 4.6 that the inversion diameter of a graph is bounded by functions of its star chromatic number and its acyclic chromatic number. We then show in Theorem 4.7 that the oriented chromatic number of a graph is bounded by a function of its inversion diameter. Together with some previous results showing that the star chromatic number, the acyclic chromatic number, and the oriented chromatic number are tied, we obtain Theorem 4.1.

For the first part, it turns out to be convenient to introduce the following slightly more general graph parameter.

An α-ID k-colouring of a graph G is a k-colouring such that the subgraph induced by any two colour classes has inversion diameter at most α. A graph is α-ID k-colourable if it admits a α-ID k-colouring and the α-ID chromatic number of a graph G, denoted by α-ID(G), is the smallest integer k such that G is α-ID k-colourable.

Note that an α-ID k-colouring is not necessarily proper. The following result shows that the inversion diameter of graphs admitting a proper α-ID k-colouring is bounded by a function depending only on α and k.

**Lemma 4.5.** Let G be a graph and α and k positive integers such that G admits a proper α-ID k-colouring. Then

$$ \mathrm{diam}(\mathcal{I}(G)) \le \alpha \binom{k}{2}. $$

*Proof.* Let $\vec{G}_1$ and $\vec{G}_2$ be two orientations of G. Assume that G admits a proper α-ID k-colouring c: $V(G) \to [k]$. For every $i \in [k]$, let $S_i = c^{-1}(i)$. For every $i, j$ in $[k]$ such that $i < j$, let $V_{i,j} = S_i \cup S_j$. By assumption, there exists a family $\mathcal{X}_{i,j}$ of α subsets of $V_{i,j}$ whose inversion transforms $\vec{G}_1 \langle V_{i,j} \rangle$ into $\vec{G}_2 \langle V_{i,j} \rangle$. Let $\mathcal{X} = \bigcup_{1 \le i < j \le k} \mathcal{X}_{i,j}$. We claim that $\mathrm{Inv}(\vec{G}_1, \mathcal{X}) = \vec{G}_2$.

To see that, consider an arc uv of $\vec{G}_1$, and let $i = c(u)$ and $j = c(v)$. Note that $i \ne j$ because c is a proper colouring. Then uv is reversed only when inverting sets of $\mathcal{X}_{i,j}$. As inverting $\mathcal{X}_{i,j}$ transforms $\vec{G}_1 \langle V_{i,j} \rangle$ into $\vec{G}_2 \langle V_{i,j} \rangle$, it follows that uv has been inverted if and only if it belongs to $E_{\ne}$. In other words, we obtain $\mathrm{Inv}(\vec{G}_1; \mathcal{X}) = \vec{G}_2$. □

Using Lemma 4.5 and the fact that star-forests and forests have inversion diameter at most 1 and 2 respectively by Corollary 4.4, we deduce the following.

**Corollary 4.6.** Let G be a graph. Then $\mathrm{diam}(\mathcal{I}(G)) \le \binom{\chi_s(G)}{2}$ and $\mathrm{diam}(\mathcal{I}(G)) \le 2\binom{\chi_a(G)}{2}$.

We now show that the oriented chromatic number of a graph is upper bounded by a function of its inversion diameter.

**Theorem 4.7.** Let G be a graph with inversion diameter $\ell$. Then $\chi_o(G) \le (2\ell + 1)2^\ell$.

*Proof.* Let G be a graph with inversion diameter $\ell$. Let $\vec{G}_1$ be an orientation of G. We will show that $\vec{G}_1$ has a homomorphism to an orientation of $K_{(2\ell+1)2^\ell}$.

Since $\chi(G) \le \mathrm{Mad}(G) + 1$ and $\mathrm{Mad}(G) \le 2\ell$ by Theorem 3.2, G has a proper $(2\ell + 1)$-colouring $\phi: V(G) \to [2\ell + 1]$. Let $\vec{G}_0$ be the orientation of G such that $uv \in A(\vec{G}_0)$ if and only if $\phi(u) < \phi(v)$. By definition of $\ell$, there exists a sequence $X_1, \dots, X_\ell$ of subsets of $V(G)$ such that $\mathrm{Inv}(\vec{G}_0, \{X_1, \dots, X_\ell\}) =$
$\vec{G}_1$. We define the colouring $\psi$ as follows: for every vertex $v$ in $G$, $\psi(v) = (\phi(v), \{i \in [\ell], v \in X_i\})$. Clearly, this is a proper $(2\ell + 1)2^\ell$-colouring of $G$. Further, for $c \in [2\ell + 1]$ and $I \subseteq [\ell]$, let $V_{(c,I)}$ be the set of vertices coloured $(c, I)$. We claim that, in $\vec{G}_1$, all the arcs between $V_{(c,I)}$ and $V_{(c',I')}$ are either all oriented towards $V_{(c,I)}$ or all oriented towards $V_{(c',I')}$ for all $c, c' \in [2\ell + 1]$ and $I, I' \subseteq [\ell]$. To see that, observe that those arcs are in the same direction in $\vec{G}_0$, that is from $\phi^{-1}(c)$ to $\phi^{-1}(c')$ if $c < c'$, and that they are always reversed together.

Therefore $\psi$ is an oriented colouring of $\vec{G}_1$. As $\vec{G}_1$ was arbitrary, we get $\chi_o(G) \le (2\ell + 1)2^\ell$. $\square$

Corollary 4.6, Theorem 4.7, and the fact that $\chi_s$, $\chi_a$, and $\chi_o$ are tied [Grü73, RS94, KSZ97] imply Theorem 4.1.

# 5 Better bounds in terms of $\chi_s$, $\chi_a$ and $\chi_o$

The objective of this section is to quantitatively improve on some of the results obtained in Section 4. In Theorem 5.2, we give an improvement of Lemma 4.5 in the case that $\alpha \ge 7$. An application of this new result immediately gives an improvement on Corollary 4.6, hence yielding a better understanding of the relationship of the inversion diameter and the parameters $\chi_s(G)$ and $\chi_a(G)$. Further, in Theorem 5.4, we give a better upper bound on the inversion diameter in terms of $\chi_o$.

For convenience, for a graph parameter $\gamma$ and an integer $k$, we define $M(\gamma \le k)$ as the maximum inversion diameter over all graphs $G$ such that $\gamma(G) \le k$ if such a maximum exists, and $+\infty$ otherwise.

The main technical contribution for the proof of Theorem 5.2 is contained in the following lemma. Roughly speaking, we improve on Lemma 4.5, by executing simultaneously some of the operations which were executed consecutively before.

**Lemma 5.1.** $M(\alpha\text{-ID} \le t) \le M(\alpha\text{-ID} \le \lceil \frac{t}{2} \rceil) + \alpha \lceil \frac{t}{2} \rceil \lfloor \frac{t}{2} \rfloor$ for every nonnegative integer $t$.

*Proof.* Let $G$ be a graph with $\alpha$-ID$(G) \le t$. Let $\vec{G}_1$ and $\vec{G}_2$ be two orientations of $G$ that are at distance $\text{diam}(\mathcal{I}(G))$ in $\mathcal{I}(G)$. By assumption, there exists a partition $(S_1, \dots, S_t)$ of $V(G)$ such that $\text{diam}(\mathcal{I}(G\langle S_i \cup S_j \rangle)) \le \alpha$ holds for every $\{i, j\} \subseteq [t]$. Let $H_1 = G\langle S_1 \cup \dots \cup S_{\lceil \frac{t}{2} \rceil} \rangle$ and $H_2 = G\langle S_{\lceil \frac{t}{2} \rceil+1} \cup \dots \cup S_t \rangle$. Clearly, $\alpha$-ID$(H_1) \le \lceil \frac{t}{2} \rceil$ for all $i \in [2]$. Set $p = M(\alpha$-ID$\le \lceil \frac{t}{2} \rceil)$. Thus, for each $i \in [2]$, there exists a collection of sets $X_i^1, \dots, X_p^i \subseteq V(H_i)$ such that $\text{Inv}(\vec{G}_1\langle V(H_i) \rangle; (X_j^i)_{j \in [p]}) = \vec{G}_2\langle V(H_i) \rangle$. For all $j \in [p]$, we set $X_j = X_j^1 \cup X_j^2$. Let $D_0 = \text{Inv}(\vec{G}_1; (X_i)_{i \in [p]})$. Observe that $D_0$ and $\vec{G}_2$ agree on the edges of $E(H_1) \cup E(H_2)$.

Set $q = \lceil \frac{t}{2} \rceil \lfloor \frac{t}{2} \rfloor$, and let $(i_1, j_1), \dots, (i_q, j_q)$ be an arbitrary ordering of $[\lceil \frac{t}{2} \rceil] \times [\lfloor \frac{t}{2} \rfloor]$. Now for $k = 1, \dots, q$, we iteratively construct $\alpha$-tuples $(Y_k^\ell)_{\ell \in [\alpha]}$, of subsets of $S_{i_k} \cup S_{j_k}$ such that $D_k = \text{Inv}(D_{k-1}; (Y_k^\ell)_{\ell \in [\alpha]})$ agrees with $\vec{G}_2$ on $E(G\langle S_{i_k} \cup S_{j_k} \rangle)$. This is possible because $\text{diam}(\mathcal{I}(G\langle S_{i_k} \cup S_{j_k} \rangle)) \le \alpha$ by assumption.

We claim that $D_q = \vec{G}_2$. Consider some $uv \in E(G)$ with $u \in S_i$ and $v \in S_{i'}$ for some $i, i' \in [t]$. First suppose that $i = i'$. Let $k \in [q]$ be the largest index such that $i \in \{i_k, j_k\}$. Then, by construction of $Y_k^1, \dots, Y_k^\alpha$, we have that $D_k$ and $\vec{G}_2$ agree on $uv$. As $\{u, v\} \cap (Y_{k'}^1 \cup \dots \cup Y_{k'}^\alpha) = \emptyset$ for all $k' \in \{k+1, \dots, q\}$, we obtain that $D_q$ and $\vec{G}_2$ agree on $uv$. Now suppose that $i$ and $i'$ are distinct and $i, i' \in [\lceil \frac{t}{2} \rceil]$. Then by definition of $X_1, \dots, X_p$, we have that $D_0$ and $\vec{G}_2$ agree on $uv$. Next, for every $k \in [q]$, at least one of $u, v$ is not in $S_{i_k} \cup S_{j_k}$ and so not in any $Y_k^\ell$ for all $k \in [q]$ and all $\ell \in [\alpha]$. Hence, an immediate induction yields that $D_q$ and $\vec{G}_2$ agree on $uv$. Similarly, if $i$ and $i'$ are distinct and $i, i' \in [\lceil \frac{t}{2} \rceil + 1, \dots, t]$ we get that $D_q$ and $\vec{G}_2$ agree on $uv$. Finally consider the case $i \in [\lceil \frac{t}{2} \rceil]$ and $i' \in [\lceil \frac{t}{2} \rceil + 1, \dots, t]$. Then there is some $k \in [q]$ such that $\{i, i'\} = \{i_k, j_k\}$. By construction of $Y_k^1, \dots, Y_k^\alpha$, $D_k$ and $\vec{G}_2$ agree on $uv$. Further, for all $k' \in \{k+1, \dots, q\}$, there exists some $w \in \{u, v\}$ such that $w \notin S_{i_k'} \cup S_{j_k'}$. It follows that $\{u, v\}$ is not a subset of $Y_{k'}^\ell$ for all $k' \in \{k+1, \dots, q\}$ and all $\ell \in [\alpha]$. Hence, $D_q$ and $\vec{G}_2$ agree on $uv$. This shows that $D_q$ and $\vec{G}_2$ agree on all edges, so $\text{Inv}(\vec{G}_1; (X_1, \dots, X_p, (Y_k^\ell)_{k \in [q], \ell \in [\alpha]})) = D_q = \vec{G}_2$.

Therefore $\text{diam}(\mathcal{I}(G)) \le p + \alpha q = M(\alpha$-ID$\le \lceil \frac{t}{2} \rceil) + \alpha \lceil \frac{t}{2} \rceil \lfloor \frac{t}{2} \rfloor$. As $G$ was arbitrary, we get $M(\alpha$-ID$\le t) \le M(\alpha$-ID$\le \lceil \frac{t}{2} \rceil) + \alpha \lceil \frac{t}{2} \rceil \lfloor \frac{t}{2} \rfloor]$. $\square$

We are now ready to prove the following result which improves on Lemma 4.5.
**Theorem 5.2.** Let $\alpha$ be a positive integer. Then $M(\alpha\text{-ID} \le t) \le \frac{\alpha}{3}t^2 + \frac{\alpha}{3}t + \frac{\alpha}{3}$ for all $t \ge 1$.

*Proof.* Let us now prove $M(\alpha\text{-ID} \le t) \le \frac{\alpha}{3}t^2 + \frac{\alpha}{3}t + \frac{\alpha}{3}$ by induction on $t$. It is clear from the definitions that $M(\alpha\text{-ID} \le 1) \le M(\alpha\text{-ID} \le 2) \le \alpha$. Assume now $t \ge 4$. By Lemma 5.1 and the induction hypothesis, we have

$$M(\alpha\text{-ID} \le t) \le M\left(\alpha\text{-ID} \le \left\lfloor \frac{t}{2} \right\rfloor\right) + \alpha\left\lfloor \frac{t}{2} \right\rfloor \left\lfloor \frac{t}{2} \right\rfloor \\ \le \frac{\alpha}{3}\left\lfloor \frac{t}{2} \right\rfloor^2 + \frac{\alpha}{3}\left\lfloor \frac{t}{2} \right\rfloor + \frac{\alpha}{3} + \alpha\left\lfloor \frac{t}{2} \right\rfloor \left\lfloor \frac{t}{2} \right\rfloor.$$

If $t$ is even, we obtain

$$M(\alpha\text{-ID} \le t) \le \frac{\alpha}{3} \frac{t^2}{4} + \frac{\alpha}{3} \frac{t}{2} + \frac{\alpha}{3} + \alpha \frac{t^2}{4} \\ \le \frac{\alpha}{3} t^2 + \frac{\alpha t}{6} + \frac{\alpha}{3} \\ \le \frac{\alpha}{3} t^2 + \frac{\alpha t}{3} + \frac{\alpha}{3}.$$

If $t$ is odd, we obtain

$$M(\alpha\text{-ID} \le t) \le \frac{\alpha}{3} \left( \frac{t+1}{2} \right)^2 + \frac{\alpha}{3} \frac{t+1}{2} + \frac{\alpha}{3} + \alpha \frac{t+1}{2} \frac{t-1}{2} \\ = \frac{\alpha}{3} t^2 + \frac{\alpha t}{3} + \frac{\alpha}{3}.$$

<figure><img src="image_2.png" /></figure>

The following two results improving on Corollary 4.6 can immediately be obtained from Theorem 5.2.

**Corollary 5.3.** For every $t \ge 2$, we have $M(\chi_s \le t) \le \frac{1}{3}t^2 + \frac{1}{3}t + \frac{1}{3}$ and $M(\chi_a \le t) \le \frac{2}{3}t^2 + \frac{2}{3}t + \frac{2}{3}$.

We now turn our attention to the task of finding better upper bounds on the inversion diameter in terms of $\chi_o$. Using the above-mentioned upper bound of $\chi_o$ in terms of $\chi_a$ due to Kostochka, Sopena, and Zhu [KSZ97], with Corollary 4.6 or Corollary 5.3, we get that $M(\chi_o \le t) = O(t^{6+2\lceil\log\log t\rceil})$. We now establish a much better upper bound as a function of $\chi_o$.

**Theorem 5.4.** $M(\chi_o \le t) \le t^2 - 1$.

To prove this theorem, we will need the following lemma.

**Lemma 5.5.** Let $\vec{G}_1, \vec{G}_2$ be two orientations of a graph $G$, and let $(S_1, \dots, S_k)$ be a proper $k$-colouring of $G$ such that for every pair of distinct colours $i, j$, the set $E(S_i, S_j)$ of edges between $S_i$ and $S_j$ is either included in $E_=$, or included in $E_\ne$. Then $\text{dist}_{\mathcal{I}(G)}(\vec{G}_1, \vec{G}_2) \le k - 1$.

*Proof.* We proceed by induction on $k$. For $k = 1$, the result is clear as $G$ has no edge. Now suppose $k \ge 2$. Let $X_{k-1} = S_k \cup \bigcup \{S_i \mid E_\ne \cap E(S_i, S_k) \ne \emptyset\}$, and let $\vec{G}'_1 = \text{Inv}(\vec{G}'_1; X_{k-1}) - S_k$ and $\vec{G}'_2 = \vec{G}_2 - S_k$.

Observe that $(S_1, \dots, S_{k-1})$ is a proper $(k-1)$-colouring of $G - S_k$, and $\vec{G}'_1$ and $\vec{G}'_2$ satisfy the hypothesis of the lemma. Thus, by the induction hypothesis, there exist $X_1, \dots, X_{k-2} \subseteq V(G - S_k)$ such that $\vec{G}'_2 = \text{Inv}(\vec{G}'_1; X_1, \dots, X_{k-2})$. We claim that $\vec{G}'_2 = \text{Inv}(\vec{G}'_1; X_1, \dots, X_{k-1})$. Indeed, for every edge $uv \in E(G)$, if $u \in S_k$ or $v \in S_k$, then $\{u, v\} \subseteq X_{k-1}$ if and only if $uv \in E_\ne$ (by assumption on the colouring). Otherwise $u, v \in V(\vec{G}'_1) = V(\vec{G}'_2)$, and $uv$ is inverted by $X_1, \dots, X_{k-2}$ if and only if it is oriented differently in $\text{Inv}(\vec{G}'_1; X_{k-1})$ and $\vec{G}'_2$. This proves the lemma. $\square$

<figure><img src="image_3.png" /></figure>

We are now ready to give the main proof of Theorem 5.4.
*Proof of Theorem 5.4.* Let $\vec{G}_1, \vec{G}_2$ be two orientations of a graph $G$ with oriented chromatic number $\chi_o(G) = t$. For every $\ell \in \{1, 2\}$, $\vec{G}_i$ has an oriented colouring $(S_1^\ell, \dots, S_t^\ell)$. For every pair $(i, j) \in [t] \times [t]$, let $S_{i,j} = S_i^1 \cap S_j^2$. Observe that, for any two distinct pairs $(i, j)$ and $(i', j')$, the set $E(S_{i,j}, S_{i',j'})$ is either included in $E_=$, or included in $E_\neq$. Hence, by Lemma 5.5, we obtain $\text{dist}_{\mathcal{I}(G)}(\vec{G}_1, \vec{G}_2) \le t^2 - 1$. $\square$

# 6 Better bounds in terms of the maximum degree

The fact that the inversion diameter of a graph is upper bounded by a function of its maximum degree follows from Corollary 3.4 as well as the results established in Section 4. By Theorem 2.3, a complete graph $K$ satisfies $\text{diam}(\mathcal{I}(K)) = \Delta(K)$, so $M(\Delta \le k) \ge k$. We conjecture that equality holds $M(\Delta \le k) = k$.

**Conjecture 6.1.** For every graph $G$, we have $\text{diam}(\mathcal{I}(G)) \le \Delta(G)$.

In this section, we give some evidences for this conjecture to be true. First, in Subsection 6.1, we show that $M(\Delta \le k) \le 2k - 1$ for every positive integer $k$, and that $\text{diam}(\mathcal{I}(G)) \le \Delta(G) + o(\Delta(G))$ for every bipartite graph $G$. In Sections 6.2 and 6.3, we prove $M(\Delta \le 2) = 2$ and $M(\Delta \le 3) \le 4$.

## 6.1 Bounds for arbitrary maximum degree

In this subsection, we prove that $M(\Delta \le k) \le 2k - 1$ for every positive integer $k$, which can be restated as follows.

**Theorem 6.2.** For every graph $G$ with at least one edge, $\text{diam}(\mathcal{I}(G)) \le 2\Delta(G) - 1$.

We need the following lemma.

**Lemma 6.3.** For every positive $\Delta$ with $\Delta \ge 2$, for every integer $d$ with $0 \le d \le \Delta$,

$$2^{2\Delta-1-d} > 1 + (\Delta - d)(2^{\Delta-1} - 1).$$

*Proof.* If $\Delta = d$, we have $2^{2\Delta-1-d} = 2^{\Delta-1} \ge 2 > 1 = 1 + (\Delta - d)(2^{\Delta-1} - 1)$. Otherwise, as $k < 2^k$ holds for every nonnegative integer $k$, we have

$$1 + (\Delta - d)(2^{\Delta-1} - 1) \le (\Delta - d)2^{\Delta-1} < 2^{\Delta-d}2^{\Delta-1} = 2^{2\Delta-1-d}.$$

*Proof of Theorem 6.2.* If $\Delta(G) = 1$, then $\text{diam}(\mathcal{I}(G)) = 1$. Otherwise, let $\Delta = \Delta(G)$ and let $<$ be an arbitrary ordering of $V(G)$. Now consider some $u \in V(G)$ and let $d = |N_>(u)|$. If $N_>(u) \ne \emptyset$, then we have

$$|N_<(u)| + \log(|\{X \subseteq V(G) | \exists v \in N_>(u), X \subseteq N_<(v)\}|) \le d + \log(1 + (\Delta - d)(2^{\Delta-1} - 1)) < 2\Delta - 1 \text{ by Lemma 6.3.}$$

If $N_>(u) = \emptyset$, then $|N_<(u)| \le \Delta - 1 \le 2\Delta - 1$. Hence $G$ is strongly $(2\Delta - 1)$-degenerate, so $\text{diam}(\mathcal{I}(G)) \le 2\Delta - 1$ by Theorem 3.3. $\square$

For bipartite graphs, Theorem 6.2 can be improved as follows.

**Theorem 6.4.** $\text{diam}(\mathcal{I}(G)) \le \Delta + \lceil \log \Delta \rceil - 1$ for every bipartite graph $G$ of maximum degree $\Delta \ge 2$.

*Proof.* Let $t = \Delta + \lceil \log \Delta \rceil - 1$. Let $G$ be a bipartite graph of maximum degree $\Delta$ and let $(A, B)$ be a bipartition of $G$. Let $<$ be an ordering of $V(G)$ such that $a < b$ for every $a \in A$ and $b \in B$. For every $a \in A$ we have $N_<(a) = \emptyset$ and $|\{X \subseteq V(G) | \exists v \in N_>(a), X \subseteq N_<(v)\}| \le 1 + \Delta(2^{\Delta-1} - 1) < \Delta 2^{\Delta-1} \le 2^t$. For every $b \in B$, $|N_<(b)| \le \Delta \le t$ and $|\{X \subseteq V(G) | \exists v \in N_>(b), X \subseteq N_<(v)\}| = 0$. Hence $<$ is a $t$-strong ordering of $G$. Thus, by Theorem 3.3, we have $\text{diam}(\mathcal{I}(G)) \le t$. $\square$
## 6.2 Maximum degree at most 2

We here prove the following result for graphs of maximum degree at most 2.

**Theorem 6.5.** Let $G$ be a graph. If $\Delta(G) \le 2$, then $\text{diam}(\mathcal{I}(G)) \le 2$.

*Proof.* By possibly adding some edges, we can assume that every connected component of $G$ is a cycle or a single edge. Moreover, as $\text{diam}(\mathcal{I}(G))$ is the maximum of $\text{diam}(\mathcal{I}(C))$ over all components $C$ of $G$, and since $\text{diam}(\mathcal{I}(K_2)) = 1$, it is enough to prove the statement for connected components $C$ of $G$ which are a cycle.

Let $\vec{C}_1$ and $\vec{C}_2$ be two orientations of a cycle $C$. First assume that $E_=$ contains two consecutive edges. Let $x$ be the common vertex of those two edges. By Theorem 4.2, there are two sets $X_1$ and $X_2$ of $V(C-x)$ such that $\text{Inv}(\vec{C}_1 - x; X_1, X_2) = \vec{C}_2 - x$. Then $\text{Inv}(\vec{C}_1; X_1, X_2) = \vec{C}_2$.

Now assume that there are no two consecutive edges in $E_$. If $E_ = \emptyset$, then inverting $V(C)$ transforms $\vec{C}_1$ into $\vec{C}_2$. Henceforth, we may assume that $E_ \neq \emptyset$. Let $P_1, P_2, \dots, P_t$ be the connected components of $C \setminus E_$. If $t$ is even, let $X_1 = \bigcup_{i=1}^{t/2} V(P_{2i-1})$ and $X_2 = \bigcup_{i=1}^{t/2} V(P_{2i})$; we have $\text{Inv}(\vec{C}_1; X_1, X_2) = \vec{C}_2$. If $t$ is odd, set $s = \frac{t-1}{2}$ and let $X_1 = \bigcup_{i=0}^{s} V(P_{2i+1})$ and $X_2 = \{x, y\} \cup \bigcup_{i=1}^{s} V(P_{2i})$ where $xy$ is the edge between $P_1$ and $P_t$; we have $\text{Inv}(\vec{C}_1; X_1, X_2) = \vec{C}_2$. $\square$

## 6.3 Subcubic graphs

For subcubic graphs, we can slightly improve on Theorem 6.2. First we need some preliminaries.

Let $G$ be a subcubic multigraph, $\pi: E(G) \to \mathbb{F}_2$ a mapping, and let $\sigma = (v_1, \dots, v_n)$ be an ordering of $V(G)$. We say that a vertex $v_i$ is **bad** for $\sigma$ if there exist $j_1, j_2, j_3$ such that $j_1 \le j_2 < i < j_3$, $v_{j_1}v_i, v_{j_2}v_i$, and $v_{j_3}v_i$ are distinct edges of $E(G)$, and $\pi(v_{j_1}v_i) = \pi(v_{j_2}v_i) = 0$ and $\pi(v_iv_{j_3}) = 1$. The ordering $\sigma$ is **good** if it has no bad vertex. The following result is the main ingredient in the proof of Theorem 6.7.

**Lemma 6.6.** Let $G$ be a subcubic multigraph and $\pi: E(G) \to \mathbb{F}_2$ a mapping. Then there is a good ordering of $V(G)$.

*Proof.* Suppose otherwise and let $(G, \pi)$ be a minimum counterexample to the statement. We say that an edge $e = uv \in E(G)$ is **critical** if $\pi(e) = 1$, $d_G(u) = 3$, $d_G(v) = 3$, $E(G) \setminus e$ does not contain an edge which is parallel to $e$, and $\pi(e') = 0$ for every $e' \in E(G) \setminus e$ which is incident to at least one of $u$ and $v$.

**Claim 6.6.1.** *No edge in $E(G)$ is critical.*

*Proof.* Suppose otherwise, so $E(G)$ contains a critical edge $e_0 = uv$. Let $ut_1$ and $ut_2$, and $vw_1$ and $vw_2$ be the edges distinct from $e$ incident to $u$ and $v$, respectively. Observe that $\{u, v\} \cap \{t_1, t_2, w_1, w_2\} = \emptyset$ by assumption. In the following, we distinguish several cases on the structure of these neighbourhoods, and obtain contradictions which eventually prove the claim. By symmetry, we may suppose that one of the following four cases occurs.

**Case 1.** $t_1 = t_2$ and $w_1 = w_2$.

Let $G'$ be obtained from $G - \{u, v\}$ by adding two edges $e_1, e_2$ linking $t_1$ and $w_1$. We further define $\pi': E(G') \to \mathbb{F}_2$ by $\pi'(e_1) = \pi'(e_2) = 0$ and $\pi'(e) = \pi(e)$ for all $e \in E(G) \cap E(G')$. As $G'$ is subcubic and smaller than $G$, there exists a good ordering $\sigma' = (v_1, \dots, v_{n-2})$ of $V(G')$ with respect to $\pi'$. Let $i, j \in [n-2]$ such that $v_i = t_1$ and $v_j = w_1$. Since $G$ is subcubic, we have $i \neq j$ and by symmetry, we may suppose that $i < j$. Now consider the ordering $\sigma = (v_1, \dots, v_i, v, u, v_{i+1}, \dots, v_{n-2})$. We obtain that none of $t_1, u$, and $v$ are bad in $\sigma$. Furthermore, $w_1$ is not bad in $\sigma$ as $\sigma'$ is a good ordering of $V(G')$ with respect to $\pi'$. Finally, no vertex in $V(G) \setminus \{u, v, t_1, w_1\}$ is bad in $\sigma$ as $\sigma'$ is a good ordering of $V(G')$ with respect to $\pi'$. It follows that $\sigma$ is a good ordering of $V(G)$ with respect to $\pi$, a contradiction to the choice of $(G, \pi)$.

**Case 2.** $t_2 = w_1 = w_2$.

Let $G' = G - \{u, v, t_2\}$ and $\pi' = \pi|_{E(G')}$. As $G'$ is subcubic and smaller than $G$, there exists a good ordering $\sigma' = (v_1, \dots, v_{n-3})$ of $V(G')$ with respect to $\pi'$. Now consider the ordering $\sigma = (v_1, \dots, v_{n-3}, u, v, t_2)$. We obtain that none of $t_1, t_2, u$, and $v$ are bad in $\sigma$. Further, no vertex in $V(G) \setminus \{u, v, t_1, t_2\}$ is bad in $\sigma$ as $\sigma'$ is a good ordering of $V(G')$ with respect to $\pi'$. It follows that $\sigma$ is a good ordering of $V(G)$ with respect to $\pi$, a contradiction to the choice of $(G, \pi)$.
**Case 3.** $w_1 = w_2$ and $t_1, t_2$, and $w_1$ are pairwise distinct.

Let $G'$ be obtained from $G - \{u, v\}$ by adding two edges: $e_1$ with endvertices $t_1, w_1$, and $e_2$ with endvertices $w_2, w_1$. We further define $\pi': E(G') \to \mathbb{F}_2$ by $\pi'(e_1) = \pi'(e_2) = 0$ and $\pi'(e) = \pi(e)$ for all $e \in E(G) \cap E(G')$. As $G'$ is subcubic and smaller than $G$, there exists a good ordering $\sigma' = (v_1, \dots, v_{n-2})$ of $V(G')$ with respect to $\pi'$. Let $i, j, k \in [n-2]$ be such that $v_i = t_1, v_j = t_2$ and $v_k = w_1$. Note that $i, j$, and $k$ are pairwise distinct. By symmetry, we may suppose that $i < j$.

(a) If $i < k < j$, then let $\sigma = (v_1, \dots, v_{k-1}, u, w_1, v, v_{k+1}, \dots, v_{n-2})$.

(b) If $k < i < j$, then let $\sigma = (v_1, \dots, v_{k-1}, u, w_1, v, v_{k+1}, \dots, v_{n-2})$.

(c) If $i < j < k$, then let $\sigma = (v_1, \dots, v_{k-1}, v, u, w_1, v_{k+1}, \dots, v_{n-2})$.

All of these cases are illustrated in Figure 1. Similar arguments as above show that $\sigma$ is a good ordering of $G$ with respect to $\pi$. This contradicts the choice of $(G, \pi)$.

<figure><img src="image_4.png" /><figcaption>Figure 1: Some cases in the proof of Lemma 6.6. The vertices are placed from left to right according to $\sigma$. The edges in $E(G') \setminus E(G)$ and the vertices in $V(G')$ are depicted in red.</figcaption></figure>

**Case 4.** $t_1 \neq t_2$ and $w_1 \neq w_2$.

Let $G'$ be obtained from $G - \{u, v\}$ by adding two edges: $e_1$ with endvertices $t_1, t_2$, and $e_2$ with endvertices $w_1, w_2$. We further define $\pi': E(G') \to \mathbb{F}_2$ by $\pi'(e_1) = \pi'(e_2) = 0$ and $\pi'(e) = \pi(e)$ for all $e \in E(G) \cap E(G')$. As $G'$ is subcubic and smaller than $G$, there exists a good ordering $\sigma' = (v_1, \dots, v_{n-2})$ of $V(G')$ with respect to $\pi'$. Let $i, j, k, \ell \in [n-2]$ be such that $v_i = t_1, v_j = t_2, v_k = w_1$, and $v_\ell = w_2$. Without loss of generality, we may suppose that $i < j, k < \ell$, and $j \le \ell$. If $j < \ell$, then let

$$ \sigma = (v_1, \dots, v_{j-1}, u, t_2, v_{j+1}, \dots, v_{\ell-1}, v, w_2, v_{\ell+1}, \dots, v_{n-2}). $$
<figure><img src="image_5.png" /><figcaption>Figure 2: The case $i < j, k < l, j < l$ in the proof of Lemma 6.6, with vertices placed from left to right according to $\sigma$. Since the relative position of $w_1$ with $t_1$ and $t_2$ is unknown, $w_1$ is placed below. The edges in $E(G') \setminus E(G)$ and the vertices in $V(G')$ are depicted in red.</figcaption></figure>

This case is illustrated in Figure 2. If $j = l$, then observe that $t_2 = w_2$. Let

$$ \sigma = (v_1, \dots, v_{j-1}, u, v, w_2, v_{j+1}, \dots, v_{n-2}). $$

In either case, we obtain that none of $t_1, u, w_1$, and $v$ is bad in $\sigma$. Furthermore, $t_2$ and $w_2$ are not bad in $\sigma$ as $\sigma'$ is a good ordering of $V(G')$ with respect to $\pi'$. Finally, no vertex in $V(G) \setminus \{u, v, t_1, w_1\}$ is bad in $\sigma$ as $\sigma'$ is a good ordering of $V(G')$ with respect to $\pi'$. It follows that $\sigma$ is a good ordering of $V(G)$ with respect to $\pi$, a contradiction to the choice of $(G, \pi)$.

This finishes the proof of the claim.

◇

Let $V_0$ be the set of vertices $v \in V(G)$ with $d_G(v) = 3$ that are incident to exactly one edge in $\pi^{-1}(1)$. Now consider an ordering $\sigma$ of $V(G)$ in which all vertices in $V_0$ are preceded by all vertices in $V(G) \setminus V_0$. Clearly, no vertex in $V(G) \setminus V_0$ is bad in $\sigma$. Now consider some vertex $v \in V_0$ and let $w$ be its unique neighbour such that $\pi(vw) = 1$. By Claim 6.6.1, we obtain that $w \in V(G) \setminus V_0$. By construction, it follows that $w < v$ with respect to $\sigma$. Hence $v$ is not bad with respect to $\sigma$, and it follows that $\sigma$ is a good ordering of $G$ with respect to $\pi$. This contradicts the choice of $(G, \pi)$. □

We now give the main result of this section. The approach is very similar to the one of Theorem 3.3. We use the ordering whose existence is guaranteed by Lemma 6.6 and make some finer case distinctions.

**Theorem 6.7.** Let $G$ be a graph. If $\Delta(G) \le 3$, then $\mathrm{diam}(\mathcal{I}(G)) \le 4$.

*Proof.* Let $G$ be a graph of maximum degree at most 3. Consider a function $\pi: E(G) \to \mathbb{F}_2$. We show that there is a family $(\mathbf{u})_{u \in V(G)}$ of vectors in $\mathbb{F}_2^4$ such that $\pi(uv) = \mathbf{u} \cdot \mathbf{v}$ for every edge $uv \in E(G)$. If there is a vertex $u$ incident only to edges $e$ with $\pi(e) = 0$, then we apply induction on $G - u$ and set $\mathbf{u} = \mathbf{0}$. Now we assume that every vertex of $G$ is incident to at least one edge $e$ with $\pi(e) = 1$.

By Lemma 6.6, there is a good ordering $\sigma = (v_1, \dots, v_n)$ of $G$ with respect to $\pi$. We iteratively construct $\mathbf{v}_1, \dots, \mathbf{v}_n \in \mathbb{F}_2^4$ with the following property for every $i \in [n]$:

1. for every $k > i$, $(\mathbf{v}_j)_{j \le i, v_j \in N(v_k)}$ are linearly independent, and

2. for every edge $v_j v_{j'}$ with $j, j' \le i$, $\mathbf{v}_j \cdot \mathbf{v}_{j'} = \pi(v_j v_{j'})$.

Initially, it suffices to take $\mathbf{v}_1 \ne \mathbf{0}$. Now suppose that $\mathbf{v}_1, \dots, \mathbf{v}_i$ satisfy this invariant for some $i \in [n-1]$. We denote by $d$ the number of neighbours of $v_{i+1}$ in $\{v_1, \dots, v_i\}$. Condition 1 forbids for each neighbour $v_k$ of $v_{i+1}$ with $k > i + 1$ a vector space of dimension at most $3 - 1 = 2$, and so in total, their union $U_1$ has size at most $1 + (3-d)(2^2 - 1)$ and contains $\mathbf{0}$. Condition 2 allows at least $2^{4-d}$ values of $\mathbf{v}_{i+1}$. Indeed, as $(\mathbf{v}_j)_{v_j \in N(v_{i+1}), j \le i}$ are linearly independent, the affine space $U_2$ of the solutions of the system of equations, $\mathbf{v}_j \cdot \mathbf{v}_{i+1} = \pi(v_j v_{i+1})$, for $v_j \in N(v_{i+1})$ with $j \le i$, has dimension at least $4-d$. It is enough to show that there is a vector in $U_2 \setminus U_1$. If $d=0$, we have $|U_2| = 2^4 > 1 + 3 \times 3 \ge |U_1|$. If $d=1$, we obtain $|U_2| = 2^3 > 1 + 2 \times 3 \ge |U_1|$. If $d=3$, then $|U_2| = 2 > 1 \ge |U_1|$. As $G$ is subcubic, it remains to consider the case $d=2$. If $d_G(v_{i+1}) = 2$, we obtain $|U_1| = 0 < 2^2 = |U_2|$. We may hence suppose that there exists a unique neighbour $v_k$ of $v_{i+1}$ with $k > i + 1$. If $v_k$ has a higher-indexed neighbour, then $|U_1| \le 2^1 < 2^2 = |U_2|$. We may hence suppose that $v_k$ has no higher-indexed neighbour. As $v_{i+1}$ is not
bad in $\sigma$ and $v_{i+1}$ is incident to at least one edge in $\pi^{-1}(1)$, $v_{i+1}$ has a neighbour $v_j$ with $j < i + 1$ such that $\pi(v_j v_{i+1}) = 1$. This implies that $0 \notin U_2$, and so $|U_2 \setminus U_1| = |U_2 \setminus (U_1 \setminus \{0\})| \ge 2^2 - 3 > 0$.

In each case, we found $\mathbf{v}_{i+1}$ such that $\mathbf{v}_1, \dots, \mathbf{v}_{i+1}$ satisfies the invariant. At the end of the process, we have $\mathbf{v}_1, \dots, \mathbf{v}_n$ such that for every edge $v_iv_j$, $\mathbf{v}_i \cdot \mathbf{v}_j = \pi(v_iv_j)$. Using Observation 2.2, this proves the theorem. $\square$

It follows from Theorem 2.3 applied to $K_4$ that the bound in Theorem 6.7 cannot be improved further than 3. Quite surprisingly, the following result shows that $K_4$ is not a particular example with this property. Indeed, the inversion diameter of any cubic graph is at least 3.

**Theorem 6.8.** Let $G$ be a graph. If $\delta(G) \ge 3$, then $\mathrm{diam}(\mathcal{I}(G)) \ge 3$.

Hence, a positive answer to the aforementioned problem would show that the inversion diameter of all cubic graphs is exactly 3.

Theorem 6.8 easily follows from the following two lemmas, the latter of which will be reused in Section 8.

**Lemma 6.9.** Let $G$ be a graph. If $\delta(G) \ge 3$, then $G$ has an even cycle.

*Proof.* Let $P$ be a path of maximal length in $G$ and let $y$ be an endvertex of $P$, and let $z$ be its predecessor along $P$. As $P$ is maximal, $N(y) \subseteq V(P)$. For any two vertices $u, v$ of $P$, we denote by $P[u, v]$ the subpath of $P$ with endvertices $u$ and $v$. Let $x_1, x_2 \in V(P)$ be such that $N(y) = \{x_1, x_2, z\}$ with $x_2$ closer to $y$ than $x_1$ in $P$. Consider the three cycles $C_1 = P[x_1, x_2] \cup x_2 y x_1$, $C_2 = P[x_2, y] \cup y x_2$ and $C_3 = P[x_1, y] \cup y x_1$. Observe that $|V(C_1)| + |V(C_2)| = |V(C_3)| + 2$, thus at least one of $|V(C_1)|$, $|V(C_2)|$ or $|V(C_3)|$ is even, and so $G$ has an even cycle. $\square$

**Lemma 6.10.** Let $G$ be a graph that contains an even cycle $C$ with $d_G(v) \ge 3$ for all $v \in V(C)$. Then $\mathrm{diam}(\mathcal{I}(G)) \ge 3$.

*Proof.* Let $C = v_1 v_2 \cdots v_g v_1$. Let $\vec{G}_1, \vec{G}_2$ be two orientations of $G$ that agree on $E(C) \setminus \{v_g v_1\}$, and disagree on all other edges in $E(G)$. Suppose, for the sake of a contradiction, that there is an inversion sequence $(X_1, X_2)$ that transforms $\vec{G}_1$ into $\vec{G}_2$. As $d_G(v) \ge 3$ for all $v \in V(C)$, every vertex in $V(C)$ is incident to an edge of $E_\neq$. Hence $X_1 \cup X_2$ covers $V(C)$.

If $v_i \in X_1 \cap X_2$ for some $i \in \{1, \dots, g-1\}$, then $v_{i+1} \in X_1 \cap X_2$ as $v_iv_{i+1} \in E_=$. Similarly, if $v_i \in X_1 \cap X_2$ for some $i \in \{2, \dots, g\}$, then $v_{i-1} \in X_1 \cap X_2$. Repeatedly applying these arguments, if there is some $i \in \{1, \dots, g-1\}$ with $v_i \in X_1 \cap X_2$, then $v_1, v_2, \dots, v_g \in X_1 \cap X_2$. However, it then follows that $v_g v_1$ is not reversed, a contradiction. Now suppose that no vertex in $V(C)$ belongs to $X_1 \cap X_2$.

Without loss of generality, suppose that $v_1 \in X_1$. For every $i \in [g-1]$ and $j \in [2]$, we have $v_i \in X_j$ if and only if $v_{i+1} \in X_{3-j}$ as $v_iv_{i+1} \in E_=$. Thus, by induction, $v_i \in X_1$ if $i$ odd and $v_i \in X_2$ if $i$ even. In particular, $v_g \in X_2$, but then $v_g v_1$ is not reversed, a contradiction. $\square$

We are now ready to finish the proof of Theorem 6.8.

*Proof of Theorem 6.8.* By Lemma 6.9, $G$ has an even cycle $C$. As $G$ is cubic, we have $d_G(v) \ge 3$ for all $v \in V(C)$. It now follows from Lemma 6.10 that $\mathrm{diam}(\mathcal{I}(G)) \ge 3$. $\square$

# 7 Bounds in terms of treewidth

The treewidth of a graph $G$ is denoted by $\mathrm{tw}(G)$. A formal definition of treewidth can for example be found in [Die05]. In this section, we consider $M(\mathrm{tw} \le t)$, which is the maximum inversion diameter of a graph with treewidth at most $t$. The graphs with treewidth 1 are the forests, so $M(\mathrm{tw} \le 1) = 2$ by Corollary 4.4. We shall prove $t+2 \le M(\mathrm{tw} \le t) \le 2t$ for all $t \ge 2$. We start by proving the upper bound $M(\mathrm{tw} \le t) \le 2t$.

**Theorem 7.1.** $\mathrm{diam}(\mathcal{I}(G)) \le 2 \mathrm{tw}(G)$ for every graph $G$.
Proof. Let $G$ be a graph of treewidth $t$. Let $(T, (B_x)_{x \in V(T)})$ be a tree-decomposition of $G$ of width $t$. Since adding edges does not decrease the inversion diameter, we can assume that for every $x \in V(T)$, $B_x$ induces a complete graph in $G$. Root $T$ on an arbitrary vertex, and consider an ordering $<$ of $V(G)$ satisfying the following condition: for every pair $u, v$ of vertices, if the root of the subtree of $T$ induced by $\{y \in V(T) \mid u \in B_y\}$ is an ancestor of the root of the subtree induced by $\{y \in V(T) \mid v \in B_y\}$, then $u < v$. One can easily check that such an ordering $<$ exists and that for every vertex $u$, if $x$ is the root of the subtree induced by $\{y \in V(T) \mid u \in B_y\}$, then

1. $N_{<}(u) \subseteq B_x \setminus \{u\}$, and

2. for every $v \in N_{>}(u)$, $N_{<}(v) \subseteq B_x \setminus \{u\}$.

First suppose that $N_{>}(u) \neq \emptyset$. We show that if $|B_x| = t+1$, then there is no vertex $v \in N_{>}(u)$ such that $B_x \setminus \{u\} \subseteq N(v)$. Otherwise, let $x' \in V(T)$ be the node at which the subtree induced by $\{x \in V(T) \mid v \in B_x\}$ is rooted. As $vw \in E(G)$ for all $w \in B_x$, we obtain $B_x \subseteq B_{x'}$, so $|B_{x'}| \geq |B_x| + 1 = t + 2$, a contradiction. We deduce that

$$|\{X \subseteq V(G) \mid \exists v \in N(u), v > u, X \subseteq N_{<u}(v)\}| \leq 2^t - 1$$

and so

$$|N_{<}(u)| + \log(|\{X \subseteq V(G) \mid \exists v \in N(u), v > u, X \subseteq N_{<u}(v)\}|) \leq t + \log(2^t - 1) < 2t.$$

If $N_{>}(u) = \emptyset$, then $|N_{<}(u)| \leq t \leq 2t$. Hence $G$ is 2t-strongly-degenerate and the result follows from Theorem 3.3. □

For the lower bound, observe that $M(\text{tw} \leq t) \geq t$ can be easily proven by combining Theorem 2.3 applied to complete graph $K_t$ with the well-known fact that $\text{tw}(K_t) = t-1$ for every $t \geq 2$. Somewhat surprisingly, it turns out that complete graphs are not tight examples. Indeed, we slightly improve this lower bound, showing that $M(\text{tw} \leq t) \geq t+2$ for every $t \geq 2$. First we need a few well-known results about treewidth.

**Proposition 7.2.**

(i) Let $G$ be a graph of treewidth at least 2 and let $u, v, w \in V(G)$ with $uv, uw, vw \in E(G)$ and $d_G(u) = 2$. Then $\text{tw}(G) = \text{tw}(G - u)$.

(ii) Let $G_1, G_2$ be graphs, $v_i \in V(G_i)$ for $i \in [2]$, and let $G$ be obtained from $G_1$ and $G_2$ by identifying $v_1$ and $v_2$. Then $\text{tw}(G) = \max\{\text{tw}(G_1), \text{tw}(G_2)\}$.

(iii) Let $G$ be a graph and $v \in V(G)$. Then $\text{tw}(G - v) \geq \text{tw}(G) - 1$. Moreover, if $v$ is adjacent to all vertices in $V(G) - v$ in $G$, then equality holds.

We further need the following definition. Given a vector $v$ in $\mathbb{F}_2^t$ for some positive integer $t$, its support is the number of its coordinates whose value is 1.

The proof of the lower bound on $M(\text{tw} \leq t)$ for $t \geq 2$ is by induction on $t$. The following construction for $t = 2$ will serve as the base case.

**Proposition 7.3.** There is a graph $G$ with treewidth 2 such that $\text{diam}(\mathcal{I}(G)) \geq 4$.

Proof. Consider the gadgets $G_1(x, y)$, $G_2(x, y)$ and $G_3(x)$ depicted in Figure 3. The label functions $\pi_1, \pi_2, \pi_3$ mapping the edges of $G_1(x, y)$, $G_2(x, y)$, and $G_3(x)$, respectively, to $\mathbb{F}_2$ can also be found in Figure 3. For every $i \in [3]$, we say that a family $(\mathbf{u})_{u \in V(G_i)}$ of vectors over $\mathbb{F}_2$ satisfies $(G_i, \pi_i)$ if $\pi_i(uv) = \mathbf{u} \cdot \mathbf{v}$ for every $uv \in E(G_i)$. The following observations can be easily checked.

* For every family $(\mathbf{u})_{u \in V(G_1(x, y))}$ of vectors in $\mathbb{F}_2^3$ satisfying $(G_1(x, y), \pi_1)$, we have $\mathbf{x} \neq \mathbf{y}$.

* For every family $(\mathbf{u})_{u \in V(G_2(x, y))}$ of vectors in $\mathbb{F}_2^3$ satisfying $(G_2(x, y), \pi_2)$, if $\mathbf{x}, \mathbf{y} \neq \mathbf{0}$, then $\mathbf{x} + \mathbf{y} \neq (1, 1, 1)$.

* For every family $(\mathbf{u})_{u \in V(G_3(x))}$ of vectors in $\mathbb{F}_2^3$ satisfying $(G_3(x), \pi_3)$, we have $\mathbf{x} \neq (1, 1, 1)$.
Now consider the graph $G$ with the function $\pi: E(G) \to \mathbb{F}_2$ depicted on Figure 3d. We claim that $\text{diam}(\mathcal{I}(G)) > 3$. Suppose for the sake of a contradiction that there is a family $(\mathbf{u})_{u \in V(G_1(x,y))}$ of vectors in $\mathbb{F}_2^3$ satisfying the constraints $\mathbf{u} \cdot \mathbf{v} = \pi(uv)$ for every edge $uv$. By the previous observations, we have $(1, 1, 1) \notin \{\mathbf{a}, \mathbf{b}, \mathbf{c}, \mathbf{d}\}$, $\mathbf{a} \neq \mathbf{c}$ and $\mathbf{b} \neq \mathbf{d}$. Since every vertex in $\{a, b, c, d\}$ is incident to an edge $e$ with $\pi(e) = 1$, we also have $(0, 0, 0) \notin \{\mathbf{a}, \mathbf{b}, \mathbf{c}, \mathbf{d}\}$.

By the above observations, we obtain that the support of **b** is either 1 or 2. If **b** has support 1, say **b** = (1, 0, 0), then **c** ∈ {(1, 1, 0), (1, 0, 1), (1, 0, 0)} as $\pi(bc) = 1$ and $\mathbf{c} \neq (1, 1, 1)$. If **c** = (1, 0, 0), we obtain $0 = \pi(bd) = \mathbf{b} \cdot \mathbf{d} = \mathbf{c} \cdot \mathbf{d} = \pi(cd) = 1$, a contradiction. This yields $\mathbf{c} \in \{(1, 1, 0), (1, 0, 1)\}$ and so **c** has support 2. Symmetrically, if **c** has support 1, then **b** has support 2. We conclude that either **b** or **c** has support 2. Without loss of generality, suppose that **b** has support 2 and **b** = (1, 1, 0). Since $\mathbf{b} \cdot \mathbf{d} = 0$, we have $\mathbf{d} \in \{(0, 0, 0), (0, 0, 1), (1, 1, 0), (1, 1, 1)\}$. However, by the above observations, we have $\mathbf{d} \notin \{(0, 0, 0), (1, 1, 1)\}$, $\mathbf{b} \neq \mathbf{d}$, and $\mathbf{b} + \mathbf{d} \neq (1, 1, 1)$, and so $\mathbf{d} \notin \{(0, 0, 0), (0, 0, 1), (1, 1, 0), (1, 1, 1)\}$, a contradiction.

Thus $\text{diam}(\mathcal{I}(G)) > 3$ by Observation 2.2. Further, as $G$ is not a tree and repeatedly applying Proposition 7.2 (i) and (ii), we obtain that $G$ has treewidth 2. This proves the proposition. $\square$

<figure><img src="image_6.png" /><figcaption>Figure 3: Construction of a graph with treewidth 2 and inversion diameter 4.</figcaption></figure>

We now show that more generally there are graphs of treewidth $t$ and inversion diameter $t+2$, for every $t \ge 2$. First we need the following lemma. Given a vector $\mathbf{u} \in \mathbb{F}_2^t$, we denote by $\mathbf{u}^{\perp}$ the subspace $\{\mathbf{v} \in \mathbb{F}_2^t | \mathbf{u} \cdot \mathbf{v} = 0\}$.

In order to extend the lower bound for arbitrary values of $t$, we need the following result. For some positive integer $t$, a basis $(\mathbf{x}_1, \dots, \mathbf{x}_t)$ of $\mathbb{F}_2^t$ is called *orthogonal* if $\mathbf{x}_i \cdot \mathbf{x}_i = 1$ holds for all $i \in [t]$ and $\mathbf{x}_i \cdot \mathbf{x}_j = 0$ holds for all distinct $i, j \in [t]$.

**Lemma 7.4.** Let $t$ be an integer such that $t \ge 2$. Let $\mathbf{u}$ be a vector in $\mathbb{F}_2^t$ whose support is odd and different from $t$. Then the subspace $\mathbf{u}^{\perp}$ has an orthogonal basis. In particular, there are at most $2^{t-1}+1$ vectors $\mathbf{u}$ in $\mathbb{F}_2^t$ such that $\mathbf{u}^{\perp}$ does not admit an orthogonal basis.

*Proof.* Let $\ell$ be the support of $\mathbf{u}$. Without loss of generality, $\mathbf{u} = (1, \dots, 1, 0, \dots, 0)$. Let $J_\ell$ be the $(\ell+1) \times (\ell+1)$ matrix all of whose entries are 1 except those on the anti-diagonal, that is $(J_\ell)_{i,j} = 0$ if
and only if $i = \ell + 2 - j$ for every $i, j \in [\ell + 1]$. Since $\ell$ is odd, we have $J_{\ell}^2 = I_{\ell+1}$. Then the matrix

$$M = \begin{pmatrix} J_{\ell} & 0 \\ 0 & I_{t-\ell-1} \end{pmatrix}$$

is such that $M^2 = I_t$ and its first column is $\mathbf{u}$. Hence the columns of $M$ form an orthogonal basis of $\mathbb{F}_2^t$ containing $\mathbf{u}$. Therefore the family of columns obtained from the columns of $M$ by deleting the first one forms an orthogonal basis of $\mathbf{u}^{\perp}$. $\square$

We are now ready to prove the following restatement of the fact that $M(\text{tw} \le t) \ge t + 2$.

**Theorem 7.5.** For every $t \ge 2$, there is a graph $G_t$ of treewidth $t$ such that $\text{diam}(\mathcal{I}(G)) \ge t + 2$.

*Proof.* We proceed by induction on $t$. For $t = 2$, the result follows from Proposition 7.3. Now assume $t \ge 3$. By the induction hypothesis and Observation 2.2, there is a graph $G_{t-1}$ with $\text{tw}(G_{t-1}) = t - 1$ and a function $\pi_{t-1}: E(G_{t-1}) \to \mathbb{F}_2$ such that there is no family of vectors $(\mathbf{z})_{z \in V(G_{t-1})}$ in $\mathbb{F}_2^t$ such that $\pi_{t-1}(yz) = \mathbf{y} \cdot \mathbf{z}$ for every edge $yz \in E(G_{t-1})$.

We now construct $G_t$ as follows. We first let $V(G_t)$ contain $t$ vertices $v_1, \dots, v_t$. Then, for every $\mathbf{x} \in \mathbb{F}_2^t$, we add a vertex $w_{\mathbf{x}}$ adjacent to all vertices in $\{v_1, \dots, v_t\}$ and we set $\pi(v_i w_{\mathbf{x}}) = \mathbf{x}_i$ for every $i \in [t]$. Moreover, for every $i \in [t]$ and $\mathbf{x} \in \mathbb{F}_2^t$, we add a vertex $a_{i, \mathbf{x}}$ with adjacent to $v_i$ and $w_{\mathbf{x}}$, and set $\pi(a_{i, \mathbf{x}} v_i) = 0$ and $\pi(a_{i, \mathbf{x}} w_{\mathbf{x}}) = 1$. Finally, for every $b \in B$, we add a copy $G_b$ of $G_{t-1}$ with the labels $\pi_{t-1}$ and, for all $z \in V(G_b)$, we add the edge $bz$ and set $\pi(bz) = 0$ where $B = \{v_1, \dots, v_t\} \cup \{w_{\mathbf{x}}\}_{\mathbf{x} \in \mathbb{F}_2^t}$.

We first show that the treewidth of $G_t$ is as desired.

**Claim 7.5.1.** $\text{tw}(G_t) = t$.

*Proof.* As $\text{tw}(G_{t-1}) = t - 1$ and by Proposition 7.2 (iii), we have $\text{tw}(G_t[V(G_b) \cup \{b\}]) = t$ for all $b \in B$. By Proposition 7.2 (ii), we obtain $\text{tw}(G_t) \ge t$ and $\text{tw}(G_t) = \max\{t, \text{tw}(G_t - \bigcup_{b \in B} V(G_b))\}$. Next, as $G_t[B]$ is not a tree, we obtain that $\text{tw}(G_t - \bigcup_{b \in B} V(G_b)) = \text{tw}(G_t[B])$ by Proposition 7.2 (i). Then, by Proposition 7.2 (iii), we obtain $\text{tw}(G_t[B]) \le \text{tw}(G_t[B - \{v_1, \dots, v_t\}]) + t$. As $B - \{v_1, \dots, v_t\}$ is an independent set in $G_t$, we obtain $\text{tw}(G_t[B]) \le t$. This yields $\text{tw}(G_t) = \max\{t, \text{tw}(G_t - \bigcup_{b \in B} V(G_b))\} = t$. $\diamond$

Suppose for the sake of a contradiction that there is a family $(\mathbf{u})_{u \in V(G_t)}$ of vectors in $\mathbb{F}_2^{t+1}$ such that $\pi(yz) = \mathbf{y} \cdot \mathbf{z}$ for every edge $yz$ of $G_t$.

**Claim 7.5.2.** The vectors $(\mathbf{b})_{b \in B}$ are pairwise distinct.

*Proof.* First consider some distinct $\mathbf{x}, \mathbf{x}' \in \mathbb{F}_2^t$. Then there exists some $i \in [t]$ such that $\mathbf{x}_i \ne \mathbf{x}'_i$. If $\mathbf{w}_{\mathbf{x}} = \mathbf{w}_{\mathbf{x}'}$, we obtain $\pi(w_{\mathbf{x}} v_i) = \mathbf{w}_{\mathbf{x}} \mathbf{v}_i = \mathbf{w}_{\mathbf{x}'} \mathbf{v}_i = \pi(w_{\mathbf{x}'} v_i)$, a contradiction to the construction.

Now consider some distinct $i, j \in [t]$ and some $\mathbf{x} \in \mathbb{F}_2^t$ with $\mathbf{x}_i \ne \mathbf{x}_j$. If $\mathbf{v}_i = \mathbf{v}_j$, we obtain $\pi(w_{\mathbf{x}} v_i) = \mathbf{w}_{\mathbf{x}} \mathbf{v}_i = \mathbf{w}_{\mathbf{x}} \mathbf{v}_j = \pi(w_{\mathbf{x}} v_j)$, a contradiction to the construction.

Finally consider some $i \in [t]$ and $\mathbf{x} \in \mathbb{F}_2^t$. If $\mathbf{v}_i = \mathbf{w}_{\mathbf{x}}$, we obtain $\pi(v_i a_{i, \mathbf{x}}) = \mathbf{v}_i \mathbf{a}_{i, \mathbf{x}} = \mathbf{w}_{\mathbf{x}} \mathbf{a}_{i, \mathbf{x}} = \pi(w_{\mathbf{x}} a_{i, \mathbf{x}})$, a contradiction to the construction. $\diamond$

As $|B| = 2^t + t > 2^t + 1$, by Claim 7 and by Lemma 7.4, there exists $b \in B$ such that $\mathbf{b}^{\perp}$ has an orthogonal basis $\mathbf{x}_1, \dots, \mathbf{x}_t$. Now, for every $z \in V(G_b)$, we have $\mathbf{z} \in \mathbf{b}^{\perp}$ and so there are scalars $z_1, \dots, z_t$ in $\mathbb{F}_2$ such that $\mathbf{z} = \sum_{i=1}^t z_i \mathbf{x}_i$. Let $\mathbf{z}' = (z_1, \dots, z_t) \in \mathbb{F}_2^t$ for every $z \in V(G_b)$. Then, as $\mathbf{x}_1, \dots, \mathbf{x}_t$ is an orthogonal basis of $\mathbf{b}^{\perp}$, for every edge $yz \in E(G_b)$, we have

$$ \begin{aligned} \mathbf{y}' \cdot \mathbf{z}' &= \sum_{i \in [t]} y_i z_i \\ &= \sum_{i,j \in [t], i \ne j} y_i z_j \mathbf{x}_i \cdot \mathbf{x}_j + \sum_{i \in [t]} y_i z_i \mathbf{x}_i \cdot \mathbf{x}_i \\ &= \sum_{i \in [t]} y_i \mathbf{x}_i \cdot \sum_{j \in [t]} z_j \mathbf{x}_j \\ &= \mathbf{y} \cdot \mathbf{z} \\ &= \pi(yz). \end{aligned} $$
This contradicts the assumption on $G_{t-1}$.

Thus, by Observation 2.2, we have $\text{diam}(\mathcal{I}(G_t)) > t + 1$. Since $G_t$ has treewidth $t$ by Claim 7.5.1, this proves the theorem. $\square$

# 8 $K_t$-minor-free and planar graphs

This section is dedicated to proving the results guaranteeing small inversion diameter for graphs contained in certain minor-closed classes. It was proven by van den Heuvel at al. [vdHOdMQ$^{+17}$] that for every $t \ge 4$ and every $K_t$-minor-free graph $G$, we have $\chi_s(G) \le 5(\binom{t}{2})(t-3)$. Together with Corollary 4.6, we obtain the following result.

**Corollary 8.1.** For every proper minor-closed class $G$ of graphs, there exists a constant $\alpha_G$ such that $\text{diam}(\mathcal{I}(G)) \le \alpha_G$ for every $G \in \mathcal{G}$.

Hence proper minor-closed families have bounded inversion diameter. In the remainder of this section, we prove more precise bounds for some particular minor-closed classes.

## 8.1 $K_t$-minor-free graphs

In this section, we deal with $K_t$-minor-free graphs. To do so, we will use known bounds on strong colouring numbers. By the length of a path, we refer to its number of edges. Given a graph $G$, an ordering $<$ of its vertices, an integer $r \ge 0$, and $u, v \in V(G)$, we say that $v$ is r-strongly reachable from $u$ in $G$ for $<$ if there is a path $P$ from $u$ to $v$ of length at most $r$ such that $V(P) \cap \{w \in V(G) | w \le u\} = \{u, v\}$. Note that $u$ is r-strongly reachable from $u$. We denote by SReach$_r[G, <, u]$ the set of all vertices in $G$ r-strongly reachable from $u$ in $G$ for $<$.

**Theorem 8.2 ([vdHOdMQ$^{+17}$]).** For every integer $t \ge 3$ and for every $K_t$-minor-free graph $G$, there is an ordering $<$ of $V(G)$ such that

$$|\text{SReach}_r[G, <, u]| \le \binom{t-1}{2}(2r+1)$$

for every nonnegative integer $r$ and every vertex $u \in V(G)$.

Note that in [vdHOdMQ$^{+17}$], this theorem is stated without specifying that $<$ does not depend on $r$. However, this fact follows from the proof.

Together with Theorem 3.3, Theorem 8.2 implies the following.

**Corollary 8.3.** Let $t$ be an integer with $t \ge 3$. For every $K_t$-minor-free graph $G$,

$$\text{diam}(\mathcal{I}(G)) \le 8\binom{t-1}{2}.$$

*Proof.* Let $<$ be an ordering of $V(G)$ as in Theorem 8.2. For every vertex $u$ of $G$ we have

1. $|N_<(u)| \le 3(\binom{t-1}{2} - 1)$, and

2. $|\{X \subseteq V(G) | \exists v \in N(u), u < v, X \subseteq \{w \in N(v) | w < u\}\}| \le 2^5(\binom{t-1}{2})$.

Hence $G$ is strongly $8(\binom{t-1}{2})$-degenerate and so $\text{diam}(\mathcal{I}(G)) \le 8(\binom{t-1}{2})$ by Theorem 3.3. $\square$

## 8.2 Planar graphs

### 8.2.1 General bound

A planar graph is $K_5$-minor-free, so by Corollary 8.3, its inversion diameter is at most 48. A planar graph has acyclic chromatic number at most 5 as shown by Borodin [Bor79]. Thus, by Corollary 5.3, its inversion diameter is at most 18. We shall improve on this bound by showing that $\text{diam}(\mathcal{I}(G)) \le 12$ for every planar graph $G$. This bound is obtained by using the following result establishing the existence of an ordering $<$ such that SReach$_r[G, <, u]$ has small size for every $u$.<fnref n="2" />

<footnote n="2">²As in Theorem 8.2, the statement in [vdHOdMQ$^{+17}$] of Theorem 8.4 does not specify that the ordering $<$ is the same for every $r$. However, this fact follows from the proof.</footnote>
**Theorem 8.4 ([vdHOdMQ+17]).** For every planar graph $G$, there is an ordering $<$ of $V(G)$ such that

$$|SReach_r[G, <, u]| \le 5r + 1$$

for every vertex $u \in V(G)$ and every nonnegative integer $r$.

**Corollary 8.5.** $\text{diam}(\mathcal{I}(G)) \le 12$ for every planar graph $G$.

*Proof.* Let $<$ be an ordering of $V(G)$ as in Theorem 8.4. Let $u \in V(G)$. Let $A = \{u\} \cup \bigcup_{v \in N_>(u)} N_{<u}(v) \subseteq SReach_2[G, <, u]$ and $B = N_>(u)$. Consider the bipartite graph $H$ with bipartition $(A, B)$ and with edges inherited from $G$. Let $H' = (A, B', E')$ be the graph obtained from $H$ by removing vertices of degree at most 2 in $B$. Observe that $H'$ is a subgraph of $G$ and hence planar. Moreover, as $H'$ is bipartite, we obtain that the girth of $H'$ is at least 4. It hence follows from Euler's formula that $m(H') = \sum_{a \in A} d_{H'}(a) = \sum_{b \in B'} d_{H'}(b) \le 2(|A| + |B'|) - 4$. Moreover, every vertex in $B'$ has degree at most 5, and has $u$ as a neighbour. For $i \in \{2, 3, 4\}$, let $d_i$ be the number of vertices in $B'$ of degree $i+1$ in $H'$. Then we have

$$|\{X \subseteq V(G) \mid \exists v \in N(u), u < v, X \subseteq N_{<u}(v)\}| \le 1 + \binom{10}{1} + \binom{2}{2}d_2 + \binom{3}{2 \le \cdot \le 3}d_3 + \binom{4}{2 \le \cdot \le 4}d_4$$

using the notation $\binom{n}{k_1 \le \cdot \le k_2}$

$$3d_2 + 4d_3 + 5d_4 \le m(H') \le 2(|A| + |B'|) - 4 \le 2(11 + d_2 + d_3 + d_4) - 4.$$

We deduce

$$d_2 + 2d_3 + 3d_4 \le 18$$

and so

$$d_2 + 4d_3 + 11d_4 \le \frac{11}{3}(d_2 + 2d_3 + 3d_4) \le 66.$$

Finally we have

$$|\{X \subseteq V(G) \mid \exists v \in N(u), u < v, X \subseteq N_{<u}(v)\}| \le 11 + d_2 + 4d_3 + 11d_4 \le 77.$$

Therefore,

$$1. |\{v \in N(u) \mid v < u\}| \le 5 \text{ and}$$

$$2. |\{X \subseteq V(G) \mid \exists v \in N(u), u < v, X \subseteq N_{<u}(v)\}| \le 77 < 2^7,$$

and it follows that $G$ is 12-strongly-degenerate and so $\text{diam}(\mathcal{I}(G)) \le 12$ by Theorem 3.3. $\square$

For the lower bound on the maximum inversion diameter of a planar graph, we executed a computer search. As a result, we found a planar graph whose inversion diameter is at least 5.

**Proposition 8.6.** If $G$ if the planar graph depicted on Figure 4, then $\text{diam}(\mathcal{I}(G)) \ge 5$.

### 8.2.2 Planar graphs of large girth

We now examine to which extent the upper bounds on the inversion diameter of a planar graph can be improved assuming a large girth. The **girth** of a graph is defined to be the length of its shortest cycle. Borodin et al. [BKW99] proved that a planar graph has acyclic chromatic number at most 4 (resp. 3) if it has girth at least 5 (resp. 7). With Corollary 5.3, this yields the following.

**Corollary 8.7.** Let $G$ be a planar graph.

* If $G$ has girth at least 5, then $\text{diam}(\mathcal{I}(G)) \le 10$.

* If $G$ has girth at least 7, then $\text{diam}(\mathcal{I}(G)) \le 6$.

In the remainder of this subsection, we show that sufficiently large girth guarantees that a planar graph has inversion diameter at most 3.
<figure><img src="image_7.png" /><figcaption>Figure 4: A planar graph $G$ with inversion diameter at least 5. More precisely, if $\pi: E(G) \to \mathbb{F}_2$ is the labelling function depicted, then there is no family $(\mathbf{u})_{u \in V(G)} \in \mathbb{F}_2^4$ such that $\pi(uv) = \mathbf{u} \cdot \mathbf{v}$ for every $uv \in E(G)$.</figcaption></figure>

**Theorem 8.8.** Let $G$ be a planar graph. If $G$ has girth at least 8, then $\text{diam}(\mathcal{I}(G)) \le 3$.

Inversion diameter 3 is the smallest that a girth condition can guarantee for a planar graph as shown by the following proposition.

**Proposition 8.9.** For every even positive integer $g$, there is a bipartite planar graph $G$ with girth $g$ such that $\text{diam}(\mathcal{I}(G)) \ge 3$.

*Proof.* Let $G$ be the graph obtained from a cycle on $g$ vertices $C = v_1v_2\cdots v_g$ by adding for every vertex $v \in V(C)$ a new vertex $w_v$ adjacent uniquely to $v$. By construction, we have $d_G(v) \ge 3$ for all $v \in V(C)$. We hence obtain $\text{diam}(\mathcal{I}(G)) \ge 3$ by Lemma 6.10. $\square$

In fact, we shall prove a result on graphs of maximum average degree at most $2 + \frac{8}{11}$ which implies Theorem 8.8 using the following well-known bound on the maximum average degree of planar graphs of large girth.

**Lemma 8.10 (Folklore).** If $G$ is a planar graph with girth at least $g$, then $\text{Mad}(G) < 2 + \frac{4}{g-2}$.

The proof of this lemma, which is a direct application of Euler's formula, is left to the reader. By Lemma 8.10, in order to prove Theorem 8.8, it is sufficient to prove that if $\text{Mad}(G) < 2 + \frac{2}{3}$ then $\text{diam}(\mathcal{I}(G)) \le 3$. We shall in fact prove the following stronger result.

**Theorem 8.11.** Let $G$ be a graph. If $\text{Mad}(G) \le 2 + \frac{8}{11}$, then $\text{diam}(\mathcal{I}(G)) \le 3$.

Let $G$ be a graph, and $k$ a positive integer. A $k$-vertex (resp. $(\ge k)$-vertex, $(\le k)$-vertex) is a vertex with degree $k$ (resp. at least $k$, at most $k$).

Let $G$ be a graph and let $\pi: E(G) \to \mathbb{F}_2$. For every positive integer $d$, a $(G, \pi)$-realisation of dimension $d$ is a family $(\mathbf{u})_{u \in V(G)}$ of vectors in $\mathbb{F}_2^d$ such that for every edge $uv$ of $G$, we have $\pi(uv) = \mathbf{u} \cdot \mathbf{v}$. A $(G, \pi)$-realisation is **strict** if $\mathbf{u} \ne \mathbf{0}$ for every $u \in V(G)$. Hence, Observation 2.2 can be rephrased as follows: $\text{diam}(\mathcal{I}(G)) \le d$ if and only if for every $\pi: E(G) \to \mathbb{F}_2$, there is a $(G, \pi)$-realisation of dimension $d$.

If $H$ is a subgraph of $G$, we abbreviate an $(H, \pi|_{E(H)})$-realisation to an $(H, \pi)$-realisation. We further say that a $(G, \pi)$-realisation ** extend s** an $(H, \pi)$-realisation if the two realisations coincide on $V(H)$.

The proof of Theorem 8.11 uses the Discharging Method. However, instead of choosing a minimum counterexample to our main result, we choose a minimum counterexample to the slightly stronger result that no strict $(G, \pi)$-realisation exists for the given instance. We first present a collection of structural properties. As some of these results need to be proved in a slightly stronger form in order to be reused
later, we give them in a form describing when certain realisations can be extended rather than explicitly speaking about a minimum counterexample. These structural results are contained in Lemmas 8.12 to 8.17. After, we give the main proof of Theorem 8.11 in the form of a discharging procedure.

We first deal with 1-vertices.

**Lemma 8.12.** Let $G$ be a graph, let $\pi: E(G) \to \mathbb{F}_2$ and let $v$ a 1-vertex in $G$. Any strict $(G - v, \pi)$-realisation of dimension 3 can be extended into three different strict $(G, \pi)$-realisations of dimension 3.

*Proof.* Let $u$ be the unique neighbour of $v$. Since $u \neq 0$, the solutions $v$ of the equation $u \cdot v = \pi(uv)$ form an affine space of dimension $3 - 1 = 2$. Thus, there are at least $2^2 = 4$ vectors $v$ such that $u \cdot v = \pi(uv)$. Since at most one of them is $0$, we obtain at least 3 extensions. $\square$

We now show that the configurations when a realisation cannot be extended to a 2-vertex are very restricted.

**Lemma 8.13.** Let $G$ be a graph, let $\pi: E(G) \to \mathbb{F}_2$, and let $v$ be a 2-vertex in $G$ with neighbours $u_1$ and $u_2$. A strict $(G - v, \pi)$-realisation $(\mathbf{u})_{u \in V(G - v)}$ can be extended into a strict $(G, \pi)$-realisation unless $\mathbf{u}_1 = \mathbf{u}_2$ and $\pi(u_1 v) \neq \pi(u_2 v)$.

*Proof.* If $\mathbf{u}_1 \neq \mathbf{u}_2$, then $\mathbf{u}_1, \mathbf{u}_2$ are linearly independent. This implies that the affine space of the solutions $v$ of

$$ \left\{ \begin{array}{l} \mathbf{u}_1 \cdot \mathbf{v} = \pi(u_1 v) \\ \mathbf{u}_2 \cdot \mathbf{v} = \pi(u_2 v) \end{array} \right. $$

is non empty and has dimension $3 - 2 = 1$. Hence there is a solution $v$ which is not $0$.

Now suppose $\mathbf{u}_1 = \mathbf{u}_2$ and $\pi(u_1 v) = \pi(u_2 v)$. Since $\mathbf{u}_1 \neq 0$, there is a vector $v$ such that $\mathbf{u}_1 \cdot \mathbf{v} = \mathbf{u}_2 \cdot \mathbf{v} = \pi(u_1 v) = \pi(u_2 v)$. This proves the lemma. $\square$

We are now ready to exclude the existence of two adjacent 2-vertices in a minimum counterexample.

**Lemma 8.14.** Let $G$ be a graph, $\pi: E(G) \to \mathbb{F}_2$, and $v_1, v_2$ two adjacent 2-vertices in $G$. Any strict $(G - \{v_1, v_2\}, \pi)$-realisation of dimension 3 can be extended into a strict $(G, \pi)$-realisation.

*Proof.* Let $(\mathbf{u})_{u \in V(G - \{v_1, v_2\})}$ be a $(G - \{v_1, v_2\}, \pi)$-realisation of dimension 3. Let $u_1$ (resp. $u_2$) be the neighbour of $v_1$ (resp. $v_2$) distinct from $v_2$ (resp. $v_1$). By Lemma 8.12, there are three possible non-zero vectors $v_1$ that extend the realisation $(\mathbf{u})_{u \in V(G - \{v_1, v_2\})}$ to $G - v_2$. So one can assign $v_1$ so that $v_1 \neq \mathbf{u}_2$. Then, by Lemma 8.13, there is a choice of $v_2$ that extends the realisation to $G$. $\square$

We use $N[v]$ to denote the closed neighbourhood of $v$, that is, the set containing $v$ and all its neighbours.

The next result shows that, in a minimum counterexample, every vertex that is adjacent only to 2-vertices is of degree at least 7.

**Lemma 8.15.** Let $G$ be a graph, let $\pi: E(G) \to \mathbb{F}_2$, and let $v$ be a $d$-vertex for some $d \le 6$ adjacent to $d$ 2-vertices in $G$. Any strict $(G - N[v], \pi)$-realisation of dimension 3 can be extended into a strict $(G, \pi)$-realisation of dimension 3.

*Proof.* Let $N(v) = \{u_1, \dots, u_d\}$ and, for all $i \in [d]$, let $t_i$ be the neighbour of $u_i$ distinct from $v$. Choose $v \in \mathbb{F}_2^3 \setminus \{0\}$ such that $v \notin \{\mathbf{t}_1, \dots, \mathbf{t}_d\}$. This is possible because there are seven non-zero vectors in $\mathbb{F}_2^3$ and $d \le 6$. Then, by Lemma 8.13, there is a choice of $\mathbf{u}_1, \dots, \mathbf{u}_d$ that extends the realisation $(\mathbf{u})_{u \in V(G - N(v))}$ to $G$. $\square$

We now turn to the 3-vertices. We first deal with the case that a 3-vertex is adjacent to two 2-vertices.

**Lemma 8.16.** Let $G$ be a graph, $\pi: E(G) \to \mathbb{F}_2$, and $v$ be a 3-vertex adjacent to two 2-vertices $u_1$ and $u_2$ in $G$. Any strict $(G - \{v, u_1, u_2\}, \pi)$-realisation $(\mathbf{u})_{u \in V(G - \{v, u_1, u_2\})}$ of dimension 3 can be extended into a strict $(G, \pi)$-realisation of dimension 3.
**Proof.** Let $t_1$ (resp. $t_2$) be the neighbour of $u_1$ (resp. $u_2$) distinct from $v$. By Lemma 8.12, there are three possible non-zero vectors $\mathbf{v}$ in $\mathbb{F}_2^3$ with which we can extend the realisation to $G - \{u_1, u_2\}$. So one can choose $\mathbf{v}$ among them so that $\mathbf{v} \notin \{\mathbf{t}_1, \mathbf{t}_2\}$. Then, by Lemma 8.13, there is a choice of $\mathbf{u}_1, \mathbf{u}_2$ that extends the realisation $(\mathbf{u})_{u \in V(G - \{u_1, u_2\})}$ to $G$. $\square$

A deficient vertex is a 3-vertex having one 2-neighbour. As indicated by Lemma 8.16, deficient 3-vertices are in some way critical for our discharging procedure. We give one more structural result that restricts the existence of deficient vertices.

**Lemma 8.17.** Let $G$ be a graph, let $\pi: E(G) \to \mathbb{F}_2$. Let $y$ be a deficient vertex adjacent to two deficient vertices $x$ and $z$ in $G$, and let $x', y', z'$ be the 2-neighbours of $x, y, z$ respectively.

Any strict $(G - \{x, y, z, x', y', z'\}, \pi)$-realisation of dimension 3 can be extended into a strict $(G, \pi)$-realisation of dimension 3.

**Proof.** Let $x''$ (resp. $y''$, $z''$) be the neighbour of $x'$ (resp. $y'$, $z'$) distinct from $x$ (resp. $y, z$).

By Lemma 8.13, there are three possibilities to extend $(\mathbf{u})_{u \in V(G - \{x, y, z, x', y', z'\})}$ to $x$, and so at least two of them are different from $\mathbf{x}''$. Let $I_x$ be the set of these vectors. Similarly, let $I_z$ be the set of possible extensions of $(\mathbf{u})_{u \in V(G - \{x, y, z, x', y', z'\})}$ to $z$ different from $\mathbf{z}''$.

First suppose $\pi(xy) = 1$. Then choose $\mathbf{x} \in I_x$ and $\mathbf{z} \in I_z$ such that $\mathbf{x} \neq \mathbf{z}$. Then the affine space of the common solutions $\mathbf{y}$ of the equations $\mathbf{y} \cdot \mathbf{x} = \pi(xy)$ and $\mathbf{y} \cdot \mathbf{z} = \pi(yz)$ has dimension 1 and does not contain $\mathbf{0}$ (since $\pi(xy) \neq 0$). Then choose $\mathbf{y}$ among these solutions such that $\mathbf{y} \neq \mathbf{y}''$. Finally, extend the realisation to $x', y', z'$ using Lemma 8.13. We proceed symmetrically if $\pi(yz) = 1$. Now suppose $\pi(xy) = \pi(yz) = 0$.

Suppose $I_x \cap I_z \neq \emptyset$. Then take $\mathbf{x} = \mathbf{z} \in I_x \cap I_z$. The solutions $\mathbf{y}$ of the equation $\mathbf{y} \cdot \mathbf{x} = 0$ form a space of dimension $3-1=2$. Hence there are $2^2=4$ such solutions. Then take for $\mathbf{y}$ one of these solutions distinct from $\mathbf{y}''$ and from $\mathbf{0}$. Then we can extend the realisation to $x', y', z'$ by Lemma 8.13. Now we assume $I_x \cap I_z = \emptyset$.

Let $I_x = \{\mathbf{x}_1, \mathbf{x}_2\}$ and $I_z = \{\mathbf{z}_1, \mathbf{z}_2\}$. For every $i, j \in \{1, 2\}$, the choice of $\mathbf{x} = \mathbf{x}_i$ and $\mathbf{z} = \mathbf{z}_j$ can not be extended only if $\{\mathbf{0}, \mathbf{y}''\} = \{\mathbf{x}_i, \mathbf{z}_j\}^\perp$. In particular, $\{\mathbf{x}_1, \mathbf{z}_1\}$ and $\{\mathbf{x}_1, \mathbf{z}_2\}$ span the same vector space, so $\{\mathbf{x}_1, \mathbf{z}_1, \mathbf{z}_2\}$ is linearly dependent. As $\mathbf{x}_1, \mathbf{z}_1$, and $\mathbf{z}_2$ are pairwise distinct, we obtain $\mathbf{x}_1 + \mathbf{z}_1 + \mathbf{z}_2 = 0$. A similar argument shows that $\mathbf{x}_2 + \mathbf{z}_1 + \mathbf{z}_2 = 0$. It follows that $\mathbf{x}_1 = \mathbf{x}_2$, a contradiction. This concludes the proof of the lemma. $\square$

**Proof of Theorem 8.11.** We will show that for every graph with $\mathrm{Mad}(G) < 2 + \frac{8}{11}$ and for every function $\pi: E(G) \to \mathbb{F}_2$, there is a family of non-zero vectors $(\mathbf{u})_{u \in V(G)}$ in $\mathbb{F}_2^3$ such that $\pi(uv) = \mathbf{u} \cdot \mathbf{v}$ for every edge $uv$ of $G$, that is, there exists a strict $(G, \pi)$-realisation of dimension 3. By Observation 2.2, this will imply $\mathrm{diam}(\mathcal{I}(G)) \le 3$, and so prove the theorem. Let $G$ be a minimum counterexample to this statement. The above lemmas yield the following properties.

(P1) $\delta(G) \ge 2$ (Lemma 8.12).

(P2) Two 2-vertices are not adjacent (Lemma 8.14).

(P3) A 3-vertex has at most one 2-neighbour (Lemma 8.16).

(P4) Every 4-, 5-, or 6-vertex has at least one ($\ge 3$)-neighbour (Lemma 8.15).

(P5) A deficient vertex is adjacent to at most one deficient vertex (Lemma 8.17).

We shall now use the Discharging Method. The initial charge of each vertex $v$ is its degree $d_G(v)$. We now apply the following discharging rules.

(R1) Every ($\ge 3$)-vertex sends $\frac{4}{11}$ to its 2-neighbours.

(R2) Every non-deficient ($\ge 3$)-vertex sends $\frac{1}{11}$ to its deficient neighbours.

Let us examine the final charge $w(v)$ of a vertex $v$ in $V(G)$. By (P1), we have $d_G(v) \ge 2$.

* If $v$ is a 2-vertex, then it has two ($\ge 3$)-neighbours by (P2). It receives $\frac{4}{11}$ from each of them, so $w(v) = 2 + 2 \times 4/11 = 2 + 8/11$.
* If $v$ is a deficient 3-vertex, then it has one 2-neighbour and has at least one non-deficient ($\ge 3$)-neighbour by (P5). Thus it sends $\frac{4}{11}$ to its 2-neighbour and receives at least $\frac{1}{11}$ from its other neighbours. So $w(v) \ge 3 - 4/11 + 1/11 = 2 + 8/11$.

* If $v$ is a non-deficient 3-vertex, then it sends $1/11$ to its at most three deficient neighbours. So $w(v) \ge 3 - 3 \times 1/11 = 2 + 8/11$.

* If $v$ is a 4-vertex, then it sends $4/11$ to each of its 2-neighbours by (R1) and $1/11$ to each of its deficient neighbours by (R2). By (P4), $v$ has at most three 2-neighbours. So $w(v) \ge 4 - 3 \times 4/11 - 1/11 = 2 + 9/11$.

* If $v$ is a ($\ge 5$)-vertex, then it sends at most $4/11$ to each of its neighbours. So $w(v) \ge d(v) - d(v) \times \frac{4}{11} = d(v) \times 7/11 \ge 35/11 > 2 + 8/11$.

Hence $w(v) \ge 2 + 8/11$ for every vertex $v$. Consequently, $\sum_{v \in V(G)} d(v) = \sum_{v \in V(G)} w(v) \ge (2 + 8/11)|V(G)|$. We conclude that $\mathrm{Mad}(G) \ge \mathrm{Ad}(G) \ge 2 + 8/11$, a contradiction. $\square$

# 9 Complexity

In this section, we consider the computational complexity of the following two related problems.

## k-INVERSION-DISTANCE

**Instance:** Two orientations $\vec{G}_1$ and $\vec{G}_2$ of a graph $G$.

**Question:** Are $\vec{G}_1$ and $\vec{G}_2$ at distance at most $k$ in $\mathcal{I}(G)$ ?

## k-INVERSION-DIAMETER

**Instance:** A graph $G$.

**Question:** Does $\mathcal{I}(G)$ have diameter at most $k$ ?

0-INVERSION-DISTANCE is trivial as two orientations of some graph are at distance 0 if and only if they are the same. Furthermore, 1-INVERSION-DISTANCE can be solved in polynomial time because of the following easy characterisation of orientations at distance 1.

**Proposition 9.1.** Let $\vec{G}_1$ and $\vec{G}_2$ be two orientations of a graph $G$. There exists $X$ such that $\vec{G}_2 = \mathrm{Inv}(\vec{G}_1; X)$ if and only if every edge of $E_=$ has at most one end-vertex incident to an edge of $E_\ne$.

Proposition 4.3 implies that 0-INVERSION-DIAMETER and 1-INVERSION-DIAMETER can be solved in polynomial time.

The aim of this section is to prove that $k$-INVERSION-DIAMETER and $k$-INVERSION-DISTANCE are NP-hard for all $k \ge 2$.

We need some preliminaries. The first one is the following well-known lemma, which can be easily proved using a well-known theorem of Euler, see [Die05].

**Lemma 9.2 (Folklore).** Every graph $G$ admits an orientation $\vec{G}$ such that every vertex $v$ has in-degree at least $\lfloor d(v)/2 \rfloor$ in $\vec{G}$. Moreover, such an orientation can be computed in polynomial time.

**Lemma 9.3.** Let $d \ge 2$ and let $\mathbf{u}, \mathbf{v} \in \mathbb{F}_2^d \setminus \{0\}$ be two distinct vectors. For every $x, y \in \mathbb{F}_2$, there exists $\mathbf{w} \in \mathbb{F}_2^d$ such that $\mathbf{u} \cdot \mathbf{w} = x, \mathbf{v} \cdot \mathbf{w} = y$.

*Proof.* As $\mathbf{u} \ne \mathbf{v}$ are distinct non zero vectors in $\mathbb{F}_2^d$, the matrix $M$ whose rows are $u$ and $v$ has rank 2. Hence its image is a 2-dimensional space, and so the mapping $\begin{pmatrix} \mathbb{F}_2^d \to \mathbb{F}_2^2 \\ \mathbf{w} \mapsto M \cdot \mathbf{w} = (\mathbf{u} \cdot \mathbf{w}, \mathbf{v} \cdot \mathbf{w}) \end{pmatrix}$ is surjective. $\square$

For a graph $G$, we denote by $G^{(1)}$ the graph obtained from $G$ by subdividing every edge of $G$ exactly once. The following theorem links $\mathrm{diam}(\mathcal{I}(G^{(1)}))$ with $\chi(G)$. Note that similar results for $\chi_s, \chi_a, \chi_o$ have been proven by Wood [Woo05].

**Theorem 9.4.** For every graph $G$ with $\delta(G) \ge 2$ and for every integer $k \ge 2$, one can construct in polynomial time two orientations $O_1, O_2$ of $G^{(1)}$ such that the following are equivalent:
(i) $\mathrm{dist}_{\mathcal{I}(G^{(1)})}(O_1, O_2) \le k$,

(ii) $\mathrm{diam}(\mathcal{I}(G^{(1)})) \le k$,

(iii) $\chi(G) \le 2^k - 1$.

*Proof.* Let $G$ be a graph and let $k \ge 2$ be an integer. We denote by $ux_{uv}v$ the path of length 2 replacing the edge $uv \in E(G)$ in $G^{(1)}$.

By Lemma 9.2, $G$ has an orientation $\bar{G}$ of $G$ such that every vertex has in-degree at least 1. For every arc $uv \in A(\bar{G})$, set $\pi_0(ux_{uv}) = 0$ and $\pi_0(x_{uv}v) = 1$. Let $O_1$ be an arbitrary orientation of $G^{(1)}$ and let $O_2$ be obtained from $O_1$ by reversing every edge $e \in E(G^{(1)})$ such that $\pi_0(e) = 1$.

We first show that (iii) implies (ii). Assume that $\chi(G) \le 2^k - 1$. Then there exists a mapping $\phi: V(G) \to \mathbb{F}_2^k \setminus \{0\}$ such that $\phi(u) \ne \phi(v)$ for every $uv \in E(G)$. Consider a function $\pi: E(G^{(1)}) \to \mathbb{F}_2$. We will construct a family $(\mathbf{w})_{w \in V(G)}$ of vectors in $\mathbb{F}_2^k$ such that $\pi(ww') = \mathbf{w} \cdot \mathbf{w}'$ for every edge $ww'$ of $G^{(1)}$. This will imply that $\mathrm{diam}(\mathcal{I}(G^{(1)})) \le k$ by Observation 2.2. We take $\mathbf{u} = \phi(u)$ for every vertex $u \in V(G)$, and we choose $\mathbf{x}_{uv}$ such that $\mathbf{u} \cdot \mathbf{x}_{uv} = \pi(ux_{uv})$ and $\mathbf{v} \cdot \mathbf{x}_{uv} = \pi(x_{uv}v)$. This is possible by Lemma 9.3. Hence (ii) holds.

Clearly, (ii) implies (i).

We finally show that (i) implies (iii). Suppose that $\mathrm{dist}_{\mathcal{I}(G^{(1)})}(O_1, O_2) \le k$. Then, by Observation 2.2, there exists a family $(\mathbf{w})_{w \in V(G^{(1)})}$ of vectors in $\mathbb{F}_2^k$ such that $\pi_0(ww') = \mathbf{w} \cdot \mathbf{w}'$ for every edge $ww'$ of $G^{(1)}$. Then for every edge $uv$ of $G$, by the choice of $\pi_0$ we have $\mathbf{u} \cdot \mathbf{x}_{uv} \ne \mathbf{v} \cdot \mathbf{x}_{uv}$ and so $\mathbf{u} \ne \mathbf{v}$. Moreover, for every $u \in V(G)$, $u$ is incident to an edge $e$ in $G^{(1)}$ with $\pi_0(e) = 1$, which implies that $\mathbf{u} \ne \mathbf{0}$. Thus $u \mapsto \mathbf{u}$ is a proper $(2^k - 1)$-colouring of $G$, yielding (iii).

This concludes the proof of the theorem. $\square$

It is well-known that deciding whether a graph $G$ with $\delta(G) \ge 2$ has chromatic number at most $k$ is NP-complete for any fixed integer $k \ge 3$ [Kar72] and that deciding whether a planar graph $G$ with $\delta(G) \ge 2$ has chromatic number at most 3 is NP-complete [GJS76]. As a consequence, we obtain the following result.

**Corollary 9.5.** For every integer $k \ge 2$, $k$-INVERSION-DIAMETER and $k$-INVERSION-DISTANCE are NP-hard, even when restricted to graphs $G$ with $\mathrm{Mad}(G) < 4$. Moreover, 2-INVERSION-DIAMETER and 2-INVERSION-DISTANCE are NP-hard even for planar bipartite graphs of girth at least 6.

# 10 Conclusion and further work

In this paper, we established some bounds on the inversion diameter of graphs in various graph classes. We leave as open problems to improve several of them.

**Problem 10.1.** Determine $M(\Delta \le k)$.

Theorem 2.3 and Theorem 6.1 imply $k \le M(\Delta \le k) \le 2k - 1$. Conjecture 6.1 states $M(\Delta \le k) = k$. It has been proved for $k \le 2$. So the first open case is for $k = 3$. We do not know whether it is true that $\mathrm{diam}(\mathcal{I}(G)) \le 3$ for every subcubic graph $G$.

For any graph parameter $\gamma$, let $m(\gamma \ge k)$ be the minimum inversion diameter over all graphs $G$ with $\gamma(G) \ge k$.

**Problem 10.2.** Determine $m(\delta \ge k)$, $m(\delta^* \ge k)$, and $m(\mathrm{Mad} \ge k)$

Recall that $\delta(G) \le \delta^*(G) \le \mathrm{Mad}(G)$. Thus the fact that $\mathrm{diam}(\mathcal{I}(K_k)) = k - 1$ and Theorem 3.2 imply

$$ \frac{k}{2} \le m(\mathrm{Mad} \ge k) \le m(\delta^* \ge k) \le m(\delta \ge k) \le k. $$

Clearly, $m(\delta \ge 0) = 0$ and $m(\delta \ge 1) = 1$. A graph $G$ with $\delta(G) \ge 2$ contains a cycle $C$, and thus has inversion diameter at least 2 since two orientations of $G$ which disagree on all edges of $C$ but one are at distance at least 2 in $\mathcal{I}(G)$. Thus $m(\delta \ge 2) = 2$. Theorem 6.8 yields $m(\delta \ge 3) = 3$.

By computer search, we found the 5-regular graph depicted in Figure 5 which has inversion diameter 4. Thus $m(\delta \ge 5) \le 4$.
<figure><img src="image_8.png" /><figcaption>Figure 5: A 5-regular graph G with inversion diameter 4. Since this graph contains $K_5$, Theorem 2.3 implies $\text{diam}(\mathcal{I}(G)) \ge 4$. The other inequality $\text{diam}(\mathcal{I}(G)) \le 4$ was checked by computer.</figcaption></figure>

**Problem 10.3.** Determine $M(\text{tw} \le t)$.

Theorem 7.1 and Theorem 7.5 yield $t + 2 \le M(\text{tw} \le t) \le 2t$.

**Problem 10.4.** What the maximum inversion diameter of a $K_t$-minor-free graph? Is it in $O(t\sqrt{\log t})$?

Corollary 8.3 shows that it is in $O(t^2)$.

**Problem 10.5.** Determine $M_P$ the maximum inversion diameter over all planar graphs.

Corollary 8.5 and Proposition 8.6 imply $5 \le M_P \le 12$.

**Problem 10.6.** Determine the minimum integer $g_k$ such that $\text{diam}(\mathcal{I}(G)) \le k$ for every planar graph of girth at least $g_k$.

Corollary 8.7 and Theorem 8.8 state $g_{10} \le 5$, $g_6 \le 7$, and $g_3 \le 8$.

Particular cases mixing some of the above problems may also be studied. For example, it is already interesting to establish whether every subcubic planar graph has inversion diameter at most 3.

We also believe that the upper bound in Theorem 2.3 can be generalised to the blow-up of any graph as follows.

**Conjecture 10.7.** For every graph G, for every positive integer t,

$$ \text{diam}(\mathcal{I}(G[\overline{K}_t])) \le t \cdot \text{diam}(\mathcal{I}(G)). $$

This inequality would be tight for complete graphs by Theorem 2.3. Note that $\text{diam}(\mathcal{I}(G[\overline{K}_t]))$ can be characterised as in Observation 2.2 using matrices over $\mathbb{F}_2$.

**Observation 10.8.** For every graph G, for every positive integers $t, \ell$, the following are equivalent.

1. $\text{diam}(\mathcal{I}(G[\overline{K}_t])) \le \ell$.

2. For every function $\Pi: E(G) \to \mathbb{F}_2^{t \times t}$, there is a family $(U)_{u \in V(G)}$ of matrices in $\mathbb{F}_2^{\ell \times t}$ such that

$$ \Pi(uv) = U^\top \cdot V $$

for every edge $uv \in E(G)$.

Further, it would be interesting to understand how the density of the graph influences the diameter of its inversion graph. In particular, we are interested in the following question.

**Problem 10.9.** Is there an absolute constant $\alpha$ such that $\text{diam}(\mathcal{I}(G)) \le \alpha\sqrt{|E(G)|}$ holds for every graph G?

Regarding complexity, we solved the most natural questions, but many remain. One of them is the following.
**Problem 10.10.** Is 2-INVERSION-DIAMETER $\Pi_2^P$-hard?

We refer the reader to [SU02] for some $\Pi_2^P$-complete problems. We could also study the complexity of the following dual problem.

k-DUAL-INVERSION-DIAMETER

Instance: A graph $G$.

Question: Does $\mathcal{I}(G)$ have diameter at least $|V(G)| - 1 - k$?

The first question is to determine whether it is NP-complete or polynomial-time solvable for every fixed $k$. Trivially, 0-Dual-Inversion-Diameter is polynomial-time solvable as the inversion diameter of a graph $G$ is at most $|V(G)| - 1$. Since an edgeless graph has inversion diameter 0, Lemma 2.1 implies $\mathrm{diam}(\mathcal{I}(G)) \le |V(G)| - \alpha(G)$ where $\alpha(G)$ denotes the maximum size of an independent set in $G$. Since every non-complete graph has an independent set of size 2, it follows that a graph $G$ has inversion diameter at most $|V(G)| - 1$ if and only if it is complete. Thus 1-Dual-Inversion-Diameter is polynomial-time solvable.

An interesting variant of the inversion graph is the **unlabelled inversion graph**, denoted by $\mathcal{U}(G)$, which is obtained from $\mathcal{I}(G)$ by identifying vertices corresponding to isomorphic orientations. Clearly, $\mathrm{diam}(\mathcal{U}(G)) \le \mathrm{diam}(\mathcal{I}(G))$. Hence it would be interesting to investigate whether all the upper bounds on $\mathrm{diam}(\mathcal{I}(G))$ obtained in this paper can be improved for $\mathrm{diam}(\mathcal{U}(G))$. For example, the bound $\mathrm{diam}(\mathcal{I}(G)) \le n - 1$ is tight, but we believe it is not tight for $\mathrm{diam}(\mathcal{U}(G))$. Note that $\mathrm{inv}(n)$ is the eccentricity of the transitive tournament in $\mathcal{U}(K_n)$. It has been proved in [APS<sup>+</sup>24, AHH<sup>+</sup>22] that $n - 2\sqrt{n \log n} \le \mathrm{inv}(n) \le n - \lfloor \log(n+1) \rfloor$. Together with Theorem 2.3, this implies the following.

**Corollary 10.11.** $n - \mathcal{O}(\sqrt{n \log n}) \le \mathrm{diam}(\mathcal{U}(K_n)) \le \mathrm{diam}(\mathcal{I}(K_n)) = n - 1$.

However, we believe that the upper bound on $\mathrm{inv}(n)$ also holds for $\mathrm{diam}(\mathcal{U}(K_n))$.

**Conjecture 10.12.** $\mathrm{diam}(\mathcal{U}(K_n)) \le n - \lfloor \log(n+1) \rfloor$.

Acknowledgements

This work was partially supported by the french Agence Nationale de la Recherche under contract Digraphs ANR-19-CE48-0013-01.

References

[AHH<sup>+</sup>22] Guillaume Aubian, Frédéric Havet, Florian Hörsch, Felix Klingelhoefer, Nicolas Nisse, Clément Rambaud, and Quentin Vermande. Problems, proofs, and disproofs on the inversion number, 2022. arXiv:2212.09188.

[APS<sup>+</sup>24] Noga Alon, Emil Powierski, Michael Savery, Alex Scott, and Elizabeth Wilmer. Invertibility of digraphs and tournaments. *SIAM Journal on Discrete Mathematics*, 38(1):327–347, 2024. arXiv:2212.11969.

[BBBP10] Houmem Belkhechine, Moncef Bouaziz, Imed Boudabbous, and Maurice Pouzet. Inversion dans les tournois. *Comptes Rendus Mathématique*, 348(13-14):703–707, 2010. arXiv:1007.2103.

[BdSH21] Jørgen Bang-Jensen, Jonas Costa Ferreira da Silva, and Frédéric Havet. On the inversion number of oriented graphs. *Discrete Mathematics & Theoretical Computer Science*, 23(2), 2021. arXiv:2105.04137.

[BKW99] Oleg V. Borodin, Alexandr V. Kostochka, and Douglas R. Woodall. Acyclic colourings of planar graphs with large girth. *Journal of the London Mathematical Society*, 60(2):344–352, 1999.
[BM08] J. Adrian Bondy and Uppaluri S. R. Murty. *Graph Theory*. Graduate Texts in Mathematics. Springer, 2008.

[Bor79] Oleg V. Borodin. On acyclic colorings of planar graphs. *Discrete Mathematics*, 25(3):211–236, 1979.

[DHHR23] Julien Duron, Frédéric Havet, Florian Hörsch, and Clément Rambaud. On the minimum number of inversions to make a digraph $k$-(arc-)strong, 2023. arXiv:2303.11719.

[Die05] Reinhard Diestel. *Graph Theory (Graduate Texts in Mathematics)*. Springer, August 2005.

[GJS76] Michael R. Garey, David S. Johnson, and Larry Stockmeyer. Some simplified NP-complete graph problems. *Theoretical Computer Science*, 1(3):237–267, 1976.

[Grü73] Branko Grünbaum. Acyclic coloring of planar graphs. *Israel Journal of Mathematics*, 14:390–408, 1973.

[vdHOdMQ$^+$17] Jan van den Heuvel, Patrice Ossona de Mendez, Daniel Quiroz, Roman Rabinovich, and Sebastian Siebertz. On the generalised colouring numbers of graphs that exclude a fixed minor. *European Journal of Combinatorics*, 66:129–144, 2017. arXiv:1602.09052.

[Kar72] Richard M. Karp. *Reducibility among Combinatorial Problems*. Springer US, 1972.

[KSZ97] Alexandr V. Kostochka, Éric Sopena, and Xuding Zhu. Acyclic and oriented chromatic numbers of graphs. *Journal of Graph Theory*, 24(4):331–340, 1997.

[RS94] André Raspaud and Eric Sopena. Good and semi-strong colorings of oriented planar graphs. *Information Processing Letters*, 51(4):171–174, 1994.

[SU02] Marcus Schaefer and Christopher Umans. Completeness in the polynomial-time hierarchy a compendium. *Sigact News - SIGACT*, 33, 01 2002.

[Woo05] David R. Wood. Acyclic, star and oriented colourings of graph subdivisions. *Discrete Mathematics & Theoretical Computer Science*, 7(1):37–50, 2005. https://dmtcs.episciences.org/344/.