Computing graph gonality is hard

There are several notions of gonality for graphs. The divisorial gonality dgon( G ) of a graph G is the smallest degree of a divisor of positive rank in the sense of Baker–Norine. The stable gonality sgon( G ) of a graph G is the minimum degree of a finite harmonic morphism from a refinement of G to a tree, as defined by Cornelissen, Kato and Kool. We show that computing dgon( G ) and sgon( G ) are NP-hard by a reduction from the maximum independent set problem and the vertex cover problem, respectively. Both constructions show that computing gonality is moreover APX-hard. © 2020TheAuthor(s)


Introduction
In algebraic geometry, one attaches to an algebraic curve an invariant called gonality.This invariant measures 'how far' a given algebraic curve X is from the projective line P 1 ; gonality is the minimal degree of a non-constant rational map X → P 1 .Alternatively, gonality can be defined as the minimal degree of a divisor of rank one.The gonality of an algebraic curve has various applications.For example, gonality can be used to encode an algebraic curve using small function field extensions [26], and it can be used in coding theory to improve minimal distance bounds [24].Gonality is also used in a uniform boundedness result in number theory: for a set of equations with integer coefficients that define a smooth algebraic curve X , there are only finitely many solutions to this set in the union of all number fields of degree at most gon(X )−1 2 [18].As we will now explain, both definitions of gonality can be transferred from algebraic curves to graphs, where, maybe somewhat surprisingly, the corresponding notions are no longer equivalent.
Divisorial gonality.The first notion of gonality of graphs was introduced by Baker and Norine [6], who developed a theory of divisors on finite graphs in which they uncovered many parallels between finite graphs and algebraic curves.In particular, they stated and proved a graph theoretical analogue of the classical Riemann-Roch theorem.See [5,17,21] for background on the interplay between divisors on graphs, curves and tropical curves.
As observed in [6], there is also a close connection between divisor theory and the chip-firing game of Björner, Lovász and Shor [10].A divisor can be thought of as a distribution of chips over the vertices of a graph, where every vertex is assigned an integer number of chips.One divisor is transformed into another by firing sets of vertices: when a set U is fired, a chip is moved along each edge from U to V \ U. Björner, Lovász and Shor considered the game where vertices are assigned non-negative numbers of chips and studied whether there is an infinite sequence of singleton sets that can be fired without any vertex getting a negative number of chips.See [23] for the connections to the Abelian sandpile model from statistical physics and Biggs' dollar game [9].The divisorial gonality dgon(G) of a connected graph G is an important parameter associated to G in the context of divisor theory.
It is defined as the smallest degree of a positive rank divisor.In terms of the chip-firing game, the degree is the number of chips in the game.Positive rank means the following: for every vertex v the divisor can be transformed into a divisor which assigns at least one chip to v and a non-negative number to all other vertices.From [6,Corollary 5.4] it follows that the divisorial gonality of a connected graph G (with at least 3 vertices) is related to the finiteness of a game in the sense of [10].Specifically, dgon(G) = 2|E| − |V | − t(G), where t(G) is the maximum number of chips that can be placed on the graph G = (V , E) such that adding a chip at an arbitrary vertex still results in a finite game.
Stable gonality.The second definition of gonality of algebraic curves was translated to graphs by Cornelissen, Kato and Kool [17] and is called stable gonality.Recall that gonality is defined using morphisms to P 1 , which is the unique algebraic curve with genus zero.The genus of an algebraic curve relates to the first Betti number (also known as circuit rank) of a graph.As the graphs with first Betti number zero are exactly the trees, stable gonality is defined using morphisms to trees.The morphisms considered are finite harmonic morphisms.Intuitively, these are morphisms that divide the edges of the graph equally over the edges of the tree.This notion is called stable because we are allowed to refine the graph first: a refinement of a graph is obtained by adding degree one vertices and subdividing edges.The stable gonality sgon(G) of a connected graph G is the minimum degree of such a finite harmonic morphism from a refinement of G to a tree.See [3,14] for similar notions of gonality on tropical curves and graphs.The gonality of an algebraic curve defined over a number field is bounded from below by the stable gonality of the intersection dual graph of its reduction modulo any prime ideal of the number field.This makes stable gonality of graphs relevant for number theoretic problems (e.g.[17]).More generally, this lower bound holds for any algebraic curve defined over a field with valuation.
Computational complexity.The exact complexity of computing the gonality of an algebraic curve is not known.As far as we know, no efficient algorithm exists to compute the gonality of an arbitrary algebraic curve.In [26], a good algorithm is given to compute the gonality of algebraic curves of small genus, but for arbitrary curves of genus larger than 7 the computations become too involved for the algorithm to terminate in reasonable time.In this paper we determine the complexity of computing the gonality of graphs.We show that both notions of gonality of graphs are NP-hard to compute.So we cannot expect efficient algorithms to compute them either (unless P = NP).An easier problem is to decide whether a given curve or graph is hyperelliptic, i.e. has gonality 2: there is an algorithm in Magma for this problem on curves [12], but a rigorous analysis of its complexity has not been carried out.However, a full classification of hyperelliptic metric graphs is given in [15], and there are algorithms that decide this for both notions of graph gonality in quasilinear time [11].Progress on graphs with divisorial gonality 3 has also been made [1].
The computational complexity of the notions of gonality for graphs is also interesting from an algorithmic point of view, where one can ask whether these new graph parameters can be used for fixed parameter tractable algorithms.It is known that treewidth is a lower bound for both notions of graph gonality [13], which raises the question whether or not NP-hard problems exist that are not tractable on graphs of bounded treewidth, but are tractable on graphs of bounded gonality.
It is known that computing the divisorial gonality of a graph is in the complexity class XP: for every divisor with k chips, we can check whether it has positive rank in polynomial time [8].There exists an algorithm to compute the stable gonality of a graph in O((1.33n) n m m poly(n, m)) time, where n is the number of vertices and m the number of edges of the graph [19]., matching the classical Brill-Noether bound [17].Although this is a graph theoretic statement, no combinatorial proof is known for this upper bound.For divisorial gonality the same upper bound is conjectured, see [5].This is better than the trivial upper bound dgon(G) ≤ |V |.

Bounds on gonality
Bounds between the different invariants (including the hybrid invariant 'stable gonality', sdgon(G), defined in Definition 2.4) are represented in Fig. 1.In Section 5 we elaborate on this and prove that stable gonality is unbounded in divisorial gonality.
Theorem 1.3 (Theorem 5.6).For every k ≥ 1 there is a graph with divisorial gonality 3 and stable gonality at least k + 2. It was shown in [20] that divisoral gonality is also unbounded in stable gonality.We briefly explain the construction in Section 5.1.Note that it follows from these results that stable and divisorial gonality are also unbounded in stable divisorial gonality and treewidth.

Graphs and divisors
Throughout the paper we consider only connected graphs G = (V , E).We allow graphs to have parallel edges and loops.We write u − v-path for a path from u to v. By path we always mean simple path.
For A, B ⊆ V , we denote by E(A, B) the set of edges with an end in A and an end in B and by E[A] := E(A, A) the set of edges with both ends in A. For vertices u, v ∈ V , we use the abbreviation E(u, v) := E({u}, {v}) for the set of edges between u and v and we write E(u) := E({u}, V \ {u}) for all edges incident to u.By deg(u) we denote the degree of a vertex u, where loops are counted twice.The Laplacian of G is the matrix A vector D ∈ Z V is called a divisor on G and deg(D x.This is indeed an equivalence relation and equivalent divisors have equal degrees as the entries in every column of Q (G) sum to zero.We remark that since G is connected, the null space of Q (G) is spanned by the all-one vector 1.So the solution x is unique up to scalar multiples of 1.
Let D be a divisor.If D is equivalent to an effective divisor, then we define rank(D) := max{k | D − E is equivalent to an effective divisor for every effective E of degree ≤ k}.
If D is not equivalent to an effective divisor, we set rank(D) := −1.Observe that equivalent divisors have the same rank.
Answering a question of H.W. Lenstra, it was shown in [22] that computing the rank of a divisor is NP-hard.Finally, we define the divisorial gonality of G to be dgon(G) := min{deg(D) | rank(D) ≥ 1}. ( Observe that in the definition of divisorial gonality, we can restrict ourselves to effective divisors D. Hence dgon(G) is the minimum degree of an effective divisor D such that for every vertex v there is an effective divisor D ′ ∼ D with D ′ (v) ≥ 1.Also note that dgon(G) ≤ |V | since taking D(v) = 1 for all v ∈ V gives a divisor of positive rank.
To facilitate reasoning about equivalence of effective divisors, we denote by 1 U the incidence vector of a subset U of V .When D and D ′ are effective divisors and D ′ = D − Q (G)1 U , we say that D ′ is obtained from D by firing the set U. If we think of D(v) as the number of chips on a vertex v, then firing U corresponds to moving one chip along each edge of the cut E(U, V \ U) in the direction from U to V \ U.In particular, we must have that D(v) ≥ |E({v}, V \ U)| for every v ∈ U as D ′ ≥ 0. Hence, we cannot fire any set U for which the cut E(U, V \ U) has more than deg(D) edges.
The following lemma from [13] shows that for equivalent effective divisors D and D ′ , we can obtain D ′ from D by successively firing sets.A divisor D is called v-reduced if D(u) ≥ 0 for all u ∈ V \ {v} and for every set U ⊆ V \ {v} there is a vertex u ∈ V \ {v} such that D ′ (u) < 0, where Given D and a vertex v, the v-reduced divisor equivalent to D can be found in polynomial time using Dhar's burning algorithm (see [8]).
Notice that a divisor D has rank at least 1 if and only if, for every vertex v, the v- Remark 2.5.Since adding leaves to a graph does not change its divisorial gonality, we do not have to consider all refinements, but only those obtained from subdivisions of edges, i.e.

Morphisms and stable gonality
The stable gonality of a graph is defined using finite harmonic morphisms.A finite harmonic morphism is a graph homomorphism with some extra properties.Recall that a graph homomorphism is a map φ: G → H that maps vertices of G to vertices of H and preserves edges, i.e., a homomorphism is a map φ: Definition 2.6.Let G and H be loopless graphs.A finite morphism is a graph homomorphism φ: G → H, together with a map r: E(G) → Z >0 that assigns an index r(e) to every edge e ∈ E(G).
Intuitively, a finite morphism is harmonic if it divides the edges of G equally over the edges of H.We make this precise in the following definitions. r(e).
Definition 2.8.Let G and H be loopless graphs and φ: Definition 2.9.Let G = (V , E) be a loopless graph and let H = (W , F ) be a connected loopless graph.Let φ: G → H be a finite harmonic morphism and let f ∈ F be an edge of H.The degree deg(φ) is This is independent of the choice of f [7, Lemma 2.4].This is also equal to for any vertex w ∈ W of H.We now turn to the definition of stable gonality.Recall the notion of a refinement from Definition 2.3.
Definition 2.10.The stable gonality sgon(G) of a graph G is where T is a tree and G ′ is a refinement of G}.
Notice that finite morphisms are not defined for graphs that contain loops, but since we obtain a loopless graph by subdividing all edges, stable gonality is defined for graphs with loops.
Remark 2.11.The stable gonality of a disconnected graph equals the sum of the stable gonality of all components.In the remainder of this paper, we only consider connected graphs.
Example 2.12.Let G be a tree.Set r(e) = 1 for every edge e and consider the identity map φ: G → G.This is a finite harmonic morphism of degree 1.Thus the stable gonality of a tree equals 1.In fact, trees are the only graphs with stable gonality 1.Indeed, a finite harmonic morphism of degree 1 is injective and we cannot map a graph that contains a cycle injectively to a tree.Example 2.13.Let G be a cycle with 2n vertices.In the previous example we have seen that sgon(G) ≥ 2. We give a morphism of degree 2 to show that sgon(G) = 2. Let T be a path on n + 1 vertices.Assign index 1 to all edges of G and consider the map in Fig. 3.This is a finite harmonic morphism of degree 2, hence the stable gonality of an even cycle is 2. If G is an odd cycle, we obtain an even cycle by subdividing one of its edges.We use the same morphism of degree 2 to show that sgon(G) = 2.

NP-hardness
We define the Divisorial Gonality problem as follows:

Divisorial Gonality
We prove that this problem is NP-hard by a reduction from the Independent Set problem.Given an instance (G, k) of the Independent Set problem, we construct a graph Ĝ.We give a precise relation between the divisorial gonality of Ĝ and the maximum size of an independent set of G.The constructed graph Ĝ contains many parallel edges, and in the proof we use the fact that we either need many chips to move along these edges, or we will never move chips along these edges.
Let G = (V , E) be a graph and define M := 3|V | + 2|E| + 2. We construct the graph Ĝ in the following way.Start with a single vertex T .For every v ∈ V add three vertices: v, v ′ , T v .For every edge e ∈ E(u, v), add two vertices e u and e v .The edges of Ĝ are as follows: For every e ∈ E(u, v), add an edge between e u and e v , add M parallel edges between u and e u and M parallel edges between e v and v.For every v ∈ V , add three parallel edges between v ′ and T v , M parallel edges between v and v ′ and M parallel edges between T v and T .See Fig. 4 for an example.
For an effective divisor D on G, we define the following equivalence relation ∼ D on V : Note that if D and D ′ are equivalent effective divisors, then ∼ D =∼ D ′ .We need the following observation.Proof.This follows directly from Lemma 2.1.□ An edge e for which the ends are equivalent is called D-blocking.Lemma 3.2.Let D ≥ 0 be a divisor on G = (V , E).Let F be the set of D-blocking edges and let U be a component of the subgraph (V , E \ F ). Then for every effective divisor D ′ ∼ D we have Proof.This holds as no chips can move along a D-blocking edge.□ Lemma 3.3.Let G = (V , E) be a graph and let Ĝ be the graph as constructed above.Let α(G) be the maximum size of an independent set in G. Then the following holds: Proof.We first show that dgon( Ĝ) Let H be the subgraph obtained from Ĝ by deleting all D-blocking edges.Then {T } is the vertex set of a component of H, as is {v} for every v ∈ V .So by Lemma 3.2, the number of chips on {T } and on {v} (for each v ∈ V ) is constant over all effective divisors D ′ ∼ D. Hence, from the fact that rank(D) ≥ 1 it follows that D(T ) ≥ 1 and D(v) ≥ 1 for every v ∈ V .For {v ′ , T v }, we distinguish two cases.If v ′ ∼ D T v , then {v ′ } and {T v } are each the vertex set of a component of H, and must therefore have at least one chip by Lemma 3.2.Otherwise, {v ′ , T v } is the vertex set of a component of H.By Lemma 3.1, there is an equivalent effective divisor for which we can fire subset containing v ′ but not T v .This divisor must therefore have at least 3 chips on v ′ .Hence, by applying Lemma 3.2 to the component {v ′ , Summarising, for all vertices u, v ∈ V and all edges e ∈ E(u, v) we have: } be the set of nodes in V that are equivalent to T .By the above, we see that we find that dgon( Ĝ) Now we show that equality can be attained.For this, let S ⊆ V be an independent set in G of size α(G).Let v 1 , . . ., v k be a numbering of the vertices in V \ S and set U 0 = S ∪ {T }.We orient the edges of G as follows: For 1 ≤ i < j ≤ k we orient the edges in E(v i , v j ) from v i to v j , and for v 0 ∈ U 0 and 1 ≤ j ≤ k we orient the edges in E(v 0 , v j ) from v 0 to v j .We now define the effective divisor D on Ĝ as follows: D(e u ) = 1 for every edge e with tail u, D(e v ) = 0 for every edge e with head v.
It is easy to check that deg(D)

, k and let
Observe that the cut in Ĝ induced by the set W i consists of the edges e u e v for every u ∈ and the triple edges from T u to u ′ for every u ∈ V \ V i .Hence, we can fire the complement of W i .That is, for every i, We slightly change the arguments above so that we can apply them to the Stable Divisorial Gonality problem.
Then, there is an edge uv with u ∈ U and v ∈ V \ U such that v ∈ U i and u ∈ V \ U i for some i.This edge is the first edge of an M-blocking path P starting in u and ending in a vertex w (possibly w = v).
Let j ≤ i be the smallest index such that U j contains a vertex of P and consider the divisor obtained after firing the previous sets in the chain.Since U j ⊆ U i , we have u ̸ ∈ U j and hence w ̸ ∈ U j as u ∼ D w.It follows that at least two edges of P are in the cut E(U j , V \ U j ).Since we can fire the set U j , we must therefore have at least 2 chips on internal vertices of P.However, in D j−1 the path P has at most 1 chip on its internal vertices since P was clean and did not gain any chips in previous firings by the minimality of j, a contradiction.□ Proof of Theorem 3.5.We will prove the stronger statement that for any graph G we have sdgon( Ĝ) = dgon( Ĝ).For this, it suffices to show that dgon( Ĝ′ ) ≥ dgon( Ĝ) for any subdivision Ĝ′ of Ĝ.
Let Ĝ′ be a subdivision of Ĝ.Let D ≥ 0 be a positive rank divisor on Ĝ′ and suppose that deg(D) < M. Lemma 3.1 guarantees that M parallel edges in Ĝ are subdivided into D-blocking paths in Ĝ′ .We may assume that all D-blocking paths in Ĝ′ are clean.Just as in the proof of Lemma 3.3, but now using Lemma 3.6 instead of Lemma 3.2, we find that for every u, v ∈ V (G) and every edge e ∈ E(u, v) we have where [v ′ ] and [e u ] denote the component of v ′ and e u , respectively, in the subgraph obtained by deleting the edges and internal vertices of all D-blocking paths.Following the proof of Lemma 3.3, we set . By Lemma 3.3, this implies that deg(D) ≥ dgon( Ĝ), concluding the proof.□

APX-hardness
We consider the optimisation variant of the Divisorial Gonality problem, where we ask for the divisor with minimum degree among all divisors with rank at least 1.We will prove that this optimisation problem is APX-hard.For this, we use the reduction above, restricted to subcubic graphs, since Independent Set is APX-hard for subcubic graphs [2].For APX-hardness we also need to be able to construct good independent sets from good divisors in polynomial time.It follows that there is a PTAS reduction of 'maximum independent set on cubic graphs' to 'finding a minimum degree divisor of positive rank'.Since the former problem is APX-hard, also the second problem is APX-hard.It remains open whether or not finding a positive rank divisor of minimum degree is in APX.Proof.For the forward implication, assume that u ∼ D v and consider the divisor D u .Since D u is u-reduced, we cannot fire any nonempty subset of V \ {u}.Since u ∼ D v, this implies that we cannot fire any nonempty subset of V \ {v}.Hence, D u is v-reduced.By the uniqueness part in Lemma 2.2, this implies that D u = D v .
For the converse implication, suppose that x is effective for some x ∈ Z V (G) .Applying Lemma 2.1 to the divisors D u and D, we obtain a chain , and therefore that x = −y + z + c1 for some integer c.We conclude that x u = x v .□ Corollary 3.8.Given an effective divisor D on the graph G, and any two vertices u, v ∈ V (G), we can determine whether u ∼ D v in polynomial time.
Proof.We can compute D u and D v in polynomial time.This completes the proof.□ Lemma 3.9.Let G = (V , E) be a subcubic graph and let Ĝ be as constructed above.Let D ≥ 0 be a divisor on Ĝ of positive rank and degree deg(D) ≤ (1 + ϵ) dgon( Ĝ).Then we can find in polynomial time an independent set S in G of size at least (1 − 22ϵ)α(G).

Proof. We may assume that deg(D) ≤ |V ( Ĝ)| (otherwise replace D by the divisor with one chip on every vertex).
As in the proof of Lemma 3.3, we define U 0 to be the vertices in V that are equivalent to T .Notice that by Corollary 3.8, we can find U 0 in polynomial time.We have Proof.In [2] it was shown that the Independent Set problem is APX-hard, even on subcubic graphs.From this and from Lemma 3.9 the result follows.□ We consider the optimisation version of the Stable Divisorial Gonality problem as well.Again, we use the same proof to show that this is APX-hard.

Theorem 3.11. The Stable Divisorial Gonality problem is APX-hard.
Proof.By the proof of Theorem 3.5, it follows that sdgon( Ĝ) = dgon( Ĝ).It follows that Lemma 3.9 holds for stable divisorial gonality as well, and analogous to Theorem 3.10 we see that Stable Divisorial Gonality is APX-hard.□

NP-hardness
We define the Stable Gonality problem as follows:

Stable Gonality
In this section we prove that the Stable Gonality problem is NP-hard.Let G be a simple graph and write n for its number of vertices.We construct a multigraph Ĝ from G in two steps: 1. Add a vertex c to the vertex set of G, and connect this vertex with exactly one vertex of G (chosen arbitrarily).Then, add n − 1 more vertices to the vertex set, and connect these vertices with c (and no other vertices).We will call this process ''adding a star of size n with centre c''. 2. Add a vertex t to the vertex set, and for every other vertex u (including the vertices added in the previous step) draw n parallel edges between t and u.
This construction is illustrated in Fig. 5.We will relate the stable gonality of Ĝ to the minimum size of a vertex cover in G in Lemma 4.2.For this we need the following simple lemma.
See Fig. 6a for an illustration.We refine Ĝ and extend φ to this refinement in order to make φ a finite harmonic morphism.
1.For all edges e = uv ∈ E( Ĝ) with φ(u) = φ(v) = t ′ , subdivide uv with a vertex w and add a leaf l to t ′ .Define φ(w) = l.If u = t, set r φ (uw) = n.Write T ′ for the extended tree T after this step.See Fig. 6b. 2. For all vertices v ∈ S ∪ {c, t} and for all leaves l ∈ V (T ′ ), if v has no neighbour that is mapped to l, add a leaf v l to v and set φ( Write Ĝ′ for the refinement of Ĝ after this step.See Fig. 6c. 3.For all edges e ∈ E( Ĝ′ ), if we did not mention r φ (e) explicitly before, we set r φ (e) = 1.
We prove that φ: Ĝ′ → T ′ is a finite harmonic morphism.It is clear that φ is a finite morphism.For harmonicity, we check all vertices v ∈ V ( Ĝ′ ): -Suppose that e = t ′ v ′ i , then m φ,e (v) = n, since the edges tu with φ(u) = v ′ i are precisely the n edges tv i all with index 1.
-Assume e = t ′ l for some leaf l that is added in step 1.Then there is exactly one edge tu mapped to e, where u is a vertex that is added in either step 1 or 2. This edge has index n, so m φ,e (v) = n.
We conclude that φ is harmonic at t and m φ (t) = n.
-Assume there is a neighbour u of v with u a vertex of Ĝ or a vertex that is added in step 1, such that φ(uv) = e.By the construction of φ this is the only edge incident to v that is mapped to e, and this edge has index 1.-Suppose that there is no neighbour u of v with u a vertex of Ĝ or a vertex that is added in step 1, such that φ(uv) = e.Then we added a leaf to v in step 2 and assigned index 1 to this new edge.
So φ is harmonic at v and m φ (v) = 1.
• If v is any other vertex, then φ(v) is a leaf, thus φ is harmonic at v. Now we compute the degree of φ.For this we look at t ′ .The vertices that are mapped to t ′ are t, c and all vertices in S.
Now suppose that Ĝ has stable gonality at most n + k + 1, i.e. there exist a refinement Ĝ′ of Ĝ, a tree T and a map φ: Ĝ′ → T with degree d ≤ n + k + 1.
Consider the graph T \φ(t); as T is a tree, T \φ(t) is a forest.Define C as a component of T \φ(t) for which the size of φ −1 (C ) ∩ Ĝ is maximal, and let γ = ⏐ ⏐ φ −1 (C ) ∩ Ĝ⏐ ⏐ .Denoting by e C the unique edge between φ(t) and C , the degree of φ is at least the number of edges of Ĝ′ that are mapped to e C .Because t is connected to each vertex in Ĝ with exactly n edges, t and φ −1 (C ) ∩ Ĝ are connected by γ n edges (in Ĝ).Each such edge is subdivided into a path in Ĝ′ , which must then be mapped to a path from φ(t) to C .This path has to include the edge e C , and therefore the degree of φ is at least γ n.
We distinguish three cases for the value of γ : Fig. 6.The map φ: Ĝ → T and the step-by-step extension to a morphism where we take {u, v} as the vertex cover of the original triangle.
1. γ = 0. Then all vertices v Ĝ are mapped to φ(t) under φ, and therefore the degree of φ is bounded from below by the number of vertices in Ĝ, which is equal to 2n + 1. 2. γ ≥ 2. As mentioned before, a lower bound for the degree of φ is given by γ n ≥ 2n. 3. γ = 1.We look more closely at the size of the preimage of e C .For each of the n edges between t and φ −1 (C ) ∩ Ĝ an edge in the subdivision of this edge maps to e C .Let A ⊆ φ −1 (φ(t))\{t} be the set of vertices that are not part of the subdivisions of the edges between t and φ −1 (C ) ∩ Ĝ.For every vertex in A there is an edge attached to this vertex that maps to e C , as the index of this vertex in the direction of e C is at least one.It follows that deg(φ) ≥ n + |A|.
We prove a lower bound on the size of A: • For every edge uv of Ĝ\t such that φ(u) ̸ = φ(t) ̸ = φ(v), the unique path from φ(u) to φ(v) goes through φ(t) as γ = 1.Hence uv has to be subdivided, and one of the vertices in the subdivision is contained in A.
This shows that the degree of φ is bounded below by By applying Lemma 4.1 with H = Ĝ\t and S = {v ∈ V ( Ĝ\t) | φ(v) = φ(t)}, the degree of φ is bounded below by Because the three cases are exhaustive, we have As we assumed that sgon( Ĝ)

APX-hardness
The Vertex Cover problem is hard for subcubic graphs [2].So we will use the NP-hardness reduction above to show APX-hardness of the Stable Gonality problem.Notice that we consider the optimisation variant of the Stable Gonality problem here, i.e., we ask for a finite harmonic morphism from a refinement to a tree with minimum degree.Lemma 4.4.Let G = (V , E) be a subcubic graph with |V | ≥ 8 and let Ĝ be as constructed above.Let Ĝ′ be a refinement of Ĝ, T a tree and φ a finite harmonic morphism of degree at most (1 + ϵ) sgon( Ĝ).Then we can find, in polynomial time, a vertex cover S of G of size at most (1 + 32ϵ)τ (G).
}} as in the proof of Lemma 4.2.We distinguish cases for the value of γ .
Since G is subcubic, it holds that τ (G) ≤ 3 4 n.Because of this and because we assumed that n ≥ 8, it follows that ϵ ≥ The set V is clearly a vertex cover and has size |V | ≤ (1 + 32ϵ)τ (G), since τ (G) ≥ 1 3 n for subcubic graphs.
In both cases we found a vertex cover of G of size at most (1 + 32ϵ)τ (G).Notice that these vertex covers can be computed in polynomial time.□ Theorem 4.5.The Stable Gonality problem is APX-hard.

Proof.
In [2] it was shown that the Vertex Cover problem is APX-hard, even on subcubic graphs.It follows that the Vertex Cover problem is APX-hard on subcubic graphs with at least 8 vertices as well.From this and from Lemma 4.4 the result follows.□

Divisorial and stable gonality are unbounded in one another
In the introduction we briefly mentioned some inequalities regarding different graph invariants; a summary of all relations can be found in Fig. 1.In particular, it is known that treewidth is a lower bound for all notions of gonality [13], and by definition stable divisorial gonality is a lower bound for divisorial gonality.It is mentioned in [17] that it is a lower bound for the stable gonality as well.The idea is as follows: let φ: G ′ → T be a finite harmonic morphism of degree k from a refinement G ′ to a tree T .It is possible to refine G ′ to a graph G ′′ such that the pre-image divisor, that assigns m φ (v) chips to every vertex in φ −1 (t) for some vertex t of T , has rank at least 1.Furthermore, through methods of algebraic geometry the upper bound  [17].It has been conjectured that this also holds for divisorial gonality [5].
On the other hand, b 1 cannot be bounded above by a function of any notion of gonality alone; consider the banana graph consisting of 2 vertices with m parallel edges between them.This graph has divisorial and stable gonality 2 (obtained by subdividing every edge once), whilst the value of b 1 = m − 1 can be arbitrarily high.
The notions of gonality cannot be bounded in terms of treewidth either.In [20], it is shown that fan-graphs (a path with a universal vertex) have arbitrarily high divisorial gonality, but treewidth 2. This argument works for stable divisorial gonality as well.
This section is devoted to showing that stable gonality and divisorial gonality are unbounded in terms of one another.We construct two families of graphs, in one of which the stable gonality is bounded but the divisorial gonality unbounded, and vice versa in the other.These results function as a justification for the different approaches taken in proving the NPhardness of stable gonality and divisorial gonality: knowledge of one of the two invariants provides little knowledge of the other.
Note that it follows that both stable gonality and divisorial gonality are unbounded in the treewidth and stable divisorial gonality, and that b 1 is unbounded in the divisorial gonality.

Divisorial gonality is unbounded in stable gonality
For a positive integer k, a chain of k cycles is a graph obtained by taking k + 1 vertices v 1 , . . ., v k+1 and connecting v i and v i+1 by two paths of length p i and q i for every i = 1, . . ., k.So the resulting graph consists of k linked cycles of lengths p 1 + q 1 , . . ., p k + q k .A chain of k cycles has stable gonality 2. Indeed, we can subdivide edges to obtain a chain of k cycles in which for every i = 1, . . ., k the vertices v i and v i+1 are connected by two paths of length M, for some large enough M. The obtained graph can be mapped to a path of kM + 1 vertices, yielding a finite harmonic morphism of degree 2.
It was shown in [16] that for 'generic' lengths p i and q i , a chain of k cycles has divisorial gonality at least ⌊ k+3 2 ⌋, meeting the Brill-Noether bound.An exact description of the divisorial gonality of chains of cycles for arbitrary lengths was given in [25].In both papers, the setting is that of 'metric graphs'.However, their lower bounds also hold in our setting since the divisorial gonality of a graph is at least the divisorial gonality of the corresponding metric graph with unit edge lengths (see [5]).It follows that the divisorial gonality is not bounded by any function of the stable gonality.An alternative proof for the lower bound on divisorial gonality of chains of cycles (for graphs, not metric graphs) was given in Corollary 17 of the arXiv-version of [20].There, for k ≥ 3, the graph G k is a chain of 2k − 3 cycles with paths of lengths k − 1 and k + 1 connecting v i and v i+1 for every i = 1, . . ., 2k − 3. See Fig. 7 for an illustration of G 3 and G 4 .
There it is shown that dgon(G k ) = k.

Stable gonality is unbounded in divisorial gonality
Ye Luo [3, Example 5.13] gave an example of a graph with divisorial gonality 3 and stable gonality 4, see Fig. 8, showing that graphs exist where the stable gonality is strictly larger than the divisorial gonality.We extend this result by constructing a family of graphs all of which have divisorial gonality at most 3, but the stable gonality is unbounded.Remark 5.2.Notice that the graphs G k constructed above are not unique.See Fig. 9 for an example.In the rest of this section, we fix some sequence G k that can be constructed in this way.
We will prove that the divisorial gonality of G k is 3 for all k ≥ 1, and that the stable gonality of G k is at least k + 2. For this, we first show some lemmas.The first lemma states that, given a finite harmonic morphism φ: G ′ → T , a path in T can be lifted to a path in G ′ .This is due to harmonicity of the morphism φ, and this will be the only consequence of harmonicity that we use in this section.Lemma 5.3.Let G be a graph and φ: G ′ → T a finite harmonic morphism from a refinement of G to a tree T .Let P be a

path and equals P.
Proof.We show this by induction on the length of the path φ(v) − t.If this length equals zero, we are done.Suppose that for every vertex with distance k to φ(v), we can lift this path, i.e. there is a v − u-path Q that is mapped to P. Let t be a vertex with distance k + 1 to φ(v).Let t ′ be the neighbour of t that is closer to φ(v).By the induction hypothesis, there is a path v, u 1 , . . ., u k such that φ(v), φ(u 1 ), . . ., φ(u k ) equals the unique path from φ(v) to t ′ .Since φ is harmonic at u k , there is a neighbour u k+1 of u k , such that φ(u k+1 ) = t.□ Let φ: G ′ k → T be a finite harmonic morphism from a refinement of G k to a tree T .Let C be the central triangle in G k .Call the vertices of this central triangle a i for i ∈ {1, 2, 3}.Write C ′ for the subgraph of G ′ k that consists of C and all refinements added to the edges of C , see Fig. 10.Note that the vertices added to the vertices a i are not part of C ′ .Lemma 5.4.Consider the restriction of φ to C ′ .There is at least one vertex a i such that there is another vertex in C ′ that is mapped to φ(a i ).Proof.Assume that a 1 , a 2 and a 3 are all mapped to unique vertices by φ restricted to C ′ .Denote them by a ′ Proof.We prove this by induction.It is known that G 0 has stable gonality 2, so the statement holds for k = 0. Suppose that sgon(G k−1 ) ≥ k + 1.Consider G k .Let φ: G ′ k → T be a finite harmonic morphism from a refinement of G k to a tree T .By Lemma 5.4, we know that there is a vertex a i , such that there is another vertex w in C ′ that is mapped to φ(a i ).
Consider the copy of G k−1 in G k that shares vertex a i , call this copy H. Write H ′ for the refinement of H in G ′ k .Notice that φ| H ′ : H ′ → φ(H ′ ) is a finite morphism, is harmonic for all vertices except a i .will refine H ′ to extend the restriction of φ to H ′ to a finite harmonic morphism ψ.Consider the tree T ′ = φ(H ′ ).Let e ∈ E φ(a i ) be the edge such that m φ,e (a i ) is maximal.For every edge e ′ = φ(a i )u with m φ,e ′ (a i ) < m φ,e (a i ), we do the following.Let T ′ φ(a i ) (u) be the subtree of T ′ that consists of φ(a i ) together with the component that contains u after removing φ(a i ) from T ′ .We add a copy of T ′ φ(a i ) (u) to a i , and assign index m φ,e (a i ) − m φ,e ′ (a i ) to these new edges.Set ψ as the identity map for those new vertices.For all vertices v of H ′ , set ψ(v) = φ(v).This map ψ is a finite harmonic morphism.By the induction hypothesis it follows that deg(ψ ) ≥ k + 1.
We compute the degree of φ by counting the pre-images of φ(a i ): ≥ k + 2. We conclude that sgon(G k ) ≥ k + 2. □ Theorem 5.6.For every k ≥ 1 there is a graph with divisorial gonality 3 and stable gonality at least k + 2.
Proof.Notice that G 1 has divisorial gonality 3.Moreover, the divisor with 3 chips on a 1 has rank at least 1 and for every vertex v, this divisor is equivalent to the divisor with 3 chips on v.It follows that the divisor on G k with 3 chips on a vertex v has degree 3 and rank at least 1.We conclude that for every k the graph G k has divisorial gonality at most 3.
By Lemma 5.5, we see that the graph G k has stable gonality at least k + 2. □ Remark 5.7.This construction can be carried out in a more general way than what has been done in this section.Instead of using a triangle graph for the construction, one can use any graph G 0 with the following two properties: • for some positive integer d ≥ 3, the divisor with d chips on any vertex is equivalent to the divisor with d chips on any other vertex; • G 0 contains a cycle of length at least 3.
For example, G 0 can be any cycle C n or complete graph K n .In both cases a valid choice for d is n.Moreover, combinations of different graphs that share a possible value for d can be used.The constructed graphs G k have divisorial gonality at most d and stable gonality at least k +

Conclusion
In this paper we have seen several notions of gonality for graphs.We have proven that all are NP-hard to compute.This leaves open some questions regarding the exact complexity of the notions of graph gonality.For example, it is known that the Divisorial Gonality problem is in XP, but it remains open whether it is in FPT or W [1]-hard.For the Stable Gonality problem it is even unknown whether it is in XP.It is unknown whether any of the notions of gonality for graphs can be used as parameter for FPT-algorithms: it is interesting to see NP-hard problems that are not tractable on graphs of bounded treewidth, but are tractable on graphs of bounded gonality.
Moreover, we have seen that all notions of graph gonality are APX-hard.As mentioned before, it is unknown whether any of these are in APX.

.
An upper bound for stable gonality has been established in terms of the first Betti number b 1 = |E| − |V | + 1: for any connected graph G one has sgon(G) ≤ b 1 + 3 2

Fig. 1 .
Fig. 1.An overview of the relations between different graph invariants.When no arrow is drawn from one parameter to another, the one is unbounded in terms of the other.

Lemma 2 . 1 .
Let D and D ′ be equivalent effective divisors satisfying D ̸ = D ′ .Then there is a chain of sets

Fig. 3 .
Fig.3.A finite harmonic morphism from a cycle to a path.Every vertex is mapped to the vertex on its right side and every edge is assigned index 1.

Lemma 3 . 1 .
Let D ≥ 0 be a divisor on G and let u, v ∈ V .Then u ̸ ∼ D v if and only if for some effective divisor D ′ ∼ D we can fire a subset U with u ∈ U, v ̸ ∈ U.In particular, u ∼ D v if every u-v cut has more than deg(D) edges.

Fig. 4 .
Fig. 4. On the left a graph G, on the right the corresponding graph Ĝ, where the M-fold parallel edges are drawn as bold edges.Here M = 12 + 10 + 2 = 24.
Let D ≥ 0 be a divisor on Ĝ with rank(D) ≥ 1 and deg(D) = dgon( Ĝ).Consider the equivalence relation ∼ D on V ( Ĝ).Clearly, deg(D) ≤ |V ( Ĝ)| = 3|V | + 2|E| + 1 < M. Hence, by Lemma 3.1, the M-fold edges are D-blocking.It follows that for every v ∈ V T ∼ D T v and v ∼ D e v for every edge e incident to v in G.

Theorem 3 . 4 .
≥ 1 for every edge e with head v i .It follows that D has positive rank.□ The Divisorial Gonality problem is NP-hard.Proof.Lemma 3.3 provides a polynomial-time reduction from the Independent Set problem to the Divisorial Gonality problem.The result now follows directly from the NP-hardness of the Independent Set problem.□ We define the Stable Divisorial Gonality problem similarly: Stable Divisorial Gonality Input: Graph G = (V , E), integer k ≤ |V |.Question: Is sdgon(G) ≤ k?

Theorem 3 . 5 .Lemma 3 . 6 .
The Stable Divisorial Gonality problem is NP-hard.Before giving the proof, we need a generalisation of Lemma 3.2.Given an effective divisor D, define a D-blocking path as a path where every internal vertex has degree 2 and whose ends are equivalent under ∼ D .Note that if D ′ ∼ D then the D-blocking paths are the same as the D ′ -blocking paths.We call a D-blocking path clean if its internal vertices together contain at most 1 chip in D. Observe that there is always an effective D ′ ∼ D in which all D-blocking paths are clean.Indeed, if P is a D-blocking path that is not clean, we can take two chips on its internal vertices and move them in opposite directions along the path until at least one of them reaches an end of the path.Repeating this results in a divisor D ′ ∼ D in which all D-blocking paths are clean.Let D ≥ 0 be a divisor on G = (V , E). Suppose that all D-blocking paths are clean.Let U be a component of the subgraph obtained from G by deleting the edges and internal vertices of all D-blocking paths.Then for every effective divisor D ′ ∼ D we have ∑ u∈U D ′ (u) ≤ ∑ u∈U D(u).Proof.Let U 1 ⊆ • • • ⊆ U k be the chain of subsets obtained from applying Lemma 2.1 to D and D ′ .Suppose for contradiction that

Lemma 3 . 7 .
Given a divisor D ≥ 0 and a vertex v ∈ V (G), denote by D v the unique v-reduced divisor equivalent to D (see Lemma 2.2).Let D ≥ 0 be a divisor on G and let u, v ∈ V (G) be distinct vertices.Then u ∼ D v if and only if D u = D v .

Fig. 5 .
Fig. 5.The graph Ĝ when we start with a triangle G.

Fig. 10 .
Fig. 10.Left: A refinement of the graph G 1 .Right: The refinement C ′ of the central triangle.
effective outside v and no subset of V \ {v}

Definition 2.3. Let
The 'only if' part follows since moving from any effective D ′ ∼ D to D v can only increase the number of chips on v by Lemma 2.1.We end this section with the notion of refinements and stable divisorial gonality.G be a graph.A refinement of G is a graph G ′ obtained from G by subdividing edges and adding degree one vertices (leaves), see Fig.2.

Definition 2.4. Let
G be a graph.The stable divisorial gonality of G is defined as sdgon then each of {e u } and {e v } is the vertex set of a component of H, so each must contain at least one chip.If e u ̸ ∼ e v , the set {e u , e v } is the vertex set of a component of H and must contain at least one chip.Note that e u ∼ D e v if and only if u If we let S be any minimal vertex cover, then |S| = τ (H) and |{uv ∈ E(H) | u, v / ∈ S}| = 0, hence the left hand side is at most the right hand side.To argue the other inequality, assume |S| = τ (H) − a for some a > 0 and |{uv ∈ E(H) | u, v / ∈ S}| < a.For every edge in {uv ∈ E(H) | u, v / ∈ S} choose one of the endpoints and add it to S, obtaining a new set S ′ .By construction {uv ∈ E(H) | u, v / ∈ S ′ } = ∅ and thus S ′ is a vertex cover.However |S ′ | = |S| + |{uv ∈ E(H) | u, v / ∈ S}| < τ (H), contradicting the minimality of τ (H).Thus the desired equality holds.□Wecannowstate the main lemma for proving hardness of the stable gonality problem.Let G be a simple graph and Ĝ the graph constructed above.Denote by n the number of vertices of G and by τ (G) the minimal size of a vertex cover of G. Then sgon( Ĝ)≤ n + k + 1 if and only if τ (G) ≤ k.Proof.Suppose that G has a vertex cover of size at most k, let S be such a vertex cover.We will construct a finite harmonic morphism from Ĝ to a tree.Define T as a star with 2n − |S| vertices, write t ′ for the centre and v ′ 1 , . . ., v ′ where τ (H) denotes the size of a minimal vertex cover of H.Proof.
In Lemma 4.2 we proved an reduction from the Vertex Cover problem to the Stable Gonality problem.This reductions can be done in polynomial time.Since the Vertex Cover problem is NP-hard, it follows that the Stable Gonality problem is NP-hard as well.□ and thus τ (G) ≤ k. □ Theorem 4.3.The Stable Gonality problem is NP-hard.Proof.
add one of its endpoints.Write S ′ for this set.Notice that S ′ is a vertex cover with size at most |S| + |E[V \S]|.From the proof of Lemma 4.2, it follows that Notice that this distance is at least 2, so there is an internal vertex b ′ on the a ′ 2 − a ′ 3 -path.Now consider the b ′ − a ′ 1 -path P. Notice that P does not contain both a ′ 2 and a ′ 3 , because the distance d(a ′ Let b be a vertex in the subdivision of the edge a 2 a 3 of G that is mapped to b ′ .By Lemma 5.3, there is a b − u-path Q in G ′ k that is mapped to P. Notice that Q does not contain a 2 and a 3 , because a ′ 2 and a ′ 3 are not contained in P. It follows that Q lies in C ′ .Since every path from b to a 1 does contain a 2 or a 3 , it follows that u ̸ = a 1 .Hence, there is another vertex C ′ that is mapped to a ′ 1 . 1 , a ′ 2 and a ′ 3 respectively.Consider the a ′ i − a ′ j -paths in T .Without loss of generality, the distance d(a ′ 2 , a ′ 3 ) is maximal. 2 , a ′ 3 ) is maximal.□ Lemma 5.5.The stable gonality of G k is at least k + 2 for every k ≥ 0.