Parameterizing Path Partitions

Trier]Henning Fernaucor1

[cor1]Corresponding author; Tel. +49 651 201 2827.

Clermont-Auvergne]Florent Foucaud

Trier]Kevin Mann

Bangalore]Utkarsh Padariya

Bangalore]Rajath Rao K.N.

[Trier]Universität Trier, Fachbereich IV, Informatikwissenschaften, Germany
[Clermont-Auvergne]Université Clermont Auvergne, CNRS, Clermont Auvergne INP, Mines Saint-Étienne, LIMOS, 63000 Clermont-Ferrand, France
[Bangalore]International Institute of Information Technology Bangalore, India

We study the algorithmic complexity of partitioning the vertex set of a given (di)graph into a small number of paths. The Path Partition problem (PP) has been studied extensively, as it includes Hamiltonian Path as a special case. The natural variants where the paths are required to be either induced (Induced Path Partition, IPP) or shortest (Shortest Path Partition, SPP), have received much less attention. Both problems are known to be -complete on undirected graphs; we strengthen this by showing that they remain so even on planar bipartite directed acyclic graphs (DAGs), and that SPP remains -hard on undirected bipartite graphs. When parameterized by the natural parameter “number of paths”, both SPP and IPP are shown to be 1-hard on DAGs. We also show that SPP is in both for DAGs and undirected graphs for the same parameter, as well as for other special subclasses of directed graphs (IPP is known to be -hard on undirected graphs, even for two paths). On the positive side, we show that for undirected graphs, both problems are in , parameterized by neighborhood diversity.
We also give an explicit algorithm for the vertex cover parameterization of PP. When considering the dual parameterization (graph order minus number of paths), all three variants, IPP, SPP and PP, are shown to be in for undirected graphs.
We also lift the mentioned neighborhood diversity and dual parameterization results to directed graphs; here, we need to define a proper novel notion of directed neighborhood diversity. As we also show, most of our results also transfer to the case of covering by edge-disjoint paths, and purely covering.

Path Partitions, -hardness, Parameterized Complexity, Neighborhood Diversity, Vertex Cover Parameterization

§ INTRODUCTION

Graph partitioning and graph covering problems are among the most studied problems in graph theory and algorithms. There are several types of graph partitioning and covering problems including covering the vertex set by stars (Dominating Set), covering the vertex set by cliques (Clique Covering), partitioning the vertex set by independent sets (Coloring), and covering the vertex set by paths or cycles <cit.>. In recent years, partitioning and covering problems by paths have received considerable attention in the literature because of their connections with well-known graph-theoretic theorems and conjectures like the Gallai-Milgram theorem and Berge’s path partition conjecture <cit.>. These studies are motivated by applications in diverse areas such as code optimization <cit.>, machine learning / AI <cit.>, transportation networks <cit.>, parallel computing <cit.>, and program testing <cit.>. There are several types of paths that can be considered: unrestricted paths, induced paths, shortest paths, or directed paths (in a directed graph). A path $P$ is an induced path in $G$ if the subgraph induced by the vertices of $P$ is a path. An induced path is also called a chordless path; isometric path and geodesic are other names for shortest path. Various questions related to the complexity of these path problems, even in standard graph classes, remained open for a long time (even though they have uses in various fields), a good motivation for this project.

In this paper, we mainly study the problem of partitioning the vertex set of a graph (undirected or directed) into the minimum number of disjoint paths, focusing on three problems, Path Partition (PP), Induced Path Partition (IPP) and Shortest Path Partition (SPP) — formal definitions are given in <ref>. A path partition (pp) of a (directed) raph $G$ is a partitioning of the vertex set into unrestricted (directed) paths. The path partition number of $G$ is the smallest size of a pp of $G$. Similar definitions apply to ipp and spp. PP is studied extensively under the names of Path Cover and also Hamiltonian Completion on many graph classes <cit.>.

We give a wide range of results in this paper including complexity (- or 1-hardness) and algorithms (polynomial time or ); see <ref> for a summary of our results. The types of graphs we consider are general directed, directed acyclic (DAG), general undirected and bipartite undirected graphs.
We also consider some structural parameters like the neighborhood diversity
and vertex cover number.

The three problems considered are all -hard. They are mostly studied on undirected graphs, and unless stated otherwise, the following references are for undirected graphs. PP can be seen as an extension of Hamiltonian Path and is thus -hard, even for one path (while for one path, SPP and IPP are very easy, as it suffices to check whether the whole graph is a path). Similarly, IPP is -hard, even for two paths <cit.>. Recently, SPP was proved to be -hard <cit.>, but note that, as opposed to the two other problems, it is polynomial-time solvable for any constant number of paths by an algorithm <cit.>. On trees, the three problems are equivalent, and are solvable in polynomial time (as shown in the 1970s
in <cit.>, see also <cit.> for a recent improved algorithm). As a special case of Hamiltonian Path, it is known that PP is -hard for many graph classes such as planar graphs <cit.> or chordal bipartite graphs <cit.>. On the other hand, it can be solved in polynomial time for some graph classes, such as cographs <cit.>, cocomparability graphs <cit.> or graphs whose blocks are cycles, complete graphs or complete bipartite graphs <cit.> (this includes trees, cactii and block graphs). We refer to <cit.> for further references. IPP can also be solved in linear time for graphs whose blocks are cycles, complete graphs or complete bipartite graphs <cit.>, but no further results for special graph classes seem to be known. For directed graphs, it is known that PP can be solved in polynomial time for DAGs <cit.>.

For a detailed survey on these types of problems (both partitioning and covering versions), see <cit.>, and also <cit.>.

Although every shortest path is an induced path and every induced path is a path, the reverse are not true. In this sense, induced paths can be seen as an intermediate notion between shortest paths and unrestricted paths. However, this intuition may fail in certain contexts. Indeed, some seemingly simple problems related to paths are easy for unrestricted or shortest paths, but become hard for induced paths. For example, given a graph $G$ and three vertices $x,y,z$, determining whether there is an induced path from vertex $x$ to vertex $y$ going through vertex $z$ is -complete <cit.>, while this task is polynomial-time both for unrestricted paths and for shortest paths.

Further related work. As sketched in <cit.>, the PP problem is equivalent to the Hamiltonian Completion problem, asking to add at most $k$ edges/arcs to a (directed) graph to guarantee the existence of a Hamiltonian path. Besides Hamiltonian Path, PP is also directly connected to other graph problems such as $L(2,1)$-labelings <cit.> or the metric dimension <cit.>. It is the object of the Gallai-Milgram theorem, stating that for any minimal path partition of a directed graph, there is an independent set intersecting each path <cit.>, see also <cit.>.

Variations of PP and IPP where the paths must have a prescribed length are also studied, see for example <cit.> and <cit.>, respectively.

The covering versions of PP and IPP (where the paths need not necessarily be disjoint) seem to be very little studied <cit.>, however we can mention some works for PP on DAGs, which is polynomial-time solvable and has numerous practical applications (see <cit.> and references therein). On the other hand, the covering version of SPP was recently studied (often under the name Isometric Path Cover, see <cit.> for a linear-time algorithm on block graphs, <cit.> for an algorithm, <cit.> for -hardness on chordal graphs and approximation algorithms for chordal graphs and other classes, and <cit.> for a $\log n$-factor approximation algorithm. This problem is connected to the Cops and Robber game, where a robber and a set of cops alternatively move in a graph (a move is to reach a neighboring vertex); the robber tries to evade the cops indefinitely, while they try to reach (catch) the robber. As shown in <cit.>, if we are given a set of shortest paths covering all the vertices, we can assign a cop to each path and let him patrol along it (while staying as close as possible to the robber). Eventually, they will catch the robber, and thus the smallest size of such a shortest path cover is an upper bound to the smallest number of cops required to catch the robber. This problem is also connected to decomposition results in structural graph theory <cit.> and to machine learning applications <cit.>.

The versions of PP and SPP where, on the other hand, covering is not required (and the endpoints of the solution paths, called terminals, are prescribed in the input) are widely studied
as Disjoint Paths (DP) <cit.> (sometimes also called Linkage) and
Disjoint Shortest Paths (DSP) <cit.>. Both these problems are -complete and have applications in network routing problems and VLSI design <cit.>. DP in particular has been extensively studied, due to its deep connections with structural graph theory: as part of the celebrated Graph Minor project, Robertson and Seymour showed that for undirected graphs, DP is in , parameterized by the number of paths <cit.>, contrasting PP. An improved algorithm was given in <cit.>. Algorithms were also designed for planar directed graphs <cit.> () and graphs of bounded directed treewidth <cit.> (). Recently, DSP on undirected graphs, which has applications in artificial intelligence <cit.>, was shown to have an algorithm and to be 1-hard when parameterized by the number of paths <cit.>; an improved algorithm was given in <cit.>, and the directed graph case is studied in <cit.>.

A strengthening of the DP problem (motivated by the task of detecting induced subgraphs or induced subdivisions of graphs) is studied under the name Induced Disjoint Paths <cit.>: here, given the terminals, one is looking for disjoint unrestricted paths connecting the terminals, but moreover, no edge should connect two vertices on different paths. This problem is -hard even for two paths <cit.>.

Some further restricted variations around disjoint paths are studied for example in <cit.> (for unrestricted paths) and in <cit.> (for induced paths).

parameter      PP      SPP     IPP
none (UG and DG)
-c. <cit.>             -c. <cit.>      -c. <cit.>
none (bipartite UG)          -c. <cit.>       -c.     open
solution size $k$ (UG)     -h. <cit.>        in                                                                -h. <cit.>
solution size $k$ (DG)     -h. <cit.>        c]@c@open
in (SG)                                                               -h. <cit.>
solution size $k$ (DAG)            c]@c@polynomial
<cit.>       c]@c@-c.
in      c]@c@-c.

neighborhood div. (UG)                  <cit.>

neighborhood div.  (DG)          open

dual $n-k$  (UG)
dual $n-k$  (DG)             open

Summary of known results concerning path partitioning problems. The abbreviations c. and h. refer to completeness and hardness, respectively. In parentheses, we put further input specifications, with UG, DG and SG referring to undirected graphs, directed graphs and special graph classes, respectively. Our results are highlighted in bold face.

Our contribution.
<ref> summarizes known results about the three problems, with our results are highlighted in bold. We fill in most of the hiterto open questions concerning variations of PP, SPP and IPP, e.g.,
we show that SPP has a poly-time algorithm for a fixed number of paths (on undirected graphs, DAGs, planar directed graphs and directed graphs of bounded directed treewidth). This is surprising as both PP and IPP are -hard on undirected graphs for $k = 1$ and for $k = 2$, respectively, see <cit.> and <cit.>. To prove this, we use existing (or faster) algorithms for the related Disjoint (Shortest) Paths problem.
Many of our results concern our problems restricted to DAGs. Notice that PP has a polynomial-time algorithm when restricted to DAGs (using Maximum Matching <cit.>), but the complexity for IPP and SPP was open for such inputs. We show that IPP and SPP are -hard even when restricted to planar DAGs whose underlying graph is bipartite and have maximum degree 4.[We remark that in the conference version of this paper <cit.>, this result was stated by mistake for graphs of maximum degree 3, but the proof is the same here and the statement is corrected.] We strengthen this result using a similar construction as in the classic proof of DP being 1-hard on DAGs by Slivkins <cit.>, to show that IPP and SPP are 1-hard on DAGs. As mentioned above,  Manuel recently showed that SPP is -hard on undirected graphs <cit.>. We extend this result to show that SPP is -hard even when restricted to bipartite graphs that are sparse (they have degeneracy at most 5). The complexity of these problems has not yet been studied when parameterized by structural parameters.
We show that IPP and SPP both belong to when parameterized by standard structural parameters like vertex cover and neighborhood diversity using the technique of Integer Linear Programming.
Also, we lift these considerations to directed graphs. To this end, we introduce the notion of directed neighborhood diversity in this paper, which may be useful for other problems on directed graphs. We also obtain a non-trivial direct  algorithm for UPP when parameterized by the vertex cover number $\vc(G)$ of the input graph $G$, with running time $\Oh^*\left(2^{\Oh(\vc(G)\log(\vc(G)))}\right)$.
Moreover, when considering the dual parameterization (graph order minus number of paths), we show that all three variants, PP, IPP,  and SPP, are in for undirected graphs. This is also the case for directed graphs (except for PP, which is left open). Finally, we also remark that many of our results apply to the purely “vertex covering” versions of PP, IPP,  and SPP, and to their intermediate “vertex covering using edge-disjoint paths” versions.

It is interesting to note the differences in the complexities of the three problems on different input classes. For example, SPP can be solved in -time on undirected graphs, while this is not possible for the other two problems. For DAGs, PP is polynomial-time solvable, but the other two problems are -hard. In a way, as any shortest path is induced, IPP can be seen as an intermediate problem between PP and SPP. Thus it is not too surprising that, when the complexity of the three problems differs, IPP sometimes behaves like PP, and sometimes, like SPP. It would be interesting to find a situation in which all three problems behave differently.

Organization of the paper. We start with formally defining the studied problems in <ref>.  Then we focus our attention on -hardness results in <ref>, showing that IPP and SPP are -hard when the input graph is a DAG, and that SPP is -hard when the input graph is a bipartite graph. Our main result showing that IPP and SPP are 1-hard for the standard parameter $k$ (number of paths) is found in <ref>. We give an algorithm for SPP in <ref>. We then give an algorithm for IPP and SPP when parameterized by neighborhood diversity in <ref>, as well as a non-trivial direct algorithm for PP, parameterized by vertex cover. These results are then applied in <ref> to prove results for the dual parameterization. In <ref>, we discuss the (edge-disjoint) covering versions of the problems, and argue that most of our results translate to this setting as well. We conclude in <ref>.

§ DEFINITIONS

We are using standard terminology concerning graphs, classical and parameterized complexity and we will not iterate this standard terminology here. In particular, a path $P$ can be described by a sequence of non-repeated vertices such that there is an edge between vertices that are neighbors in this sequence. Sometimes, it is convenient to consider $P$ as a set of vertices.
We are next defining the problems considered in this paper. All problems can be considered on undirected or directed graphs, or also on directed acyclic graphs (DAG). We will specify this by prefixing U, D, or DAG to our problem name abbreviations.

We say that a sub-graph $G'$ of $G=(V,E)$ spans $G$ if its vertex set is $V$.
In other words, $G'$ is a partial graph of $G$.
Path Partition(PP for short)A graph $G$, a non-negative integer $k$Are there pairwise vertex-disjoint paths $P_1, \dots , P_{k'}$, with $k'\leq k$, such that, together, these paths span $G$ ?

A path $P$ is an induced path in $G$ if the induced graph $G[P]$ is a path; here, $P$ is considered as a vertex set.

Induced Path Partition(IPP for short)A graph $G$, a non-negative integer $k$Are there pairwise vertex-disjoint paths $P_1, \dots , P_{k'}$, with $k'\leq k$, that are induced paths, and such that, together, these paths span $G$ ?

A shortest path is a path with end-points $u,v$ that is shortest among all paths from $u$ to $v$. The greatest length of any shortest path in a graph $G$ is also known as its diameter, written as $\diam(G)$.

Shortest Path Partition(SPP for short)A graph $G$, a non-negative integer $k$Are there pairwise vertex-disjoint paths $P_1, \dots , P_{k'}$, with $k'\leq k$, that are shortest paths, and such that, together, these paths span $G$ ?

The following known combinatorial properties are helpful to connect the different yet related problems:

* Every shortest path is also an induced path.

* Every induced path of length at most two is also a shortest path.

* In bipartite graphs, an induced path of length three is a shortest path.

* If $G=(V,E)$ is a subgraph of $H$ and $p$ is a shortest path in $H$ with only vertices of $V$, then $p$ is also a shortest path in $G$.

Omitting the vertex-disjointness condition, we arrive at three covering versions instead:
Path Cover(PC for short)A graph $G$, a non-negative integer $k$Are there  paths $P_1, \dots , P_{k'}$, with $k'\leq k$, such that, together, these paths span $G$ ?

Induced Path Cover(IPC for short)A graph $G$, a non-negative integer $k$Are there  paths $P_1, \dots , P_{k'}$, with $k'\leq k$, that are induced paths and such that, together, these paths span $G$ ?

Shortest Path Cover(SPC for short)A graph $G$, a non-negative integer $k$Are there  paths $P_1, \dots , P_{k'}$, with $k'\leq k$, that are shortest paths and such that, together, these paths span $G$ ?

For clarity, we again prefix these abbreviations with D, DAG, or U to stress the type of graph we are talking about.

Let us also define the non-covering versions of PP, IPP and SPP, that will be used in the paper.

Disjoint Paths(DP for short)A graph $G$, pairs of terminal vertices $\{(s_1, t_1) , \dots, (s_k , t_k) \}$Are there pairwise vertex-disjoint paths $P_1, \dots , P_k$ such that, for $1\leq i\leq k$, the end-points of $P_i$ are $s_i$ and $t_i$?

Analogously to DP, we can define the problems Disjoint Induced Paths[This problem should not be confused with Induced Disjoint Path, see <cit.>, where it is required that any two (unrestricted) solution paths have no adjacent vertices.] and Disjoint Shortest Paths as follows.

Disjoint Induced Paths(DIP for short)A graph $G$, pairs of terminal vertices $\{(s_1, t_1) , \dots, (s_k , t_k) \}$Are there pairwise vertex-disjoint induced paths $P_1, \dots , P_k$ such that, for $1\leq i\leq k$, the end-points of $P_i$ are $s_i$ and $t_i$?

Disjoint Shortest Paths(DSP for short)A graph $G$, pairs of terminal vertices $\{(s_1, t_1) , \dots, (s_k , t_k) \}$Are there pairwise vertex-disjoint shortest paths $P_1, \dots , P_k$ such that, for $1\leq i\leq k$, the end-points of $P_i$ are $s_i$ and $t_i$?

The problems DIP and DP are equivalent  when the inputs are undirected graphs or DAGs, but not for general directed graphs.

Namely, if an input is a -instance of DIP, then trivially it is also a -instance of DP. But also if an input is a -instance of UDP or DAGDP, then it is also a -instance of UDIP or DAGDIP, as we could take each path $P$ in the solution $\mathbb P$ of UDP or DAGDP and find a path $P'$ induced by some subset of vertices of $P$; this can be done by starting a breadth-first search at one endpoint of the path $P$ to reach the other endpoint and choosing a shortest path. This way, we get a set $\mathbb{P}'$ of induced paths as a solution to UDIP or DAGDIP. This does not hold true for general directed graphs, as a solution to DDP does not imply a solution to DDIP. For example, consider a directed graph with three vertices $a_1,a_2,a_3$ and arcs $(a_1,a_2), (a_2,a_3), (a_3,a_1)$ with $(s_1,t_1) = (a_1,a_3)$ as the prescribed path endpoints.

Interestingly, and contrasting <ref>, we will see that the complexities of DAGPP and DAGIPP differ drastically, see <ref>.

§.§ Graph notions

A graph is $d$-degenerate if every induced subgraph has a vertex of degree at most $d$.

The vertex cover number of a graph $G$ is the smallest size of a vertex cover of $G$, that is, a set $S$ of vertices of $G$ such that each edge of $G$ intersects $S$.

The neighborhood diversity <cit.> of a graph $G$ (or just $\nd(G)$)
is the number of equivalency classes of the following equivalence: two vertices
$u, v \in V$ are equivalent (we also say that they have the same type) if they have the same neighborhoods except for possibly
themselves, i.e., if $N(v) \setminus \{u\} = N(u) \setminus \{v\}$. The equivalence classes form either cliques or independent sets. More information on this parameter can be found in <cit.>. Notice that $V$ can be partitioned into vertices of the same type in linear time using fast modular decomposition <cit.>.

§ -HARDNESS RESULTS

This section contains several -hardness reductions for the studied problems.

§.§ SPP and IPP on DAGs

A well-known result related to $\textsc{PC}$ in DAGs is Dilworth's theorem: the minimal size of a directed path cover equals the maximal cardinality of an independent set (or, in the original language of posets, the minimum size of a chain cover is equal to the maximum size of an antichain) <cit.>. Fulkerson <cit.> gave a constructive proof of this theorem, see also <cit.> for further information. Hence, the DAGPC problem can be reduced to a maximum matching problem in a bipartite graph. Even DAGPP can be solved in polynomial time by reducing it to a matching problem in a bipartite graph <cit.>. We show that, in contrast, DAGSPP and DAGIPP are -hard even when restricted to planar bipartite DAGs.

DAGSPP and DAGIPP are -hard even when the inputs are restricted to planar bipartite DAGs of maximum degree 4.

Our reduction is adapted from <cit.>.
We  reduce from the Planar $3$-Dimensional Matching problem, or Planar $3$-DM, which is -complete (see <cit.>), even when each element occurs in either two or three triples.

A $3$-DM instance consists of three disjoint sets $X, Y, Z$ of equal cardinality $p$ and a set $T$ of triples from $X \times Y \times Z$. Let $q= |T|$. The question is if there are $p$ triples which contain all elements of $X$, $Y$ and $Z$. We associate a bipartite graph with this instance.
We assume that the four sets $T$, $X$, $Y$ and $Z$ are pairwise disjoint. We also assume that each element of $X\cup Y\cup Z$ belongs to at most three triples. We have a vertex for each element in $X, Y, Z$ and each triple in $T$. There is an edge connecting triples to elements if and only if the element belongs to the triple. This graph $G$ is bipartite with vertex bipartition of $T, X \cup Y \cup Z$, and has maximum degree 3. We say the instance is planar if $G$ is planar. Given an instance of Planar $3$-DM, $G = (T , X \cup Y \cup Z , E)$,  and a planar embedding of it,[This planar embedding can be computed in linear time if necessary.]  we build an instance $G' = (V', E')$ of DAGSPP.

Construction: We replace each $v_i = (x, y, z) \in T$, where $x \in X$, $y \in Y$, $z \in Z$, with a gadget $H(v_i)$ that consists of $9$ vertices named $l_{jk}^{i}$ where $1 \leq j,k \leq 3 $ and with edges as shown in  <ref>; if the planar embedding has $x, y, z$ in clockwise order seen as neighbors of $v_i$, then we add the arcs $(l_{12}^{i},x)$, $(l_{22}^{i},z)$ and $(l_{32}^{i},y)$, otherwise, we add the arcs  $(l_{12}^{i},x)$, $(l_{22}^{i},y)$ and $(l_{32}^{i},z)$.

1.1every picture/.style=line width=0.75pt

roundnode/.style=circle, draw=black,  thick, minimum size=5mm, scale=0.5]

[roundnode,scale = 1.4] at (-5.5,1)     (x1)                              $x$;

[roundnode,scale = 1.4] at (-4.3,1)     (y1)                              $y$;

[roundnode,scale = 1.4] at (-2.6,1)     (z1)                              $z$;

[roundnode] at (-6.5,2)     (l11)                              $l_{11}^{i}$;

[roundnode] at (-5.5,2)     (l12)                              $l_{12}^{i}$;

[roundnode] at (-5.5,3)     (l13)                              $l_{13}^{i}$;

[roundnode] at (-3.3,2)     (l21)                              $l_{21}^{i}$;

[roundnode] at (-4.3,2)     (l22)                              $l_{22}^{i}$;

[roundnode] at (-4.3,3)     (l23)                              $l_{23}^{i}$;

[roundnode] at (-1.6,2)     (l31)                              $l_{31}^{i}$;

[roundnode] at (-2.6,2)     (l32)                              $l_{32}^{i}$;

[roundnode] at (-2.6,3)     (l33)                              $l_{33}^{i}$;

[-Stealth[scale=0.8]] (l11) to (l12);
[-Stealth[scale=0.8]] (l12) to (l13);
[-Stealth[scale=0.8]] (l12) to (x1);

[-Stealth[scale=0.8]] (l21) to (l22);
[-Stealth[scale=0.8]] (l22) to (l23);
[-Stealth[scale=0.8]] (l22) to (y1);
[-Stealth[scale=0.8]] (l21) to (l33);

[-Stealth[scale=0.8]] (l31) to (l32);
[-Stealth[scale=0.8]] (l32) to (l33);
[-Stealth[scale=0.8]] (l32) to (z1);

[-Stealth[scale=0.8]] (l13) to (l23);
[-Stealth[scale=0.8]] (l23) to (l33);

[-Stealth[scale=0.8]] (l11.north) to [out=90,in=150] (l23.north);

The vertex gadget, replacing $v_i$ in $G$ with nine vertices in $G'$, as defined in the proof of <ref>.

We observe the following two properties of $G'$.

$G'$ is a planar DAG with maximum degree 4 in which every shortest/induced path is of length at most $3$, and the underlying undirected graph of $G'$ is bipartite.

The first four conditions are easy to see in the given construction. We will prove the bipartiteness claim by giving a proper 2-coloring. We will color all vertices which represent the elements of sets $X$ and $Z$ with color $1$, and all vertices which represent elements of set $Y$ with color $2$. Then we observe that within the gadget $H(v_i)$, the vertices $l_{12},l_{23},l_{21}, l_{32}$ have color $2$, and the remaining vertices have color $1$. This  coloring is a proper $2$-coloring of $G'$.

The Planar $3$-DM instance has a solution if and only if $G'$ can be partitioned into $p + 3q$ shortest/induced paths.

We claim that t Since $|V(G')| = 3p + 9q $, if $G'$ can be partitioned into $p + 3q$ shortest/induced paths, we observe that the average path length has to be 2. Observe also that none of the paths can contain more than one of the original elements of $X \cup Y \cup Z$.

The only possible shortest/induced paths of length 3 are of the form $p^i = l_{12}^{i} l_{13}^{i} l_{23}^{i} l_{33}^{i}$, but if one takes this path into the solution, to cover vertex $l_{11}^{i}$, one has to include this vertex as a single vertex path, hence the average path length of such a solution would be strictly less than 2. We can also eliminate paths $p^i_1 = l_{11}^{i} l_{23}^{i} l_{33}^{i}$ and $p^i_2 = l_{22}^{i} l_{23}^{i} l_{33}^{i}$ from the solution of $G'$ by similar arguments. More precisely, taking $p^i_1$ would force us to also take the path $l_{12}^{i}l_{13}^{i}$, and taking $p^i_2$ even makes us select the singe vertex path $l_{21}^{i}$. Again, the average path length of such a solution would be strictly less than $2$.

In summary, each shortest or induced path in the solution contains exactly three vertices, and each gadget $H(v_i)$ is partitioned into $P_3$-paths in one of the two ways shown in <ref>.

We now describe how to read off a solution of the original Planar $3$-DM instance as described by $G$ from a shortest/induced path partition of $G'$ into $p + 3q$ shortest/induced paths.
If a gadget $H(v_i)$ is partitioned as in $(2)$ in <ref>, we select that triple $v_i = (x, y, z) \in T$ into the solution $S$ of $G$,
else we do not select the triple into the solution. Since the solution covers all vertices of $G'$, it will cover in particular all vertices from $X\cup Y\cup Z$; thus, the selected set $S$ of triples will form a Planar $3$-DM solution.

Conversely, if $S$ is a solution of the Planar $3$-DM instance specified by $G$, then for $v_i = (x, y, z) \in S$, partition the corresponding $H(v_i)$ as described in  $(2)$ of <ref>, and partition every other $H(v_j)$ as shown in $(1)$ of <ref>. This provides a shortest/induced path partition of $G'$ into $p + 3q$ shortest paths.

This completes our proof of the theorem.

every picture/.style=line width=0.75pt

roundnode/.style=circle, draw=black,  thick, minimum size=5mm, scale=0.55]

[roundnode,scale = 1.4] at (-5,1)     (x1)                              $x$;

[roundnode,scale = 1.4] at (-3.3,1)     (y1)                              $y$;

[roundnode,scale = 1.4] at (-1.6,1)     (z1)                              $z$;

[roundnode] at (-6,2)     (l11)                              $l_{11}^{i}$;

[roundnode] at (-5,2)     (l12)                              $l_{12}^{i}$;

[roundnode] at (-5,3)     (l13)                              $l_{13}^{i}$;

[roundnode] at (-4.3,2)     (l21)                              $l_{21}^{i}$;

[roundnode] at (-3.3,2)     (l22)                              $l_{22}^{i}$;

[roundnode] at (-3.3,3)     (l23)                              $l_{23}^{i}$;

[roundnode] at (-2.6,2)     (l31)                              $l_{31}^{i}$;

[roundnode] at (-1.6,2)     (l32)                              $l_{32}^{i}$;

[roundnode] at (-1.6,3)     (l33)                              $l_{33}^{i}$;

[roundnode,scale = 1.4] at (1,1)     (x2)                              $x$;

[roundnode,scale = 1.4] at (2.7,1)     (y2)                              $y$;

[roundnode,scale = 1.4] at (4.4,1)     (z2)                              $z$;

[roundnode] at (0,2)     (a11)                              $l_{11}^{i}$;

[roundnode] at (1,2)     (a12)                              $l_{12}^{i}$;

[roundnode] at (1,3)     (a13)                              $l_{13}^{i}$;

[roundnode] at (1.7,2)     (a21)                              $l_{21}^{i}$;

[roundnode] at (2.7,2)     (a22)                              $l_{22}^{i}$;

[roundnode] at (2.7,3)     (a23)                              $l_{23}^{i}$;

[roundnode] at (3.4,2)     (a31)                              $l_{31}^{i}$;

[roundnode] at (4.4,2)     (a32)                              $l_{32}^{i}$;

[roundnode] at (4.4,3)     (a33)                              $l_{33}^{i}$;

[-Stealth[scale=1]] (l11) to (l12);
[-Stealth[scale=1]] (l12) to (l13);
[-Stealth[scale=1]] (l21) to (l22);
[-Stealth[scale=1]] (l22) to (l23);
[-Stealth[scale=1]] (l31) to (l32);
[-Stealth[scale=1]] (l32) to (l33);

[-Stealth[scale=1]] (a11) to (a12);
[-Stealth[scale=1]] (a12) to (x2);
[-Stealth[scale=1]] (a21) to (a22);
[-Stealth[scale=1]] (a22) to (y2);
[-Stealth[scale=1]] (a31) to (a32);
[-Stealth[scale=1]] (a32) to (z2);

[-Stealth[scale=1]] (a13) to (a23);
[-Stealth[scale=1]] (a23) to (a33);

at (-3.3,0.3) $(1)$;
at (2.7,0.3) $(2)$;

Two different vertex partitions of a $H(v_i)$ gadget into 3-vertex paths, corresponding to different triple selections in the construction of <ref>.

§.§ SPP for bipartite undirected graphs

Next, we prove that USPP is -hard even when the input graph is restricted to bipartite $5$-degenerate graphs with diameter at most 4. To prove this, we reduce from $4$-USPP on bipartite graphs to USPP on bipartite graphs. $4$-USPP asks, given $G=(V,E)$, if there exists a partition $\mathbb{P}$ of $V$ such that each set in $\mathbb{P}$ induces a shortest path of length 3 in $G$. First, we show that $4$-USPP is -hard on bipartite graphs (<ref>) by a reduction from $4$-UIPP (also known as
Induced $P_4$-Partition) on bipartite graphs.
$4$-UIPP asks if there exists a partition $\mathbb{P}$ of $V$ such that each set in $\mathbb{P}$ induces a path of length 3 in $G$.

$4$-UIPP is -hard for bipartite graphs of maximum degree $3$.

$4$-USPP is -hard for bipartite graphs of maximum degree $3$.

This follows from <ref> and the fact that, in a bipartite graph, a path of length three is  an induced path iff
it is a shortest path, see <ref>.

USPP is -hard, even for bipartite 5-degenerate graphs with diameter 4.

To prove this claim, we use  <ref>. Given an instance of $4$-USPP, say, $G = (V, E)$, with bipartition $V=A \cup B$ and $|V| = 4k$, as the number of vertices must be divisible by 4, we create an instance $G'=(V',E')$ of USPP.

Construction:  We add $10$ new vertices to $G$, getting
$$V' = V \cup \{x_1,x_2,x_3,x_4,x_5,y_1,y_2,y_3,y_4,y_5\}\,.$$
We add edges from $x_2$ and $x_4$ to all vertices of $B\cup\{y_2,y_4\}$. Also, add edges from $y_2$ and $y_4$ to all vertices of $A$,
add further edges to form paths $x_1x_2x_3x_4x_5$ and $y_1y_2y_3y_4y_5$.
The remaining edges all stem from $G$. See <ref> for an illustration.
This  describes $E'$ of $G'$.

$G'=(V',E')$ is bipartite and 5-degenerate.

We can make the claimed bipartition explicit by writing  $V'=A' \cup B'$, where $A'=A \cup \{x_2,x_4,y_1,y_3,y_5\}$ and $B'=B \cup \{x_1,x_3,x_5,y_2,y_4\}$ (see <ref>).

every picture/.style=line width=0.75pt
roundnode/.style=circle, draw=black,  thick, minimum size=5mm, scale=0.5,
squarednode/.style=rectangle, draw=black, thick, minimum size=5mm,

[roundnode] at (0.5,0)     (x1)                               $x_1$;

[roundnode] at (0.5,0.5)     (x2)                               $x_2$;

[roundnode] at (0.5,1)     (x3)                               $x_3$;

[roundnode] at (0.5,1.5)     (x4)                               $x_4$;
[roundnode] at (0.5,2)     (x5)                               $x_5$;

[roundnode] at (2.5,0)     (y1)                               $y_1$;

[roundnode] at (2.5,0.5)     (y2)                               $y_2$;

[roundnode] at (2.5,1)     (y3)                               $y_3$;

[roundnode] at (2.5,1.5)     (y4)                               $y_4$;
[roundnode] at (2.5,2)     (y5)                               $y_5$;

[rectangle,draw,minimum width = 1cm,
minimum height = 2cm] (b) at (-1,0.3) $B$;

[rectangle,draw,minimum width = 1cm,
minimum height = 2cm] (a) at (4,0.3) $A$;

(x1) to (x2);
(x2) to (x3);
(x3) to (x4);
(x4) to (x5);
(y1) to (y2);
(y2) to (y3);
(y3) to (y4);
(y4) to (y5);

(x2) to (y2);
(x2) to (y4);

(x4) to (y2);
(x4) to (y4);

[ultra thick](x4) to (b);
[ultra thick](x2) to (b);

[ultra thick] (y4) to (a);
[ultra thick] (y2) to (a);

[ultra thick,dashed,bend left=25] (a) to (b);

A sketch of $G' = (V',E')$; thick lines mean that all the edges across two sets are present. The thick dashed line represents all edges that have been present between $A$ and $B$ already in $G$.

Hence, $G'$ is bipartite. Now we prove that $G'$ is 5-degenerate.
As the maximum degree of $G$ is three and as the construction of $G'$ will add two more neighbors to each vertex of $A\cup B$, vertices from $A\cup B$ have maximum degree 5 within $G'$.
Hence, we can remove them one-by-one in a first phase.
Now, observe that the induced graph $G'[X\cup Y]$ remains, with $X=\{x_i\mid i\in [5]\}$ and $Y=\{y_i\mid i\in [5]\}$, and this graph again has maximum degree 4. Hence, we can remove all vertices of $X\cup Y$ one-by-one in a second phase, this way completely exhausting $V'$.

Any shortest path of $G'$, except for the six paths
$x_1x_2x_3x_4x_5$, $x_1x_2y_2x_4x_5$, $x_1x_2y_4x_4x_5$ and $y_1y_2y_3y_4y_5$, $y_1y_2x_2y_4y_5$, $y_1y_2x_4y_4y_5$, contains at most four vertices. Hence, $G'$ has a diameter at most 4.

First, observe $(*)$ that by construction, the two complete bipartite graphs $G_1=(A_1\cup B_1,A_1\times B_1)$ and $G_2=(A_2\cup B_2,A_2\times B_2)$, formed with the two sets $A_1=A\cup\{x_2,x_4\}$ and $B_1=\{y_2,y_4\}$, as well as $A_2=\{x_2,x_4\}$ and $B_2=B\cup\{y_2,y_4\}$ are subgraphs of $G'$.

Let us consider a shortest path $p = v_1v_2v_3v_4v_5$ in $G'$, with more than four vertices. If the starting vertex $v_1$ lies in $A'$,
then $v_2\in B'$, $v_3\in A'$, $v_4\in B'$ and $v_5\in A'$, as $G'$ is bipartite. If $v_1,v_5\in A_1$, then by our observation $(*)$, there is a shorter path from $v_1$ to $v_5$, namely  $v_{1}y_{2}v_{5}$.
Similar arguments work if $v_1,v_5\in B_2$.
Now, we will show for a shortest path $p$, if the starting vertex is $v_1 = y_1\in A'$, then $p$ must be like $p = y_1y_2y_3y_4y_5$ or  $p = y_1y_2x_4y_4y_5$. As noted above,  $v_5 \in A'$. We observe that $v_1 = y_1$ enforces $v_2=y_2$.
We find that $v_5 \notin A \cup \{y_3,x_2,x_4\}$, as there is a shorter path $y_1y_2v_5$, i.e., $v_5=y_5$, which also enforces $v_4=y_4$ and finally $v_3=y_3$, $v_3=x_2$ or $v_3=x_4$ as claimed.
Similar arguments work when the starting vertex $v_1$  lies in  $\{x_1,x_5,y_5\}$.

The arguments leading to the previous claim also give raise to the following one.

The only two shortest paths in $G'$ that have five vertices and that can simultaneously exist in a path partition are $x_1x_2x_3x_4x_5$ and $y_1y_2y_3y_4y_5$.   $\Diamond$

Notice that <ref> and <ref> together guarantee the additional properties of the constructed graph $G'$ that have been claimed in <ref>.

Let $u,v\in V$ have distance $d<3$ in $G$. Then, they also have distance $d$ in $G'$.
Hence, if $p$ is a shortest path on at most three vertices in $G$, then $p$ is also a shortest path in $G'$.

This observation is trivial if $d=0,1$, and it follows for $d=2$ as (also) the graph $G'$ is bipartite by <ref>.

Now, we claim that $G$ is a -instance of $4$-USPP if and only if $G'$ has a shortest path partitioning of cardinality $k'=k + 2$, where $|V|=4k$. For the forward direction, let $D$ be any solution of $4$-USPP for $G$, containing $k$ shortest paths. To construct a solution $D'$ of USPP for the instance $(G',k')$, we just need to add the two paths $x_1x_2x_3x_4x_5$ and $y_1y_2y_3y_4y_5$ to $D$.
By <ref>, every path $p \in D$ is in fact a shortest path in $G'$. Hence, $D'$ is a set of shortest paths with cardinality $k'=k + 2$ that covers all vertices of $G'$.

For the backward direction, assume $G'$ has a  solution $D'$, where $|D'|=k'=k+2$. As $|V'| = 4k + 10$ by construction, we know by <ref> that $D'$ contains $k$ paths of length three and two paths of length four. By <ref>,  $\{x_1x_2x_3x_4x_5,y_1y_2y_3y_4y_5\} \subseteq D'$ and the rest of the paths of $D'$ are of length three and consists of vertices from $V$ only. Let $D = D' \setminus \{x_1x_2x_3x_4x_5,y_1y_2y_3y_4y_5\}$.
As the $k$ paths of $D$ are each of length three also in $G$ (by <ref>) and as they cover $V$ completely, $D$ provides a solution to the $4$-USPP instance $G$.

§ 1-HARDNESS FOR DAGSPP AND DAGIPP

The natural or standard parameterization of a parameterized problem stemming from an optimization problem is its solution size. We will study this type of parameterization in this section for path partitioning problems. More technically speaking, we are parameterizing these problems by an upper bound on the number of paths in the partitioning. Unfortunately, our results show that for none of the variations that we consider, we can expect -results.

DAGSPP and DAGIPP are 1-hard when parameterized by solution size.

The following reduction is non-trivially adapted from <cit.>.

We define a parameterized reduction from Clique to DAGSPP/DAGIPP (all parameterized by solution size). We focus on DAGSPP, but all the arguments work for DAGIPP as well. Let $(G,k)$ be an instance of Clique, where $k\in\mathbb{N}$ and $G=(V,E)$. We construct an equivalent instance $(G',k')$ of the DAGSPP problem, where $G'$ is a DAG and $k' = \frac{k\cdot (k-1)}{2} + 3k$. Let $V=[n]$.

Overview of the construction: We create an array of $k\times n$ identical gadgets for the construction, with each gadget representing a vertex in the original graph. We can visualize this array as having $k$ rows and $n$ columns.  If the DAGSPP instance $(G',k')$ is a -instance, then we show that each row has a so-called selector in the solution. Here, a selector is a path that traverses all but one gadget in a row, hence skipping exactly one of the gadgets. The  vertices in $G$ corresponding to the skipped gadgets form a clique of size $k$ in $G$. To ensure that all selected vertices form a clique in $G$, we have so-called verifiers in DAGSPP. Verifiers are the paths that are used for each pair of rows to ensure that the vertices corresponding to the selected gadgets in these rows are adjacent in $G$. This way, we also do not have to check separately that the selected vertices are distinct.
Construction details: The array of gadgets is drawn with row numbers increasing downward and column numbers increasing to the right. Arcs between columns go down and arcs within the same row go to the right. To each row $i$, with $i \in [k]$, we add a start terminal, an arc $(s_i,s'_i)$, and an end terminal, an arc $(t'_i,t_i)$. Next, add arcs starting from $s_i,s'_i$ to $t_l$ and $t'_l$, with $l>i$. Also, for each row, we have $k - i$ column start terminals, arcs $(s_{i,j},s'_{i,j})$ with $i < j$, and $i - 1$ column end terminals,  arcs $(t_{j,i},t'_{j,i})$ with $j \in [i-1]$. Also, add arcs from vertices $s_{i,j}$ and $s'_{i,j}$ to all vertices $t'_{j,p}$ with $p < j$ if $j>i$, and to $t_l$, $t'_l$ if $l\geq i$.

Gadgets are denoted by $G_{i,u}$, $i \in [k]$, corresponding to $u \in V$. Each  gadget $G_{i,u}$ consists of $k-1$ arcs ($a_r^{i,u}$, $b_r^{i,u}$), with $r \in [k] \setminus \{i\}$.
To each row $i\in [k]$, we also add dummy gadgets
$G_{i,0}$ and $G_{i,n+1}$. $G_{i,0}$ consists of two arcs, $(a_1^{i,0},a_2^{i,0})$ and $(b_1^{i,0},b_2^{i,0})$, also add arcs from $b_1^{i,0}$ and $b_2^{i,0}$ to $t_m, t'_m$ and $t_{m,h}$ where $m < h$ and $i \leq h$. $G_{i,n+1}$ consists of a directed $P_{k+2}$ and an arc $(b_1^{i,n+1},b_2^{i,n+1})$ ; the $P_{k+2}$-vertices are named $a_j^{i,n+1}$, with $j \in [k+2]$, where $a_{k+2}^{i,n+1}$ has out-degree zero.
We can speak of $T^{i,u}:=\{a_r^{i,u}\mid r\in [k]\setminus\{i\}\}\cup\{a_1^{i,0},a_2^{i,0},a_j^{i,n+1}\mid j \in [k+2]\}$ as being on the top level, while the vertices $B^{i,u}:=\{b_r^{i,u}\mid r\in [k]\setminus\{i\}\}\cup\{b_1^{i,0},b_2^{i,0},b_1^{i,n+1},b_2^{i,n+1}\}$ form the bottom level of gadget $G_{i,u}$.

Due to the natural ordering of the wires within a gadget, we can also speak of the first vertex on the top level of a gadget or that last vertex on the bottom level of a gadget. On both levels, the vertices are connected following their natural wire ordering. More technically speaking, this means that within gadget $G_{i,u}$, with $u\in V$, there is an arc from the first vertex of the upper level to the second vertex of the upper level, from the second vertex of the upper level to the third vertex of the upper level etc., up to an arc from the penultimate vertex of the upper level to the last vertex of the upper level.
Moreover, there is an arc from the last vertex of the upper level of $G_{i,u-1}$ to the first vertex of the upper level of $G_{i,u}$ and from the last  vertex of the upper level of $G_{i,u}$ to the first vertex of the upper level of $G_{i,u+1}$.
Analogously, the vertices of the lower level of the gadgets are connected. These notions are illustrated in <ref>. In the figure, we omit the superscripts $(a_r, b_r) = (a_r^{i,u} , b_r^{i,u} )$, where $r \in [k - {i}]$.

every picture/.style=line width=0.75pt

roundnode/.style=circle, draw=black,  thick, minimum size=5mm, scale=0.8,
squarednode/.style=rectangle, draw=red!60, fill=red!5, very thick, minimum size=5mm,
dot/.style=fill=black,circle,minimum size=1pt

[rectangle,draw,minimum width = 6cm,
minimum height = 2cm, rounded corners=5pt] (b) at (,) ;
[roundnode] at (- 1.5cm ,+ 0.5cm )     (a1)  ;
[roundnode] at (- 0.5 cm ,+ 0.5cm )     (a2)  ;

[dot,scale=0.3] at (- 0.1cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (- 0.0cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (+ 0.1cm ,+ 0.5cm) (d1);

[roundnode] at (+ 0.5cm ,+ 0.5cm )     (ai1)  ;
[roundnode] at (+ 1.5cm ,+ 0.5cm )     (ai)  ;

[dot,scale=0.3] at (+ 2cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (+ 2.1cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (+ 2.2cm ,+ 0.5cm) (d1);

[roundnode] at (+ 2.7cm ,+ 0.5cm )     (ak)  ;

[roundnode] at (+ 1.5cm ,+ 1.5cm )     (si)  ;
[roundnode] at (+ 2.7cm ,+ 1.5cm )     (sk)  ;

[roundnode] at (- 1.5cm ,- 0.5cm )     (b1)  ;
[roundnode] at (- 1.5cm ,- 1.5cm )     (t1)  ;

[roundnode] at (- 0.5cm ,- 0.5cm  )     (b2)  ;
[roundnode] at (- 0.5cm ,- 1.5cm )     (t2)  ;

[dot,scale=0.3] at (- 0.1cm ,- 0.5cm) (d1);
[dot,scale=0.3] at (+ 0cm ,- 0.5cm) (d1);
[dot,scale=0.3] at (+ 0.1cm ,- 0.5cm) (d1);

[roundnode] at (+ 0.5cm ,- 0.5cm )     (bi1)  ;
[roundnode] at (+ 0.5cm ,- 1.5cm )     (ti1)  ;
[roundnode] at (+ 1.5cm ,- 0.5cm )     (bi)  ;

[dot,scale=0.3] at (+ 2.cm ,-0.5cm) (d1);
[dot,scale=0.3] at (+ 2.1cm ,-0.5cm) (d1);
[dot,scale=0.3] at (+ 2.2cm ,-0.5cm) (d1);

[roundnode] at (+ 2.7cm ,- 0.5cm )     (bk) ;

[] at (- 1.1cm , + 0.2cm) $a_1$;
[] at (- .15cm , + 0.2cm) $a_2$;
[] at (+ 1cm , + 0.2cm) $a_{i-1}$;
[] at (+0.9cm  , + 1.5cm) $s_{i,i+1}$;
[] at (+ 2.05cm , + 0.2cm) $a_{i+1}$;
[] at (+ 3cm , + 0.2cm) $a_{k}$;
[] at (+3.2cm  , + 1.5cm) $s_{i,k}$;

[] at (- 1.1cm , - 0.8cm) $b_1$;
[] at (- 2cm , - 1.5cm) $t_{1,i}$;
[] at (- .15cm , - 0.8cm) $b_2$;
[] at (-1cm , - 1.5cm) $t_{2,i}$;
[] at (+ 1cm , - 0.8cm) $b_{i-1}$;
[] at (+1.2cm  , - 1.5cm) $t_{i-1,i}$;
[] at (+ 2.05cm , - 0.8cm) $b_{i+1}$;
[] at (+ 3cm , - 0.8cm) $b_{k}$;

[-Stealth[scale=1]] (a1) to (a2);
[-Stealth[scale=1]] (a1) to (b1);
[-Stealth[scale=1]] (a2) to (b2);
[-Stealth[scale=1]] (ai1) to (ai);

[-Stealth[scale=1]] (ai) to (bi);
[-Stealth[scale=1]] (ai1) to (bi1);
[-Stealth[scale=1]] (bi1) to (bi);

[-Stealth[scale=1]] (si) to (ai);
[-Stealth[scale=1]] (sk) to (ak);

[-Stealth[scale=1]] (b1) to (t1);
[-Stealth[scale=1]] (b2) to (t2);
[-Stealth[scale=1]] (bi1) to (ti1);

[-Stealth[scale=1]] (b1) to (b2);
[-Stealth[scale=1]] (ak) to (bk);
[-Stealth[scale=1]] (- 2.5cm, + 0.5cm) to (a1);
[-Stealth[scale=1]] (- 2.5cm, - 0.5cm) to (b1);

[-Stealth[scale=1]] (ak) to (+ 3.8cm, + 0.5cm);
[-Stealth[scale=1]] (bk) to (+ 3.8cm, - 0.5cm);

figureGadget $G_{i,u}$, $0< u \leq n$, $i \in [k]$

every picture/.style=line width=0.75pt

roundnode/.style=circle, draw=black,  thick, minimum size=5mm, scale=0.7,
squarednode/.style=rectangle, draw=red!60, fill=red!5, very thick, minimum size=5mm,
dot/.style=fill=black,circle,minimum size=1pt

[rectangle,draw,minimum width = 3cm,
minimum height = 1.5cm, rounded corners=5pt] (b) at (,) ;

[roundnode] at (- 0.5cm ,+ 0.5cm )     (a1)  ;
[dot,scale=0.3] at (- 0.1cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (- 0.0cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (+ 0.1cm ,+ 0.5cm) (d1);
[roundnode] at (cm ,+ 0.5cm )     (aj)  ;

[dot,scale=0.3] at (+ 0.9cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (+ 1.cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (+ 1.1cm ,+ 0.5cm) (d1);
[roundnode] at (+ 1.5cm ,+ 0.5cm )     (ak)  ;
[roundnode] at (- 0.5 cm ,- 0.5cm )     (b1)  ;
[dot,scale=0.3] at (- 0.1cm ,- 0.5cm) (d1);
[dot,scale=0.3] at (- 0.0cm ,- 0.5cm) (d1);
[dot,scale=0.3] at (+ 0.1cm ,- 0.5cm) (d1);

[roundnode] at (cm ,- 0.5cm )     (bj)  ;
[dot,scale=0.3] at (+ 0.9cm ,- 0.5cm) (d1);
[dot,scale=0.3] at (+ 1.cm ,- 0.5cm) (d1);
[dot,scale=0.3] at (+ 1.1cm ,- 0.5cm) (d1);
[roundnode] at (+1.5 cm ,- 0.5cm )     (bk)  ;

[-Stealth[scale=1]] (a1) to (b1);
[-Stealth[scale=1]] (aj) to (bj);
[-Stealth[scale=1]] (ak) to (bk);

[] at (- 0.2cm , + 0.2cm) $ a_{1}$;
[] at (+ 0.9cm , + 0.2cm) $ a_{j}$;
[] at (+ 1.74cm , + 0.2cm) $ a_{k}$;

[] at (- 0.5cm , - 1cm) $ b_{1}$;
[] at (+ 0.6cm , - 1cm) $ b_{j}$;
[] at (+ 1.9cm , - 0.5cm) $ b_{k}$;

[] at (+ 2.5cm , ) $ G_{i,u}$;

+ 2.2cm
- 2.1cm

[rectangle,draw,minimum width = 3cm,
minimum height = 1.5cm, rounded corners=5pt] (b) at (+ 0.6cm ,+ 0cm) ;

[roundnode] at (- 0.5cm ,+ 0.5cm )     (a12)  ;
[dot,scale=0.3] at ( - 0.1cm , + 0.5cm) (d1);
[dot,scale=0.3] at (- 0.0cm , + 0.5cm) (d1);
[dot,scale=0.3] at (+ 0.1cm , + 0.5cm) (d1);
[roundnode] at (+ 0.5cm , + 0.5cm )     (aj2)  ;

[dot,scale=0.3] at (+ 0.9cm , + 0.5cm) (d1);
[dot,scale=0.3] at (+ 1.cm , + 0.5cm) (d1);
[dot,scale=0.3] at (+ 1.1cm , + 0.5cm) (d1);
[roundnode] at (+ 1.5cm , + 0.5cm )     (ak2)  ;
[roundnode] at (- 0.5 cm , - 0.5cm )     (b12)  ;
[dot,scale=0.3] at (- 0.1cm , - 0.5cm) (d1);
[dot,scale=0.3] at (- 0.0cm , - 0.5cm) (d1);
[dot,scale=0.3] at (+ 0.1cm , - 0.5cm) (d1);

[roundnode] at (+ 0.5 cm  , - 0.5cm )     (bj2)  ;

[dot,scale=0.3] at (+ 0.9cm , - 0.5cm) (d1);
[dot,scale=0.3] at (+ 1.cm , - 0.5cm) (d1);
[dot,scale=0.3] at (+ 1.1cm , - 0.5cm) (d1);
[roundnode] at (+1.5 cm , - 0.5cm )     (bk2)  ;

[-Stealth[scale=1]] (a12) to (b12);
[-Stealth[scale=1]] (aj2) to (bj2);
[-Stealth[scale=1]] (ak2) to (bk2);

[] at (- 0.2cm ,  + 0.2cm) $ a_{1}$;
[] at (+ 0.9cm ,  + 0.2cm) $ a_{i}$;
[] at (+ 1.8cm ,  + 0.2cm) $ a_{k}$;

[] at (- 0.5cm ,  - 1cm) $ b_{1}$;
[] at (+ 0.7cm ,  - 1cm) $ b_{i}$;
[] at (+ 1.5cm ,  - 1cm) $ b_{k}$;

[-Stealth[scale=1]] (bj) to (aj2);

[] at (- 1.5cm , - 0cm   ) $ G_{j,v}$;

figure$G_{i,u}$ connected to $G_{j,v}$, $i<j$

every picture/.style=line width=0.75pt

roundnode/.style=circle, draw=black,  thick, minimum size=5mm, scale=0.5,
squarednode/.style=rectangle, draw=red!60, fill=red!5, very thick, minimum size=5mm,
dot/.style=fill=black,circle,minimum size=1pt

- 1cm

minimum height = 1.5cm, rounded corners=5pt] (b) at (+ 1.25cm,- 0.5cm) ;
[rounded corners = 5pt] (- 0.5cm, + 0.2 cm) rectangle (+ .5cm, - 0.5 cm) ;

[rounded corners = 5pt] (+ 0.75cm, + 0.5 cm) rectangle (+ 1.75cm, - 0.5 cm) ;
[rounded corners = 5pt] (+ 2.25cm, + 0.5 cm) rectangle (+ 3.75cm, - 0.5 cm) ;
[rounded corners = 5pt] (+ 4.25cm, + 0.5 cm) rectangle (+ 5.75cm, - 0.5 cm) ;
[rounded corners = 5pt] (+ 6.25cm, + 0.5 cm) rectangle (+ 7.75cm, - 0.5 cm) ;
[rounded corners = 5pt] (+ 2.25cm, + 0.5 cm) rectangle (+ 3.75cm, - 0.5 cm) ;
[rounded corners = 5pt] (+ 9.25cm, + 0.5 cm) rectangle (+ 10.75cm, - 0.5 cm) ;

[roundnode] at (- 0.3cm  ,)     (si)  ;
[roundnode] at (+ 0.3cm  ,)     (sid)  ;

[roundnode] at (+ 1cm  ,)     (a10)  ;
[roundnode] at (+ 1.5cm  ,)     (a20)  ;

[roundnode] at (+ 2.5cm  ,)     (a11)  ;
[roundnode] at (+ 3.5cm  ,)     (ak1)  ;

[roundnode] at (+4.5cm  ,)     (a12)  ;
[roundnode] at (+ 5.5cm  ,)     (ak2)  ;

[roundnode] at (+ 6.5cm  ,)     (a13)  ;
[roundnode] at (+ 7.5cm  ,)     (ak3)  ;

[dot,scale=0.3] at (+ 8.4cm ,- 0.5cm) (d1);
[dot,scale=0.3] at (+ 8.5cm ,- 0.5cm) (d1);
[dot,scale=0.3] at (+ 8.6cm ,- 0.5cm) (d1);

[roundnode] at (+ 9.5cm  ,)     (a1n)  ;
[roundnode] at (+ 10.5cm  ,)     (akn)  ;

[roundnode] at (+ 1cm  ,+ 0cm )     (b10)  ;
[roundnode] at (+ 1.5cm  ,+ 0cm)     (b20)  ;

[roundnode] at (+ 2.5cm  ,+ 0cm  )     (b11)  ;
[roundnode] at (+ 3.5cm  ,+ 0cm )     (bk1)  ;

[roundnode] at (+4.5cm  ,+ 0cm )     (b12)  ;
[roundnode] at (+ 5.5cm  ,+ 0cm )     (bk2)  ;

[roundnode] at (+ 6.5cm  ,+ 0cm )     (b13)  ;
[roundnode] at (+ 7.5cm  ,+ 0cm )     (bk3)  ;

[roundnode] at (+ 9.5cm  ,+ 0cm )     (b1n)  ;
[roundnode] at (+ 10.5cm  ,+ 0cm )     (bkn)  ;

[roundnode] at (+ 11cm  ,+ 0cm )     (tpi)  ;
[roundnode] at (+ 11.5cm  ,+ 0cm )     (ti)  ;

[-Stealth[scale=]] (si) to (sid);
[-Stealth[scale=]] (sid) to (a10);
[-Stealth[scale=]] (a10) to (a20);
[-Stealth[scale=]] (b10) to (b20);
[-Stealth[scale=]] (a20) to (a11);
[-Stealth[scale=]] (b20) to (b11);
[-Stealth[scale=]] (ak1) to (a12);
[-Stealth[scale=]] (bk1) to (b12);
[-Stealth[scale=]] (ak2) to (a13);
[-Stealth[scale=]] (bk2) to (b13);
[-Stealth[scale=]] (a20) .. controls (3.25,-1) and (3.25,0) .. (b12);
[-Stealth[scale=]] (ak1) .. controls (5.25,-1) and (5.25,0) .. (b13);
[-Stealth[scale=]] (si) to (sid);
[-Stealth[scale=]] (b1n) to (bkn);
[-Stealth[scale=]] (bkn) to (tpi);
[-Stealth[scale=]] (tpi) to (ti);

[-Stealth[scale=+ 0.2], bend left = 16,dashed,thick] (, + 0.25cm) to  (+ 10 cm , + 0.5cm);

[] at (- 0.3cm , - 0.3 cm) $s_i$;
[] at (+ 0.3cm , - 0.3 cm) $s'_i$;

[] at (+ 1cm, + 0.3 cm) $a_1$;
[] at (+ 1.5cm , + 0.3 cm) $a_2$;

[] at (+ 2.5cm, + 0.3 cm) $a_1$;
[] at (+ 3.5cm , + 0.3 cm) $a_k$;

[] at (+ 4.5cm, + 0.3 cm) $a_1$;
[] at (+ 5.5cm , + 0.3 cm) $a_k$;

[] at (+ 6.5cm, + 0.3 cm) $a_1$;
[] at (+ 7.5cm , + 0.3 cm) $a_k$;

[] at (+ 9.5cm, + 0.3 cm) $a_1$;
[] at (+ 10.4cm , + 0.3 cm) $a_{k+2}$;

[] at (+ 1cm, - 1.3 cm) $b_1$;
[] at (+ 1.5cm , - 1.3 cm) $b_2$;

[] at (+ 2.5cm, - 1.3 cm) $b_1$;
[] at (+ 3.5cm , - 1.3 cm) $b_k$;

[] at (+ 4.5cm, - 1.3 cm) $b_1$;
[] at (+ 5.5cm , - 1.3 cm) $b_k$;

[] at (+ 6.5cm, - 1.3 cm) $b_1$;
[] at (+ 7.5cm , - 1.3 cm) $b_k$;

[] at (+ 9.5cm, - 1.3 cm) $b_1$;
[] at (+ 10.4cm , - 1.3 cm) $b_2$;

[] at (+ 11cm, - 0.7cm) $t'_i$;
[] at (+ 11.5cm , - 0.7 cm) $t_i$;

[] at (+ 1.2cm , - 1.8cm) $G_{i,0}$;
[] at (+ 3cm , - 1.8cm) $G_{i,1}$;
[] at (+ 5cm , - 1.8cm) $G_{i,2}$;
[] at (+ 7cm , - 1.8cm) $G_{i,3}$;
[] at (+ 10cm , - 1.8cm) $G_{i,n+1}$;

The $i^{th}$ row (only the first two skipping arcs are shown), the dashed line indicates arcs from $s_i, s'_i$ to $a_j^{i,n+1}$, with $j \in [k+2]$

A selector is a path that starts at $s_i$, enters its row at the top level, and exits it at the bottom level, ending at $t_i$ and skipping exactly one gadget $G_{i,u}$, with $i \in [k]$ and $u \in V$. In order to implement this, we add the arcs $(s'_i, a_1^{i,0})$ and $(b_2^{i,n+1}, t'_i)$ for row $i$, as well as skipping arcs that allow to skip a gadget $G_{i,u}$ for $u\in V$. These connect the top level of the last wire of $G_{i,u-1}$ to the bottom level of the first wire of $G_{i,u+1}$.

A verifier is a path that routes through one of the wires of the skipped gadget and connects column terminals $s_{i,j}$ to $t_{i,j}$. In order to implement this, we add the arcs $(s'_{i,j}, a_{j}^{i,u})$ and $(b_{i}^{i,u}, t'_{i,j})$ to every gadget in rows $i$ and $j$. To connect the  gadget in row $i$ and $j$, for every edge $uv$ in $G$, we add an arc between the wires $(b_j^{i,u}, a_i^{j,v})$ for each $i<j$, see <ref>.

To force the start and end vertices of paths in the spp of $G'$ of size $k'$, we add the following arcs, called shortest paths enforcers. For every row $i$, from all the vertices of  gadget $G_{j,u}$, where $j < i$ and $0 \leq u \leq n$, from every vertex $s_l$ and $s'_l$ of a start terminal and  from every vertex $s_{l,m}$, $s'_{l,m}$ of a column start terminal, where $l \leq i$ and  $l < m$, add arcs to $a_j^{i,n+1}$, with $j \in [k+2]$.

We are now going to show a number of properties of our construction.

Observe that $G'$ is a DAG because all arcs either go from left to right or from top to bottom.
Next, using <ref> and <ref>,  we can deduce that, if $G'$ has an spp of size $k'$, then the start vertex and end vertex of each path in the solution has the following properties.

$G'$ has $k' - k$ vertices with in-degree zero and out-degree zero.

First, recall that  $k' = \frac{k\cdot (k-1)}{2} + 3k$. Hence, we have to show that we have $ \frac{k\cdot (k-1)}{2} + 2k$ many vertices with in-degree zero. Namely, for each row $i$, with $i \in [k]$, we have one such vertex as it's start terminal $s_i$, $k-i$ column start terminals and one vertex of the dummy gadget $b_1^{i, 0}$. We also have $\frac{k\cdot (k-1)}{2} + 2k$ vertices with out-degree zero, for each row $i$, $i \in [k]$, one as the row's end terminal $t_i$, $i-1$ as its column end terminals and as a vertex of the dummy gadget $a_{k+2}^{i,n+1}$, where  $|V|=n$.

Hence, we know $k' - k$ start and end vertices of the solution are fixed. The next claim shows that each row $i$ has one more start vertex of some path, hence fixing all the starting vertex of all the paths in the solution.

If a solution $\mathbb{P}$ of the created  DAGSPP instance $G'$ is of size $k'$ then, for each row $i \in [k]$, there is a path in $\mathbb{P}$ starting from $v\in T^{i,u}$ which covers at least the vertex $a_1^{i,n+1}$.

We will prove this claim by contradiction. Let there be an spp $\mathbb{P}$ such that there exists a row $i$, with $i \in [k]$ such that there is no shortest path starting from $v$, where $v \in T^{i,u}$ which covers at least $a_1^{i,n+1}$. Then, to cover the vertices $a_j^{i,n+1}$, with $j \in [k+2]$, $\mathbb{P}$ needs $k+2$ arcs, as every vertex that can reach $a_l^{i,n+1}$, where $l \in [k+2]$, is connected to all the vertices $a_j^{i,n+1}$, where $j \in [k+2]$. Hence, we require $k+2$ paths to just cover $a_j^{i,n+1}$ for $j \in [k+2]$, but this leaves $G'$ with $k'-k-1$ out-degree zero vertices. This contradicts that $\mathbb{P}$ is of size $k'$.

Hence, if $G'$ has an spp of size $k'$, then the paths in the solution must start at: for $i \in[k]$, $s_i$, $b_1^{i,0}$, $v, v\in T^{i,u}$ and $s_{i,j}$, with $i< j $.  Next, we will show observations about these paths' ending vertices.

If $G'$ has an spp of size $k'$, then a path (in this DAGSPP solution) starting at $s_i$ has to end at $t_i$, with $i \in [k]$.

Let $\mathbb{P}$ be a DAGSPP solution of size $k'$. The shortest path from $\mathbb{P}$ that covers $t_i$ cannot have started at $s_j$, where $j < i$, as this path, would be an arc due to the edge $(s_j,t_i)$ and hence  $\mathbb{P}$ would also contain a path starting at $s'_j$, which is a contradiction to its small size. Similar arguments work if the path would start at any column start terminal($s_{l,m}$) or any $b_1^{l,0}$, with $l < m , l \leq i$. Also, the path does not start at $v \in T^{m,u}, m \leq i$, as this has to go through $a_1^{m,n+1}$ and there is no path from $a_1^{m,n+1}$ to $t_i$. Hence, the path should start at vertex $s_i$.

With arguments along similar lines, we can show:

If $G'$ has an spp of size $k'$, then any path in this partition starting at $s_{i,j}$ has to end at $t_{i,j}, i < j$.

If $G'$ has an spp of size $k'$, then any path in this partition starting at $v \in T^{i,u}$ has to end at $a_i^{i,n+1}, i \in [k]$.

Also, if $G'$ has an spp of size $k'$, then for each row $i$, with $i \in [k]$, any path starting at $s_i$ has to skip exactly one gadget and end at $t_i$. If we do not skip any gadget, $s_{i,j}$ cannot be connected to $t_{i,j}, j >i$. Once we skip a gadget, we are at the bottom level of the row and hence we cannot skip again. To conclude if $G$ has a shortest path partition of size $k'$ (then in the solution) the path starting at $s_i$ has to end at $t_i$ and this path has to skip exactly one gadget. Through this skipped gadget, $s_{i,j}$ is connected to $t_{i,j}$. The bottom of the row is covered by a path starting from $b^{i, 0}$ and the top of the row is covered by a path starting at $v \in T^{i,u}$ after the skipped gadget and ending at $a_{k+2}^{i,n+1}$.

Finally, we have the following claim about $G'$ that follows by construction.

There exists a path between $s_{i,j}$ and $t_{i,j}$ through two gadgets $G_{i,u}$ and $G_{j,v}$ where $i>j$ if and only if there is an edge $uv$ in the graph $G$.

$G$ has a $k$-clique if and only if $G'$ has a shortest path partition of size $k'$.

If vertices $v_1,v_2,\dots, v_k$ form a clique in $G$, then we construct an spp of size $k'$ in $G'$ as follows: for each row $i$, with $i\in[k]$, we take a path starting at $s_i$ and leading to $t_i$ while skipping gadget $G_{i,v_i}$; we cover all the vertices on the left of the skipped gadget with a single path starting at $b_1^{i,0}$, and similarly, we cover all the vertices on the right of the skipped gadget with a single path ending at $a_{k+2}^{i,n+1}$. Then, we connect $s_{i,j}$ to $t_{i,j}$, with $i < j$, through the skipped gadget (this is possible because of <ref>).

For the other direction, assume we have an spp $\mathbb{P}$ of size $k'$ in $G'$: include the vertices corresponding to any gadget which was skipped by a path which connects $s_i$ to $t_i$ for $i \in [k]$ into the $k$-element set $C$. This forms a clique in $G$, as any two vertices of $\{v_i,v_j\} \in C$, are distinct and have an edge between them because of the verifiers.

As the construction is polynomial-time, 1-hardness follows.

§  ALGORITHMS FOR SPP

We now present our  algorithms to prove the following result. We note that the result for USPP was also proved in <cit.> (with a different method: they first give an upper-bound on the treewidth of the graph, and then they apply Courcelle's theorem).

The basic idea is to use existing algorithmic results for Disjoint (Shortest) Paths from the literature.

USPP, DAGSPP, and DSPP but only on planar directed graphs and on directed graphs of bounded directed treewidth[as defined in <cit.>] are in when parameterized by the number of paths.

For our algorithms, the following combinatorial result is crucial, that allows us to reduce the problem to DP (without the shortest path requirement).

Let $G=(V,E)$ be a graph (directed or undirected). Then, $V$ can be partitioned into $k$ vertex-disjoint shortest paths if and only if there are $k$ vertex-disjoint paths between some $s_i$ and $t_i$, for $1\leq i\leq k$, such that $\sum_{i=1}^{k} d(s_i,t_i) = |V|-k$.

Let $G=(V,E)$ be a directed or an undirected graph.
If $V$ can be partitioned into $k$ vertex-disjoint shortest paths $P_i$,  for $1\leq i\leq k$, then we can take their endpoints as $s_i$ and $t_i$. As the paths are shortest and form a partition,  $\sum_{i=1}^{k} d(s_i,t_i) = |V|-k$ must hold.
Conversely, if there are $k$ vertex-disjoint  paths in $G$, connecting, say,  $s_i$ and $t_i$, for $1\leq i\leq k$, then the condition $\sum_{i=1}^{k} d(s_i,t_i) = |V|-k$ can only be satisfied if each vertex of the graph belongs to exactly one of the paths and if all the paths are shortest paths.
Hence, $V$ can be partitioned into $k$ vertex-disjoint shortest paths.

<ref> allows us to prove <ref> by cycling through all possible $X:=\{(s_1,t_1), \dots, (s_k,t_k) \}$, resulting in an instance  of DSP. Now, we can either apply known algorithms with running time (or better), for either DP or DSP. We give details of this proof strategy in the following.

Let $G=(V,E)$, together with an integer $k$, be an instance of SPP (i.e., DSPP, DAGSPP or USPP, the arguments are complete analogous for these cases).
By <ref>, given an instance $(G,k)$ of SPP, with $G=(V,E)$, it is sufficient to iterate (in time) through all possible $X:=\{(s_1,t_1), \dots, (s_k,t_k) \}$ where $s_i,t_i \in V$ and $\sum_{i=1}^{i=k} (d(s_i,t_i) + 1) = |V|$. The latter can be checked in polynomial time using standard algorithms for computing the distance.
Then, for each such $X$ we form an instance $(G,X)$ of the version of DP (or DSP) corresponding to our initial instance (i.e., DDP, DAGDP or UDP, or alternatively, DDSP, DAGDSP or UDSP). Now, $(G,k)$ is a -instance of SPP, respectively, if and only if some constructed $(G,X)$ instance is a -instance of DP (or of DSP).

We next see in which cases DP or DSP can be solved in time by known algorithms.

For DAGs, Fortune et al. <cit.> showed that, for arbitrary fixed directed pattern graphs, subgraphs homeomorphic to them can be detected in DAGs in polynomial time (even when the node-mapping is fixed).
Hence, taking as a pattern graph a collection of $k$ isolated directed edges and as node-mapping the chosen terminals, the according homeomorphism problem is identical to DAGDP (with fixed $k$). Hence, the instance $(G,X)$ can be solved in time $\Oh(|V|^{f(|X|)})=\Oh(|V|^{f(k)})$ for some function $f$.  Alternatively, an algorithm for DAGDSP is also given in <cit.>.

For planar (directed) graphs, we refer to <cit.> for an algorithm for DDP, or to <cit.> for an algorithm for DDSP. An algorithm is given for DDP on graphs of bounded directed treewidth <cit.>.

For the undirected case, we can refer to the seminal paper of Robertson and Seymour <cit.>, yielding a cubic-time algorithm on input $(G,X)$ for UDP, an algorithm that was later improved to be quadratic in <cit.>, yielding again the -claim. Alternatively, an algorithm for UDSP was also given in <cit.>.

These results establish the statement.

Notice that these algorithmic results rule out -hardness results (in contrast to those existing for PP and IPP) for the corresponding problems.

§ NEIGHBORHOOD DIVERSITY AND VERTEX COVERPARAMETERIZATIONS

One of the standard structural parameters studied within parameterized complexity is the vertex cover number, i.e., the size of the smallest vertex cover that a graph has. As graphs with bounded vertex cover number are highly restricted,  less restrictive parameters that generalize vertex cover are interesting, as neighborhood diversity is, introduced by Lampis <cit.>.

§.§ Neighborhood diversity for USPP and UIPP

Crucial to our -results is the following interesting combinatorial fact.

If $G$ is connected, then $\diam(G) \leq \nd(G)$.

Let $G=(V,E)$ be a graph with $d=\nd(G)$, with equivalence classes $C_1,\dots,C_d\subseteq V$.
We will prove our claim by contradiction. Hence, assume  $P = \{v_1,v_2,\dots,v_{d+2%3
}\}$ be a shortest path of length $d+1$.

For $d = 1$,  all vertices of $G$ are of the same type. As $v_1,v_3$ are not isolates, there exists an edge between the first vertex $v_1$ and the last vertex $v_3$ on $P$. This contradicts the assumption that $P$ is a shortest path.

Now for $d>1$, we claim that for every $C_j$, where $j \in [d]$, $|P \cap C_j| < 2$. We will prove this by contradiction, assuming that there are two distinct vertices $u,v$ with $\{u,v\} \in C_i \cap P$, for some $i \in [d]$. By definition, as $u$ and $v$ are of the same type, any vertex $v' \in P$ which is adjacent to $u$ or $v$ is adjacent to both $(*)$. As $P$ has at least four vertices, we can find a contradiction to the assumption that $P$ is a shortest path by the following case distinction.
(1) If $u$ and $v$ are adjacent, then as there must be a vertex $v'\in P$ that is neighbor of $u$ or $v$, it is neighbor of both $u$ and $v$, so that there is a shorter path between the two endpoints of $P$. More precisely, if $u-v-v'$ is a sub-path of $P$, then this can be shortcut as $u-v'$, while the sub-path $v'-u-v$ of $P$ can be shortcut as $v'-v$.
(2) If $u$ and $v$ are not adjacent, then there must be a vertex $w\in P$ that is the first vertex when moving from $u$ to $v$ on the path $P$. But then $(*)$ implies that $w\in N(v)$ must hold, so that $u-w-v$ is a sub-path of $P$.
As $P$ has at least four vertices, there exists one more vertex $z \in P$ which is adjacent to $u$ or $v$.
As $P$ is a shortest path, $z\notin N(w)$. Hence, the vertices $u,w,v,z$, in this order, form an induced cycle in $G$, so that the path $P$ cannot be a shortest path. Namely, as $z$ is adjacent to $u,v$, a sub-path $u-w-v-z$ of $P$ can be shortcut as $u-z$, while a sub-path $z-u-w-v$ of $P$ can be shortcut as $z-v$.
Hence, $P$ contains at most one vertex from each $C_j, 1 \leq j \leq d$. Therefore, any shortest path cannot be of length greater than $d$.

Similar arguments show that the number of neighborhood diversity equivalence classes that a shortest path $P$ intersects equals its number of vertices if $P$ contains at least four vertices. In shortest paths on two or three vertices, however, their endpoints might have the same type.
Now, call two shortest paths $P_i$ and $P_j$ (viewed as sets of vertices) equivalent, denoted by $P_i\equiv P_j$, in a graph $G$ with $d=\nd(G)$ if  $|P_i \cap C_{l}| = |P_j \cap C_{l}|$ for all $l$ with $1 \leq l \leq d$, where $C_1,\dots,C_d$ denote the -equivalence classes.
Any two equivalent shortest paths have the same length.
<ref> and our discussions imply that there are
$\Oh(2^{\nd(G)})$ many equivalence classes of shortest paths $(+)$.

USPP  is when parameterized by
neighborhood diversity.

As we can solve USPP separately on each connected component, we can assume in the following that the input graph is connected.

Given that the neighborhood diversity of a graph $G=(V,E)$ is bounded by an integer $d$, then there exists a partition of $V$ into $d$ $\nd$-classes $C_1, \dots , C_d$. Hence, each $C_i$ for $i \in [d]$ either induces a clique or an independent set. Such a partition can be found in linear time with a fast modular decomposition algorithm <cit.>.

Compute the set  of all shortest path equivalence classes; this can be represented by a set $\cal P$ of shortest paths, in which any two shortest paths are not equivalent.
By $(+)$, we know that  $\vert \mathcal{P}\vert\in\Oh(2^{\nd(G)})$.
Construct and solve the following Integer Linear Program (ILP), with variables $z_p\geq 0$ corresponding to $p\in \cal P$.
Each $p\in \cal P$ is characterized by a vector $(p^1,\dots,p^d)$ with $p^j=\vert C_j\cap p\vert $.

$$\text{minimize} %\sum_{i = 1}^{i = |Z|} z_i
\sum_{p\in\cal P}z_p

$$\text{subject to }\sum_{p\in \cal P}z_p\cdot p^j=|C_j|\text{  for all }j\in [d]$$

The variable $z_p$ encodes how many
shortest paths equivalent to $p$ are taken into the solution. Hence, the objective function expresses minimizing the number of shortest paths used in the partition. The
constraints ensure the path partitioning.

There exists a spp of $G$ with $k$ shortest paths if and only if the objective function attains the value $k$ in the ILP described above.

For the forward direction, consider the paths $\mathbb{P}= \{P_1,P_2, \dots, P_k\}$ as a solution for the spp of $G$. To construct a solution of the ILP, for every $p \in \cal P$, $z_p$ equals the number of  paths in $\mathbb P$ that are equivalent to $p$. Clearly, $\sum_{p\in \cal P} z_p = k$. The
constraint is satisfied as every vertex is covered exactly once by $\mathbb P$.

For the other direction, suppose that there exist integers $\{z_{p}\mid p\in \mathcal{P}\}$  which satisfy the ILP and $\sum_{p\in\cal P}z_p = k$. We can produce a spp of $G$ with $k$ paths as follows: as long as there exists a set $p\in\cal P$ with $z_p > 0$, construct a path by arbitrarily picking exactly $p^j$ vertices from each $C_j$. Remove these vertices from $G$, and set $z_p := z_p - 1$. This algorithm produces exactly $k$ paths which form a  shortest path collection that covers all vertices exactly once.

Notice that the number of variables of the ILP is exactly $\vert \mathcal{P}\vert$, which is $\Oh(2^d)$, as observed above. Now, we apply <cit.> to prove our  claim.

The arguments leading to <ref> and the subsequent discussions are all proofs by contradiction that show shortcuts in shortest paths that are `too long'. This also works for induced paths instead of shortest paths, leading to the following result.

The length of a longest induced path in a graph $G$ is upper-bounded by the neighborhood diversity $\nd(G)$.

UIPP is when parameterized by
neighborhood diversity.

It is worth mentioning that the time consumption of the proposed algorithms is at worst double-exponential in the parameter (more precisely, ignoring lower-order terms, the growth is like $\left(2^{2.5 d}\right)^{2^d}$), while the space consumption is rather single-exponential, like $2^d$. In practice, however, the number of shortest path equivalence classes of a graph (that determines that number of variables of the derived ILP) need not be exponential in the neighborhood diversity, which would immediately improve the running time estimates for the proposed algorithm. Nonetheless, it would be interesting to give better parameterized algorithms for these path partitioning problems.

Moreover, using the mentioned estimates of Lampis <cit.>, we can immediately infer the following results, where the dependence on the parameter is even worse than that for neighborhood diversity.

USPP and UIPP are when parameterized by
vertex cover number.

We have a similar result for UPP, either  by a more general approach in <cit.>, or based on a more direct and simpler reasoning, as shown below in <ref>.

§.§ Neighborhood diversity of directed graphs for DSPP and DIPP

Now we want to try to adapt these neighborhood diversity results for the directed case. For this reason we want to introduce the new notion of directed neighborhood diversity (dnd for short). To this end, let $N^-(v)\coloneqq \{ x\in V \mid (x,v)\in E\}$ and $N^+(v)\coloneqq \{ x\in V \mid (v,x)\in E\}$ be the in- and out-neighborhood of $v$, respectively. For two vertices $v,u\in V$, we define $v\sim_{dnd}u$ to hold if the following three conditions are satisfied:

* $N^-(v)\setminus \{u\}=N^-(u)\setminus \{v\}$,

* $N^+(v)\setminus \{u\}=N^+(u)\setminus \{v\}$, and

* $(v,u)\in E \Leftrightarrow (u,v) \in E$.

For any directed graph $G=(V,E)$, $\sim_{dnd}$ is an equivalence relation.

Trivially, $\sim_{dnd}$ is reflexive and symmetric. We are left to show transitivity. Let $v,u,w\in V$ be different vertices with $v \sim_{dnd} u$ and $u \sim_{dnd} w$.

First assume that $(v,u),(u,v)\in E$. This implies $v\in N^-(u) \setminus \{ w \}= N^-(w)\setminus \{ u\}$ and $v\in N^+(u) \setminus \{ w \}= N^+(w)\setminus \{ u\}$. Hence, $(v,w),(w,v)\in E$. As $N^-(u) \setminus \{ v \}= N^-(v)\setminus \{ u\}$ , $(u,w),(w,u)\in E$.
\begin{equation*}
\begin{split}
N^-(v) \setminus \{ w \} &= ((N^-(v)\setminus \{u\})\cup \{u\})\setminus \{w\} = ((N^-(u) \setminus \{v\})\cup \{u\})\setminus \{w\}\\
& = ((N^-(u) \setminus \{w\})\cup \{u\})\setminus \{v\} = ((N^-(w) \setminus \{u\})\cup \{u\})\setminus \{v\}\\
&= N^-(w)\setminus \{v\}.
\end{split}
\end{equation*}

Analogously, $N^+(v) \setminus \{ w \} = N^+(w)\setminus \{v\}$.    Therefore, $v \sim_{dnd} w$.

Now assume $(v,u),(u,v)\notin E$. Then, $v\notin N^-(u) \setminus \{ w \}= N^-(w)\setminus \{ u\}$ and $v \notin N^+(u) \setminus \{ w \}= N^+(w)\setminus \{ u\}$. Thus, $(v,w),(w,v)\notin E$.  Since $N^-(u) \setminus \{ v \}= N^-(v)\setminus \{ u\}$ , $(u,w),(w,u)\notin E$. Hence,

\begin{equation*}
\begin{split}
N^-(v) \setminus \{ w \} &= (N^-(v)\setminus \{u\})\setminus \{w\} = (N^-(u) \setminus \{v\})\setminus \{w\}\\
& = (N^-(u) \setminus \{w\})\setminus \{v\} = (N^-(w) \setminus \{u\})\setminus \{v\}\\
&= N^-(w)\setminus \{v\}.
\end{split}
\end{equation*}

Therefore, $\sim_{dnd}$ is transitive and hence an equivalence relation.

Note that the third condition in the definition of relation $\sim_{dnd}$ is needed to obtain an equivalence relation. To see this, consider for example the directed graph on vertices $u,v,w$ consisting of a transitive triangle, where $u$ is the source and $w$ is the sink. Without the third condition, we would have $u\sim v$ and $v\sim w$, but $u\not\sim w$, so $\sim$ would not be an equivalence relation.

Now we want to consider the equivalence classes. The previous proof provides  an observation for these:

Let $G=(V,E)$ be a directed graph and $C_1,\ldots, C_d$ be the equivalence classes with respect to $\sim_{dnd}$. Then for each $i \in \{1,\ldots,d\}$, $C_i$ is either an independent set or a bidirected clique.

A similar result for the neighborhood diversity on undirected graphs is well-known. There, an equivalence class is either an independent set or a clique. But this is not the only similarity, as we see next.

If we take an undirected graph $G=(V,E)$ and build the directed graph $G'=(V,E')$ with $E'\coloneqq \{(v,u), (u,v) \mid \{v,u\}\in E\}$, then $\text{$\sim_{nd}$}=\text{$\sim_{dnd}$}$, where $\sim_{nd}$ is the underlying relation of the undirected neighborhood diversity. This holds, since $N(v) = N^-(v) = N^+(v)$ and $\{v,u\} \in E$ if and only if $(v,u) \in E'$ if and only if $(u,v) \in E'$, which is the case if and only if $\{u,v\}\in E$.

As we can see, the definition above is a natural way to generalize the neighborhood diversity relation from undirected to directed graphs. Therefore, we define the directed neighborhood diversity of a graph $G=(V,E)$ (denoted by $\dnd(G)$) as the number of equivalence classes under $\sim_{dnd}$.

Let $G=(V,E)$ be directed graph with the directed neighborhood diversity classes $C_1,\ldots,C_{\dnd(G)}$. For any induced path $p=v_1,\ldots,v_{\ell}$ in $G$, there is at most one $i\in \{1,\ldots,\dnd(G)\}$ such that $\vert C_i \cap p \vert >1$. In this case, $\{v_1,v_{\ell}\} = C_i \cap p$.

Let $p=v_1\ldots v_{\ell}$ be an induced path and $C_i$ be a directed neighborhood diversity class with $\{v_j,v_k\} \subseteq C_i \cap p$ and $v_j \neq v_k$. Without loss of generality, $j<k$. Assume $j \neq 1$. Then $v_{j-1}\in N^-(v_j) \setminus \{v_k\} = N^-(v_k) \setminus \{v_j\}$. This contradicts the fact that $p$ is induced. Therefore, $j=1$. Analogously, $k=\ell$ (substitute $v_{j-1}$ by $v_{k+1}$ and $N^-$ by $N^+$).

Let $G$ be a directed graph. Any induced path has length at most $\dnd(G)$.

This is a tight bound. Indeed, for any given $d \in \mathbb{N}$, there exists a directed graphs $G_d$ with $\diam(G_d)=\dnd(G)$: For $d=1$, just use a path of two vertices. For the other cases, define $G_d=(V_d,E_d)$ with $V_d\coloneqq \{v, v', v_1, \ldots, v_{d-1}\}$ and $E_d \coloneqq \{ (v_i,v_{i+1})\mid i\in \{1,\ldots, d-2\}\}\cup \{(v_{d-1}, v),(v_{d-1}, v'),(v,v_1),(v',v_1)\}$. The directed neighborhood diversity classes are $C_i = \{v_i\}$ for $i\in \{1,\ldots, d-1\}$ and $C_d=\{v,v'\}$. The only path between $v$ and $v'$ is $v,v_1,\ldots,v_{d-1},v'$.

By this corollary, we can define the equivalence of paths and show a result as <ref> analogously. We can do this as vertices in the same class can by reached from the same vertices and can reach the same vertices.

DSPP and DIPP are when parameterized by the directed neighborhood diversity of the input graph.

Let us compare $\dnd(G)$ with $\nd(U(G))$ of the underlying undirected graph $U(G)$.
By the very definitions, we observe:

For every directed graph $G$, $\nd(U(G))\leq \dnd(G)$.

Note that equality in <ref> can be strict, consider for example any tournament $G$ of order $n$. Since there is exactly one arc between every pair $u,v$ of vertices of $G$, the third condition for $u\sim_{dnd}v$ is never satisfied, so $\dnd(G)=n$. However, $U(G)$ is a complete graph, so $\nd(U(G))=1$.

Similarly to the undirected case, the directed neighborhood diversity number of  the underlying graph is upper-bounded by an exponential function of the vertex cover number of the underlying undirected graph. However, the details are a bit different, as shown next.

For every directed graph $G$, $\dnd(G)\leq 4^{\vc(U(G))}+\vc(U(G))$.

Namely, consider all (not necessarily proper) 4-colorings of the vertex cover set.
They should come with the following meaning (with respect to a vertex $u$ in the independent set):

* $0$: not touched by any edge incident to $u$,

* $1$: in $N^+(u)\setminus N^-(u)$,

* $2$: in $N^-(u)\setminus N^+(u)$,

* $3$: in $N^+(u)\cap N^-(u)$.

This idea already shows the claim.
Namely, at worst each vertex in a minimum vertex cover forms its own equivalence class, and two vertices $u,u'$ in the independent set (the complement of the vertex cover) are equivalent if and only if they induce the same 4-coloring as defined above. As there are at most  $4^{\vc(U(G))}$ many such 4-colorings, this upper-bounds the number of equivalence classes with independent set vertices only.

DSPP  and DIPP are when parameterized by
the vertex cover number of the underlying undirected graph.

One only needs to recall that we can compute a minimum vertex cover of the underlying graph in time, see <cit.>.

We could also define the directed neighborhood diversity by only in-arcs or out-arcs. But different from the undirected case, we must specify if we consider the open or closed neighborhood for the diversity. If we would define the relation $\sim$ for two vertices $v,u\in V$ only by $N^-(v) \setminus \{u\} = N^-(u)\setminus \{v\}$ (completely in analogy to the undirected case), then the transitive triangle would again be a counter-example for the required transitivity. As for $\sim_{dnd}$, we could include the condition $(u,v)\in E$ if and only if $(v,u) \in E$. But even for this modification, there is a  counter-example for transitivity of this relation $\sim$:  $G=(\{u,v,w\},E)$ with $E \coloneqq \{(w,v), (u,v), (v,w)\}$. Here, $v\sim w$ and $v \sim u$ but $w \not\sim u$.

So either we try to discuss further adaptations of the notion of neighborhood diversity towards directed graphs,
or we can base a definition on the open or closed neighborhoods, e.g., $u\sim_{\text{open}^-}v\iff N^-(u)=N^-(v)$. But we did not find a way such that these definitions help generalize our algorithms. For example, consider for the open neighborhood (the closed one works analogously) $G=(\{v,u,w,x,y\},E)$ with $E\coloneqq \{(y,v),(y,u),(v,w),(v,x)\}$. The three $\sim_{\text{open}^-}$-classes are $C_1\coloneqq\{y\}$, $C_2\coloneqq \{v,u\}$, $C_3 \coloneqq \{w,x\}$. So our algorithm would advise to use a path $C_1,C_2,C_3$ and $C_2,C_3$. But this is not possible.

§.§ More on vertex cover parameterization

UPP, USPP and UIPP are when parameterized by
vertex cover number, as they admit single-exponential size kernels.

Assume that $\vc(G)$ is our problem parameter, given a graph $G=(V,E)$, and let $C\subseteq V$ be a minimum vertex cover (which can be computed in time by <cit.>).
Now we claim that if there are more than $2\vc(G)$ many vertices in the independent set $ I=V\setminus C$ that have the same type, then at least one of them must form a single-vertex path in a minimum pp of $G$.
Implementing this reduction rule leaves us with $|I|\leq 2\vc(G)\cdot 2^{\vc(G)}$, as the number of neighborhood diversity classes within $I$ is clearly bounded by $2^{\vc(G)}$. Hence, we can assume that the size of $G$ is bounded by a function in $\vc(G)$ which shows that UPP, UIPP and USPP parameterized by vertex cover, have a kernel and are hence in .

In view of the results obtained in the preceding subsection on directed graphs, we can state and prove similar single-exponential kernel results for vertex cover parameterization also in these cases.
We can  also obtain a direct algorithm for UPP, leading to the following result.
It is not that clear how this result can be adapted to the other path partition variants (UIPP and USPP) studied in this paper.

UPP is when parameterized by
vertex cover number, testified by an algorithm running in time $\Oh^*\left(\vc(G)!\cdot 2^{\vc(G)}\right)$ on input $G$.

The proposed algorithm runs as follows on the input graph $G=(V,E)$:
(0) Compute a minimum vertex cover $C$ of the input graph; this can be done in time $\Oh(c^{\vc(G)})$ for some $c<1.3$, see <cit.>. We call the complement of $ C$ as $I$, being an independent set.
We also keep track of a `record partition' $\mathbb{P}$ that we initialize with the path partition where each path is consisting of one vertex.

(1) Iterate through all permutations of the vertices in $C=\{v_1,\dots,v_r\}$, where $r=\vc(G)$. The idea is that each such permutation describes a sequence of vertices in the order in which each of the paths that are considered in a partition traverse the $C$-vertices in this order.

(2) For each such permutation $\pi$, say, $v_{\pi(1)},\dots,v_{\pi(r)}$,
walk through all $(r-1)$-dimensional bitvectors $\bar{b}=b_1b_2\cdots b_{r-1}$. These bitvectors describe where the sequence $v_{\pi(1)},\dots,v_{\pi(r)}$ is connected (or not) on a path. More precisely,  $b_j=1$ if and only if $v_{\pi(j)}$ and $v_{\pi(j+1)}$ are on the same path in the path partition $\mathbb{P}(\pi,\bar b)$ that we are constructing. Therefore, a bitvector with $\ell$ zeros will describe a collection of paths with $\ell+1$ paths that contain vertices of $C$.
Also, if $p\in \mathbb{P}(\pi,\bar b)$, then there exist $i\leq j$ such that, if we view $p$ as a set of vertices, $p\cap C=\{v_{\pi(i)},\dots,v_{\pi(j)}\}$ and for all indices $\iota\in [i,j-1]$, $b_\iota=1$, while $b_{i-1}=0$ or $i=1$ and $b_j=0$ or $j-1=r$.

Under the assumption that $I=V\setminus C$ might be much bigger than $C$, as suggested by the exponential-size kernel obtained in <ref>, this does not relate $\ell$ to $k$, as then $k$ must be rather in the order of $|C|$ than in the order of $\ell\leq r$. Yet, we can say that, given $\bar b$ with $\ell$ zeros and assuming that $C$ is sufficiently big, we will obtain at least $(\ell+1)+(|C|-2(\ell+1))=|C|-(\ell+1)$ many paths, a number that should be smaller than $k$, as otherwise we can abort. Namely, by our construction, we have $\ell+1$ paths containing vertices from $C$. In order to get as few paths as possible in our path partition, as many vertices from $I$ as possible should be integrated into these paths. In each of these paths, we can integrate at most as many vertices as there are vertices belonging to $C$, plus one, because vertices from $I$ can occur only as `intermediate vertices' between two vertices from $C$, or at the very ends of the paths, because $I$ is an independent set in $G$ by assumption. Hence, at most $2(\ell+1)+r$ many vertices can be integrated into these $\ell+1$ many paths. Of these vertices, at most  $2(\ell+1)$ belong to $I$, but `the rest' of $I$ must be covered by single-vertex-paths. However, we could possibly also get more paths in a solution that is consistent with $\bar b$, namely, if no vertices from $I$ are integrated in the paths that contain vertices from $C$ in this extreme case, we are looking at a solution with $|C|+(\ell+1)$ many paths. In order to integrate as many vertices from $I$ into   paths that contain vertices from $C$, we will suggest to consider a maximum matching in an auxiliary graph, as described in the following.

(3) For all $\pi$ and $\bar{b}$,

create an auxiliary edge-weighted bipartite graph $G'=G'(\pi,\bar b)$ with edge set $E'$ and vertex set $V'$ containing $V$, such that $C$ is part of one set $C'$ of the bipartition.
Similarly, let $I'=V'\setminus C'$ contain $I$.
Moreover, we will define a weight function $w:E'\to\{1,2\}$.

More precisely, to obtain $C'$, add to $C$ (always) the vertex $v_{\pi(1)}'$ and further vertices $v_{\pi(i+1)}'$ if $b_i=0$, and possibly add
vertices $u_i$ into $I$ if $b_i=1$ to build $I'$.
For a worked-out example explaining our construction, we refer to <ref>.

First assume that $b_i=1$, i.e., $v_{\pi(i)}$ and $v_{\pi(i+1)}$ should lie on a path in $\mathbb{P}(\pi,\bar b)$.
Connect $v_{\pi(i)}$ and $x\in I$ by an edge of weight $2$ if $v_{\pi(i)}x\in E$ and $v_{\pi(i+1)}x\in E$.
Moreover, if there is no edge incident to  $v_{\pi(i)}$ so far but $v_{\pi(i)}v_{\pi(i+1)}\in E$, then introduce a new vertex $u_i$ (as part of $I'$) and the edge $v_{\pi(i)}u_i$ of weight $1$.

Secondly, assume that $b_i=0$, i.e., $v_{\pi(i)}$ and $v_{\pi(i+1)}$ should not lie on a path in $\mathbb{P}(\pi,\bar b)$.
Still, the path that ends at $v_{\pi(i)}$ (concerning the $C$-vertices) could contain one more vertex (in $I$). Therefore, we also connect $v_{\pi(i)}$ and $x\in I$ by an edge of weight $1$ if $v_{\pi(i)}x\in E$.  Similarly,  connect $v_{\pi(r)}$ and $x\in I$ by an edge of weight $1$ if $v_{\pi(r)}x\in E$.
Also the path that starts at $v_{\pi(i+1)}$ (concerning the $C$-vertices) could contain one more vertex (in $I$).
To cover this case, we also connect $v_{\pi(i+1)'}$ and $x\in I$ by an edge of weight $1$ if $v_{\pi(i+1)}x\in E$.
Similarly, we connect $v_{\pi(1)'}$ and $x\in I$ by an edge of weight $1$ if $v_{\pi(1)}x\in E$.

This concludes the description of the auxiliary graph $G'=(V',E')$ and the weight function $w$.

Now, compute a maximum weighted matching $M$ in $G'$. If the vertices $v_{\pi(i)}$, $v_{\pi(i+1)}$,  …, $v_{\pi(j)}$ are matched, then this clearly corresponds to a path within $G$ that traverses $v_{\pi(i)}$, $v_{\pi(i+1)}$,  …$v_{\pi(j)}$ in that order, possibly using vertices from $I$ on its way, including possibly starting or ending in $I$.
Let us make this more precise.

First, we test if there is any edge $v_{\pi(i+1)}'x$ in the matching, while $v_{\pi(i)}x$ was also an edge in $G'$. This would mean that we found a situation where we guessed (by the bitvector $\bar b$, as $b_i=0$) that one path ends at $v_{\pi(i)}$ and the next path starts at $v_{\pi(i+1)}$. Our matching proves that we could connect both paths, i.e., the path partition $\mathbb{P}(\pi,\bar b)$ would not be minimal. Also, there will be another setting of the bitvector $\bar b$ that covers this (better) case. Therefore, we need not consider this case any longer.
Similarly, we can skip the case when $v_{\pi(1)}'x$ in the matching, while $v_{\pi(r)}x$ was also an edge in $G'$.

Now, we describe $\mathbb{P}(\pi,\bar b)$ more precisely.
Our first path $P_1$ should contain $v_{\pi(1)}$. If $v_{\pi(1)'}$ is matched with some $x_0\in I$, then $P_1$ starts with $x_0$, with the second vertex then being $x_1=v_{\pi(1)}$, while otherwise it starts with $x_1$.
If $b_1=0$, then it might be the case that $x_1$ is matched with $x_2\in I$, where $P_1$ will then end, or $x_1$ is not matched, which means that $P_1$ already ends with $x_1$.
If $b_1=1$, then we expect that $x_1$ is matched with some vertex (otherwise, the guessed bitvector would be wrong and we can stop any further computation of this case here).
If $x_1$ is matched with some $x_2\in I$, this means that (within $G$) we find the edges $x_1x_2$ and $x_2x_3$, with $x_3=v_{\pi(2)}$.
Otherwise, $x_1$ is matched with $u_1$. By construction, this means that there was no $x\in I$ with $x\in N_G(x_1)\cap N_G(v_{\pi(2)})$, but $x_1\in N_G(v_{\pi(2)})$. Hence, we can take $x_2=v_{\pi(2)}$ as the next vertex on $P_1$.
Continuing this way, we will construct the first path $P_1$, whose end is determined by the first $j$ with $b_j=0$. Then, the second path $P_2$ will start with $v_{\pi(j)}$ if $v_{\pi(j)}'$ is unmatched and with some $y\in V\setminus C$ if $y$ is matched with $v_{\pi(j)}'$ that is constructed in the very same fashion.

Notice that all vertices of $I$ outside the matching belong to paths of length zero.
As the matching was maximum, we see the minimum number of paths (respecting the choice of $\bar b$)
constructed in this way. More precisely, we claim the following property.

Let $M$ is a maximum weight matching of $G'(\pi,\bar b)=(V',E')$ with weight function $w$ as defined above. Then, the path partition $\mathbb{P}(\pi,\bar b)$ contains $|V|-w(M)$ many paths.

It is best to think of this claim from the perspective of how many paths can be `saved' within $\mathbb{P}(\pi,\bar b)$ in comparison to the solution that consists of single-vertex paths only. If a vertex in $C\cup I$ is not matched, then it means that it forms a single-vertex path.
If we find an edge $e=v_{\pi(i)}x\in M$ with $x\in I$, then this means that we see the sub-path $v_{\pi(i)}xv_{\pi(i+1)}$ in $\mathbb{P}(\pi,\bar b)$, somehow `merging' three potential single-vertex paths and therefore reducing the number of paths by $2$, which is the weight of $e$. If we find an edge $e=v_{\pi(i)}x\in M$ where $b_i=0$, i.e., $w(e)=1$, then the path does not continue to $v_{\pi(i+1)}$ but will end in $x$. Nonetheless, $x$ does not form a single-vertex path, so again we reduce the number of paths by the weight $1$ of $e$. A similar observation can be made concerning edges between some $v_{\pi(i)}'$ and some $x\in I$, as they treat 'the other end' of the paths. Finally, one can consider the edges $e=v_{\pi(i)}u_i\in M$. Again, $w(e)=1$. They reflect the possibility to connect two paths that would otherwise end in  $v_{\pi(i)}$ and start in $v_{\pi(i+1)}$, respectively. Hence, also in this case we reduce the number of paths by the weight $1$ of $e$.

If the path partition $\mathbb{P}(\pi,\bar b)$ contains less paths than the current record partition $\mathbb{P}$, we will update $\mathbb{P}$ accordingly.
After cycling through all permutations and bitvectors, $\mathbb{P}$ should satisfy the following claim.

The given graph $G$ contains a path partition with at most $k$ many paths if and only if our algorithm outputs a record partition $\mathbb{P}$ with at most $k$ many paths.

It should be clear by what we argued above that our algorithm only outputs valid path partitions. Hence, if it outputs a record partition $\mathbb{P}$ with at most $k$ many paths, then our graph contains such a pp.

Conversely, let $\mathbb{P}$ be a pp with the minimum number of paths. Let $k$ be the number of these paths. If $P_1,\dots,P_k$ are the paths in $\mathbb{P}$ ordered by decreasing length, then there is some smallest number $k'\leq k$ such that the paths $P_{k'+1},\dots,P_k$ contain only vertices from $I$. Then, by reading the vertices from $C=\{v_1,\dots,v_r \}$ on the paths $P_1,\dots,P_{k'}$ `from left to right', we can define a permutation $\pi$ on $\{1,\dots,r\}$.
Moreover, we can define a bitvector $\bar b$ that describes how many vertices of $C$ belong to $P_1,\dots,P_{k'}$. This bitvector has $k'-1$ many zeros.
One can verify that this solution corresponds to a weighted maximum matching in the auxiliary graph $G'(\pi,\bar b)$ of weight $|V|-k$.

Notice that Step (0) is executed only once, so that for the running time, it is decisive that we cycle through all permutations and through all settings of the bitvectors.

We are now illustrating the construction of the previous proof by an example.

[transform shape]
scale=1,every node/.style=scale=0.5, fill = black,circle,minimum size=0.1cm

[draw] (v1) at (0.5,1) ;
[draw] (v2) at (2.5,1) ;
[draw] (v3) at (4,1) ;
[draw] (v4) at (5.5,1) ;
[draw] (v5) at (7,1) ;
[draw] (v6) at (8,1) ;
[draw] (v7) at (9,1) ;
[draw] (w1) at (0,-1) ;
[draw] (w2) at (1,-1) ;
[draw] (w3) at (2,-1) ;
[draw] (w4) at (3,-1) ;
[draw] (w5) at (4,-1) ;
[draw] (w6) at (5,-1) ;
[draw] (w7) at (6,-1) ;
[draw] (w8) at (7,-1) ;
[draw] (w9) at (8,-1) ;
[draw] (w10) at (9,-1) ;

[scale=1.66,fill=none]  at (0.5,1.2) $v_1$;
[scale=1.66,fill=none]  at (2.5,1.2) $v_2$;
[scale=1.66,fill=none]  at (4,1.2) $v_3$;
[scale=1.66,fill=none]  at (5.5,1.2) $v_4$;
[scale=1.66,fill=none]  at (7,1.2) $v_5$;
[scale=1.66,fill=none]  at (8,1.2) $v_6$;
[scale=1.66,fill=none]  at (9,1.2) $v_7$;
[scale=1.66,fill=none]  at (0,-1.2) $w_1$;
[scale=1.66,fill=none]  at (1,-1.2) $w_2$;
[scale=1.66,fill=none]  at (2,-1.2) $w_3$;
[scale=1.66,fill=none]  at (3,-1.2) $w_4$;
[scale=1.66,fill=none]  at (4,-1.2) $w_5$;
[scale=1.66,fill=none]  at (5,-1.2) $w_6$;
[scale=1.66,fill=none]  at (6,-1.2) $w_7$;
[scale=1.66,fill=none]  at (7,-1.2) $w_8$;
[scale=1.66,fill=none]  at (8,-1.2) $w_9$;
[scale=1.66,fill=none]  at (9,-1.2) $w_{10}$;
(v1) edge (w1);
(v1) edge (w2);
(v2) edge (w3);
(v2) edge (w4);
(v2) edge (v3);
(v3) edge (w5);
(v4) edge (w6);
(v4) edge (w7);
(v4) edge [bend left] (v6);
(v5) edge (w8);
(v5) edge (w9);
(v5) edge (w10);
(v5) edge (v6);
(v6) edge (w2);
(v6) edge (w9);
(v6) edge (w10);
(v6) edge (v7);
(v7) edge (w10);

The original graph $G$

[transform shape]

scale=1, every node/.style=scale=0.5, fill = black,circle,minimum size=0.1cm

[draw] (v1) at (0.5,1) ;
[draw] (v2) at (2.5,1) ;
[draw] (v3) at (4,1) ;
[draw] (v4) at (5.5,1) ;
[draw] (v5) at (7,1) ;
[draw] (v6) at (8,1) ;
[draw] (v7) at (9,1) ;
[draw] (v'1) at (0.5,-3) ;
[draw] (v'2) at (2.5,-3) ;
[draw] (v'4) at (5.5,-3) ;
[draw] (v'5) at (7,-3) ;
[draw] (u2) at (3.25,3) ;
[draw] (u5) at (7.5,3) ;
[draw] (u6) at (8.5,3) ;
[draw] (w1) at (0,-1) ;
[draw] (w2) at (1,-1) ;
[draw] (w3) at (2,-1) ;
[draw] (w4) at (3,-1) ;
[draw] (w5) at (4,-1) ;
[draw] (w6) at (5,-1) ;
[draw] (w7) at (6,-1) ;
[draw] (w8) at (7,-1) ;
[draw] (w9) at (8,-1) ;
[draw] (w10) at (9,-1) ;
[scale=1.66,fill=none]  at (0.8,1) $v_1$;
[scale=1.66,fill=none]  at (0.8,-3) $v'_1$;
[scale=1.66,fill=none]  at (2.8,1) $v_2$;
[scale=1.66,fill=none]  at (2.8,-3) $v'_2$;
[scale=1.66,fill=none]  at (4.3,1) $v_3$;
[scale=1.66,fill=none]  at (5.8,1) $v_4$;
[scale=1.66,fill=none]  at (5.8,-3) $v'_4$;
[scale=1.66,fill=none]  at (7.3,1) $v_5$;
[scale=1.66,fill=none]  at (7.3,-3) $v'_5$;
[scale=1.66,fill=none]  at (8.3,1) $v_6$;
[scale=1.66,fill=none]  at (9.3,1) $v_7$;
[scale=1.66,fill=none]  at (0.3,-1) $w_1$;
[scale=1.66,fill=none]  at (1.3,-1) $w_2$;
[scale=1.66,fill=none]  at (2.3,-1) $w_3$;
[scale=1.66,fill=none]  at (3.3,-1) $w_4$;
[scale=1.66,fill=none]  at (4.3,-1) $w_5$;
[scale=1.66,fill=none]  at (5.3,-1) $w_6$;
[scale=1.66,fill=none]  at (6.3,-1) $w_7$;
[scale=1.66,fill=none]  at (7.3,-1) $w_8$;
[scale=1.66,fill=none]  at (8.3,-1) $w_9$;
[scale=1.66,fill=none]  at (9.3,-1) $w_{10}$;
[scale=1.66,fill=none]  at (3.55,3) $u_2$;
[scale=1.66,fill=none]  at (7.8,3) $u_5$;
[scale=1.66,fill=none]  at (8.8,3) $u_6$;

(v1) edge [left] node [fill=none,scale=1.66] 1 (w1);
(v1) edge [right] node [fill=none,scale=1.66] 1 (w2);
(v'1) edge [left] node [fill=none,scale=1.66] 1 (w1);
(v'1) edge [right] node [fill=none,scale=1.66] 1 (w2);
(v'2) edge [left] node [fill=none,scale=1.66] 1 (w3);
(v'2) edge [right] node [fill=none,scale=1.66] 1 (w4);
(v2) edge [left] node [fill=none,scale=1.66] 1 (u2);
(v3) edge [left] node [fill=none,scale=1.66] 1 (w5);
(v4) edge [left] node [fill=none,scale=1.66] 1 (w6);
(v4) edge [right] node [fill=none,scale=1.66] 1 (w7);
(v'4) edge [left] node [fill=none,scale=1.66] 1 (w6);
(v'4) edge [right] node [fill=none,scale=1.66] 1 (w7);
(v5) edge [left] node [fill=none,scale=1.66] 2(w9);
(v5) edge [below] node [fill=none,scale=1.66] 2(w10);
(v'5) edge [left] node [fill=none,scale=1.66] 1 (w8);
(v'5) edge [above] node [fill=none,scale=1.66] 1 (w9);
(v'5) edge [right] node [fill=none,scale=1.66] 1 (w10);
(v5) edge [left] node [fill=none,scale=1.66] 1 (u5);
(v6) edge [above] node [fill=none,scale=1.66] 2(w10);
(v6) edge [left] node [fill=none,scale=1.66] 1 (u6);
(v7) edge [right] node [fill=none,scale=1.66] 1(w10);

The resulting bipartite graph $G'$

Drawings illustrating <ref>

Consider $G=(V,E)$, with $V$ being decomposed as $C\cup I$, where $C=\{v_1,v_2,\dots,v_7\}$ and $I=\{w_1,w_2,\dots,w_{10}\}$. The set $C$ is a vertex cover of $G$, with $E$ containing the edges $\{v_2v_3,v_4v_6,v_6v_6,v_6v_7\}$ plus several edges connecting $C$ and $I$, as shown in <ref>.

Let us consider the identity as permutation and consider the bitvector $\bar b=(0,1,0,0,1,1)$.
This lets us consider the graph $G'$ as depicted in <ref>.
Notice that we use four layers for drawing $G'$.
On the topmost layer, we show the three vertices $u_2,u_5,u_6$ that we have to introduce thanks to $\bar b$. On the second layer, we draw the vertices of $C$ given in the ordering of our permutation, the identity. On the third layer, we draw the vertices from $I$. Finally, our algorithm enforces us to introduce one more primed vertex whenever a new path is started with respect to $C$. As $\bar b$ contains three zeros, this means that we have to introduce four vertices, which are $v_1',v_2',v_4',v_5'$.
All edges in this bipartite graph $G'$ that are incident to vertices on the topmost or lowermost layer have weight $1$. Only edges connecting the second and the third layer may have either weight $1$ or $2$.
In our example, one can find two distinctively different matchings of maximum weight:

* $M_1=\{v_1w_1,v_1'w_2,v_2u_2,v_2'w_3,v_3w_5,v_4w_6,v_4'w_7,v_5'w_8,v_5w_9,v_6w_{10}\}$, and

* $M_2=\{v_1'w_1,v_1w_2,v_2u_2,v_2'w_3,v_3w_5,v_4'w_6,v_4w_7,v_5'w_8,v_5w_9,v_6u_6,v_7w_{10}\}$.

We find $w(M_1)=w(M_2)=12$ and hence, both matchings should correspond to a collection of five paths in the original graph $G$, as $G$ has 17 vertices. More precisely, $M_1$ corresponds to $P_1=\{w_1v_1w_2,w_3v_2v_3w_5,w_4,w_6v_4w_7,w_8v_5w_9v_6w_{10}v_7\}$, while $M_2$ shows $P_2=\{w_1v_1w_2,w_3,w_4v_2v_3w_5,w_6v_4w_7,w_8v_5w_9v_6v_7w_{10}\}$.

We could also consider a different bitvector, say, $\bar b'=(0,0,0,0,1,1)$.
Although we would now have one more path involving $C$-vertices, their overall number would not change. As the reader can verify, a possible solution obtained by our matching approach is now

Again, there would be a variation $P_2'$ similar as before.

Observe that the edge $v_4v_6$ does not play a big role in our construction in this example. We can take this to an extreme by considering the permutation $\pi=(7,1,2,6,3,5,4)$. Then, there are no two vertices $v_{\pi(i)}$ and $v_{\pi(i+1)}$ that are connected by an edge. Even worse, there is no vertex from $I$ adjacent both to $v_{\pi(i)}$ and $v_{\pi(i+1)}$.
Therefore, the only reasonable bitvector is the all-zero-vector $\vec{0}$. This means we have seven paths containing $C$-vertices in any path partition of $G'(\pi,\vec{0})$. But in fact, our matching approach also yields a matching with 10 edges in $G'(\pi,\vec{0})$, with each edge having weight $1$. To realize this, we could take a path partition that contains four paths of length one: $v_7w_{10}$, $v_6w_9$, $v_3w_5$, and $v_5w_8$, plus three paths of length two: $w_1v_1w_2$, $w_3v_2w_4$, and $w_6v_4w_7$.

But the first choice obviously gave a better result for our aim of minimizing the number of paths in a path partition of $G$.

§ DUALS AND DISTANCE TO TRIVIALITY

Given a typical graph problem that is (as a standard) parameterized by solution size $k$, it takes as input a graph $G$ of order $n$ and $k$, then its dual parameter is $k_d=n-k$. This applies in particular to our problems UPP, UIPP and USPP. As these problems always have as a trivial solution the number $n$ of vertices (i.e., $n$ trivial paths), we can also interpret this dual parameterization as a parameterization led by the idea of distance from triviality.
Moreover, all our problems can be algorithmically solved for each connected component separately, so that we can assume, without loss of generality, that we are dealing with connected graphs. Namely, if $(G,k)$ with $G=(V,E)$ is a graph and $C\subsetneq V$ describes a connected component, then we can solve $(G[C],k')$ and $(G-C,k-k')$ independently for all $1\leq k'<k$.
We now prove that our problems, with dual parameterizations, are in by providing a kernelization algorithm. The following combinatorial claims are crucial.

Let $G$ be an undirected graph of order $n$.
If $G$ has a matching that covers $2k$ vertices, then $(G,n-k)$ is a -instance of UPP, UIPP and USPP.

Let $M$ be a matching of $G$ such that $M$ covers $2k$ vertices. We construct a solution $\mathbb{P}$ of PP, IPP and SPP as follows. For every edge $(u,v) \in M$, include the path $\{u,v\}$ into $\mathbb{P}$. Put the rest of the vertices  not yet covered by $M$ as single-vertex paths into the solution $\mathbb{P}$ . We see that the path collection $\mathbb{P}$ covers every vertex exactly once in $G$ and has cardinality $n-k$.

The preceding lemma has the following interesting consequence.

If $G=(V,E)$ is a
graph that possesses some $X \subseteq V$ with  $|X| \geq 2k$ such that $\deg(v) \geq  2k$ for every $v \in X$, then $G$ has a matching of size $k$ and hence $(G,n-k)$ is a -instance of UPP, UIPP and USPP.

This consequence, as well as the following combinatorial observation, has no direct bearing on our algorithmic result, but may be of independent interest.

If $G$ is a connected graph with $\diam(G) > k$, then $(G,n-k)$ is a -instance of UPP, UIPP and USPP.

More interestingly, <ref> is also valid for directed graphs in the following form as we can observe the directions of the matching edges as prescribed by the given directed graph.

Let $G$ be a directed graph of order $n$.
If the underlying undirected graph $U(G)$ has a matching that covers $2k$ vertices, then $(G,n-k)$ is a -instance of DPP, DIPP and DSPP.

Our combinatorial thoughts, along with <ref> and <ref>, allow us to show the following algorithmic result, the main result of this section.

UPP, UIPP and USPP, as well as DIPP and DSPP, can be solved in time with dual parameterization.

We first handle the undirected graph case. Let $G=(V,E)$ and $k$ together be an instance of UPP, UIPP, or USPP, where $|V|=n$.
As said above, we can assume that $G$ is connected.
Next, compute a maximum matching $M$ in $G$. If $|M|>k$, then <ref> justifies why $(G,n-k)$ is a -instance. Hence, we can assume that a graph that
any  matching has size at most $k$.
This implies (as matchings provide factor-2 approximations for Minimum Vertex Cover) that the vertex cover number $\vc(G)$ is at most $2k$. This allows us to first compute $\vc(G)$ in time; see <cit.>.
Now, <ref> and <ref> show the claim in the case of UIPP and USPP, as well as for UPP.

For the case of directed graphs, we can first argue concerning the underlying undirected graph as in <ref>. Then, we make us of <ref>.

§ COVERING AND EDGE-DISJOINT VARIANTS

As we mentioned in the introduction, the variants PC, SPC and IPC of the problems, where the paths cover the vertices but do not need to form a partition, are also studied. Many of our results do apply to these problems as well.

Alternatively, in some applications, paths may be required to be edge-disjoint but not necessarily vertex-disjoint, see for example <cit.>, where the problem Edge-Disjoint Paths is studied. Thus, one may define the problems Edge-Disjoint Path Cover (ED-PC), Edge-Disjoint Shortest Path Cover (ED-SPC) and Edge-Disjoint Induced Path Cover (ED-IPC) (as before we include the prefixes U, D, or DAG in the problem name abbreviations if we want to emphasize that the inputs are undirected, directed, or directed acyclic). These can be thought of as intermediate problems between the partition and the covering variants, indeed a (unrestricted, induced or shortest) path partition is an (unrestricted, induced or shortest) edge-disjoint path cover, which is also a (unrestricted, induced or shortest) path cover.

Some of our results apply to these three problems as well with slight modifications of the proofs. Hence, we only exhibit these modifications in the following.

§.§ NP-completeness results for DAGs and bipartite undirected graphs

DAGSPC, DAGIPC, ED-DAGSPC and ED-DAGIPC are -hard even when the inputs are restricted to planar bipartite DAGs of maximum degree 4.

We follow the same construction as <ref>.  Observe that each shortest or induced path in any solution of (ED-)DAGSPC/(ED-)DAGIPC must contain exactly three vertices (and thus forms a vertex-partition of the graph), and each gadget $H(v_i)$ is partitioned into $P_3$-paths in one of the two ways as shown in <ref>. The rest of the argumentation is similar to <ref>.

USPC and ED-USPC are -hard, even for bipartite 5-degenerate graphs with diameter 4.

We follow the same construction as <ref> (also see <ref>). We can observe that the following claims hold for our problem.

Any shortest path of $G'$, except for the six paths
$x_1x_2x_3x_4x_5$, $x_1x_2y_2x_4x_5$, $x_1x_2y_4x_4x_5$ and $y_1y_2y_3y_4y_5$, $y_1y_2x_2y_4y_5$, $y_1y_2x_4y_4y_5$, contains at most four vertices. Hence, $G'$ has a diameter at most 4.  $\Diamond$

The only two shortest paths in $G'$ that have five vertices and that can simultaneously exist in a path partition are $x_1x_2x_3x_4x_5$ and $y_1y_2y_3y_4y_5$.   $\Diamond$

The rest of the proof is similar to <ref>.

§.§ W-hardness for DAGs

The following result is only adaptable (as far as we can see) for the edge-disjoint variants.

ED-DAGSPC and ED-DAGIPC (parameterized by solution size) are 1-hard.

This is derived from the method of proving <ref>. We modify our gadgets $G_{i,u}$, $0< u \leq n$, $i \in [k]$,  in the construction as shown in <ref>. The rest of the proof is similar to <ref>.

every picture/.style=line width=0.75pt

roundnode/.style=circle, draw=black,  thick, minimum size=5mm, scale=0.8,
squarednode/.style=rectangle, draw=red!60, fill=red!5, very thick, minimum size=5mm,
dot/.style=fill=black,circle,minimum size=1pt

[rectangle,draw,minimum width = 6cm,
minimum height = 4cm, rounded corners=5pt] (b) at (,) ;
[roundnode] at (- 1.5cm ,+ 0.5cm )     (a1)  ;
[roundnode] at (- 0.5 cm ,+ 0.5cm )     (a2)  ;
[roundnode] at (- 1.5cm ,+ 1.5cm )     (a11)  ;
[roundnode] at (- 0.5 cm ,+ 1.5cm )     (a12)  ;
[roundnode] at (+ 0.5cm ,+ 1.5cm )     (a13)  ;
[roundnode] at (+ 1.5cm ,+ 1.5cm )     (a14)  ;
[roundnode] at (+ 2.7cm ,+ 1.5cm )     (a15)  ;
[roundnode] at (- 1.5cm ,- 1.5cm )     (b11)  ;
[roundnode] at (- 0.5 cm ,- 1.5cm )     (b12)  ;
[roundnode] at (+ 0.5cm ,- 1.5cm )     (b13)  ;
[roundnode] at (+ 1.5 cm ,- 1.5cm )     (b14)  ;
[roundnode] at (+ 2.7 cm ,- 1.5cm )     (b15)  ;
[dot,scale=0.3] at (- 0.1cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (- 0.0cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (+ 0.1cm ,+ 0.5cm) (d1);
[roundnode] at (+ 0.5cm ,+ 0.5cm )     (ai1)  ;
[roundnode] at (+ 1.5cm ,+ 0.5cm )     (ai)  ;
[dot,scale=0.3] at (+ 2cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (+ 2.1cm ,+ 0.5cm) (d1);
[dot,scale=0.3] at (+ 2.2cm ,+ 0.5cm) (d1);
[roundnode] at (+ 2.7cm ,+ 0.5cm )     (ak)  ;
[roundnode] at (+ 1.5cm ,+ 2.5cm )     (si)  ;
[roundnode] at (+ 2.7cm ,+ 2.5cm )     (sk)  ;
[roundnode] at (- 1.5cm ,- 0.5cm )     (b1)  ;
[roundnode] at (- 1.5cm ,- 2.5cm )     (t1)  ;
[roundnode] at (- 0.5cm ,- 0.5cm  )     (b2)  ;
[roundnode] at (- 0.5cm ,- 2.5cm )     (t2)  ;
[dot,scale=0.3] at (- 0.1cm ,- 0.5cm) (d1);
[dot,scale=0.3] at (+ 0cm ,- 0.5cm) (d1);
[dot,scale=0.3] at (+ 0.1cm ,- 0.5cm) (d1);
[roundnode] at (+ 0.5cm ,- 0.5cm )     (bi1)  ;
[roundnode] at (+ 0.5cm ,- 2.5cm )     (ti1)  ;
[roundnode] at (+ 1.5cm ,- 0.5cm )     (bi)  ;
[dot,scale=0.3] at (+ 2.cm ,-0.5cm) (d1);
[dot,scale=0.3] at (+ 2.1cm ,-0.5cm) (d1);
[dot,scale=0.3] at (+ 2.2cm ,-0.5cm) (d1);
[roundnode] at (+ 2.7cm ,- 0.5cm )     (bk) ;
[] at (- 1.0cm , + 0.2cm) $a_1$;
[] at (- 1.1cm , + 1.2cm) $a'_1$;
[] at (- .15cm , + 0.2cm) $a_2$;
[] at (- .15cm , + 1.2cm) $a'_2$;
[] at (+ 1cm , + 0.2cm) $a_{i-1}$;
[] at (+0.9cm  , + 2.5cm) $s_{i,i+1}$;
[] at (+ 2.05cm , + 0.2cm) $a_{i+1}$;
[] at (+ 2.05cm , + 1.2cm) $a'_{i+1}$;
[] at (+ 3cm , + 0.2cm) $a_{k}$;
[] at (+ 3cm , + 1.2cm) $a'_{k}$;
[] at (+3.2cm  , + 2.5cm) $s_{i,k}$;
[] at (- 1.1cm , - 0.8cm) $b_1$;
[] at (- 1.1cm , - 1.8cm) $b'_1$;
[] at (- 2cm , - 2.5cm) $t_{1,i}$;
[] at (- .15cm , - 0.8cm) $b_2$;
[] at (- .15cm , - 1.8cm) $b'_2$;
[] at (-1cm , - 2.5cm) $t_{2,i}$;
[] at (+ 1.0cm , - 0.5cm) $b_{i-1}$;
[] at (+1.2cm  , - 2.5cm) $t_{i-1,i}$;
[] at (+ 2.05cm , - 0.8cm) $b_{i+1}$;
[] at (+ 2.05cm , - 1.8cm) $b'_{i+1}$;
[] at (+ 3cm , - 0.8cm) $b_{k}$;
[] at (+ 3cm , - 1.8cm) $b'_{k}$;

[-Stealth[scale=1]] (a1) to (b1);
[-Stealth[scale=1]] (a2) to (b2);
[-Stealth[scale=1]] (ai1) to (a14);
[-Stealth[scale=1]] (ai) to (bi);
[-Stealth[scale=1]] (ai1) to (bi1);
[-Stealth[scale=1]] (b13) to (bi);
[-Stealth[scale=1]] (a11) to (a1);
[-Stealth[scale=1]] (a1) to (a12);
[-Stealth[scale=1]] (a12) to (a2);
[-Stealth[scale=1]] (a13) to (ai1);
[-Stealth[scale=1]] (a14) to (ai);
[-Stealth[scale=1]] (a15) to (ak);
[-Stealth[scale=1]] (si) to (a14);
[-Stealth[scale=1]] (sk) to (a15);
[-Stealth[scale=1]] (b11) to (t1);
[-Stealth[scale=1]] (b12) to (t2);
[-Stealth[scale=1]] (b13) to (ti1);
[-Stealth[scale=1]] (b1) to (b11);
[-Stealth[scale=1]] (b11) to (b2);
[-Stealth[scale=1]] (b2) to (b12);
[-Stealth[scale=1]] (bi1) to (b13);
[-Stealth[scale=1]] (bi) to (b14);
[-Stealth[scale=1]] (bk) to (b15);
[-Stealth[scale=1]] (ak) to (bk);
[-Stealth[scale=1]] (- 2.5cm, + 1.5cm) to (a11);
[-Stealth[scale=1]] (- 2.5cm, - 0.5cm) to (b1);
[-Stealth[scale=1]] (ak) to (+ 3.8cm, + 1.5cm);
[-Stealth[scale=1]] (b15) to (+ 3.8cm, - 0.5cm);

figureNew gadget $G_{i,u}$, $0< u \leq n$, $i \in [k]$.

§.§ algorithms

For our next result, we need the following theorem, indeed the techniques used in Section <ref> are not applicable since they are based on using (vertex-) disjoint path problems.

Let $G$ be an undirected graph whose vertex set can be covered by at most $k$ (not necessarily disjoint) shortest paths. Then the pathwidth of $G$ is in $O(k\cdot 3^{k})$.

The following corollary was already observed in <cit.> for the problems USPC and USPP. The same argument shows the following.

ED-USPC is in when parameterized by solution size.

Here we cannot use the technique of <ref> based on DP and its variants. <ref>, follows from the same proof used in <cit.> for USPC: first bound the pathwidth of the graph using <ref>. Then, as for <ref>, guess the set $X$ of endpoints of the solution paths (cycling through the solutions is done in time). That way, one can compute the sum $s$ of the pairwise distances between the endpoints in $X$. Then, one can use the counting version of Courcelle's theorem by expressing the problem in Counting Monadic Second Order Logic (CMSOL) and solve it in time: one expects a partition whose total size is equal to $s$.

§.§ Neighborhood diversity and vertex cover parameterizations

USPC, UIPC, ED-USPC and ED-UIPC (as well as DSPC, DIPC, ED-DSPC and ED-DIPC) are in when parameterized by (directed) neighborhood diversity.

This can be obtained with the same proof as the one of <ref> by modifying the ILP as follows. Each $p \in P$ is characterized by a vector $(t_{p,1,1}, \ldots , t_{p,k,k})$ with $t_{p,i,j} = |E_{i,j} \cap p|, i , j \leq k$. Here $E_{i,j}$ refers to the edges between the $i^{th}$ and $j^{th}$ equivalence class

For the covering versions we use:

$$\text{minimize} %\sum_{i = 1}^{i = |Z|} z_i
\sum_{p\in\cal P}z_p

$$\text{subject to }\sum_{p\in \cal P}z_p\cdot p^j \geq |C_j|\text{  for all }j\in [d]$$

While for the edge-disjoint variants we write:

$$\text{minimize} %\sum_{i = 1}^{i = |Z|} z_i
\sum_{p\in\cal P}z_p

$$\text{subject to }\sum_{p\in \cal P}z_p\cdot p^j \geq|C_j|\text{  for all }j\in [d]$$

$$ \text{and subject to }\sum_{p\in \cal P}z_p \cdot t_{p,i,j} \leq|E_{i,j}|\text{ for all }i,j\in [d] $$

For the directed cases, we refer to the arguments leading to <ref>.

USPC, UIPC, ED-USPC and ED-UIPC (as well as DSPC, DIPC, ED-DSPC and ED-DIPC) are in when parameterized by the vertex cover number of the given (or of the underlying undirected) graph.

§.§ Dual parameters

UPC, ED-UPC, ED-USPC and ED-UIPC (as well as the directed counterparts ED-DSPC, ED-DIPC, ED-DSPC and ED-DIPC) can be solved in time with respect to the dual parameterization.

These results are obtained using the technique of <ref> in view of <ref>, using <ref> for (ED-)UPC and <ref> for (ED-)USPC and (ED-)UIPC.

§ CONCLUSIONS

We have explored the algorithmic complexity of the three problems PP, IPP and SPP, and as witnessed by <ref>, our results show some interesting algorithmic differences between these three problems.

Many interesting questions remain to be investigated. For example, what is the parameterized complexity of SPP on undirected graphs, parameterized by the number of paths? Is it 1-hard, like for DAGs? This was asked in <cit.>, and our 1-hardness result for DAGs can be seen as a first step towards an answer.

Another interesting question is whether SPP is on directed graphs? This is the case for undirected graphs, for DAGs and for directed graphs that are planar or have bounded directed treewidth, but we do not know about the general case. We also do not know if IPP is in for DAGs when parameterized by solution size, or if it is -hard like in the general (and undirected) case.

We do not know whether IPP is -hard on undirected bipartite graphs. Other classes, like planar graphs, could also be interesting to study in this regard.

We have seen that IPP and SPP admit algorithms when parameterized by (directed) neighborhood diversity. Can we obtain such algorithms for other (e.g., more general) parameters (as was done for UPP and modular-width in <cit.>)? In the case of PP, this holds for undirected graphs by <cit.>; we do know if this is true for directed graphs (even for the vertex cover number of the underlying graph).

Regarding the parameterized algorithms that we obtained for vertex cover and neighborhood diversity, can they be improved? For PP parameterized by vertex over, we managed to reduce the dependency to $\Oh^*\left(\vc!\cdot 2^{\vc}\right)$, which is $\Oh^*\left(2^{\vc\log\vc}\right)$ (<ref>). It is not clear if this can be improved to, say, $\Oh^*\left(2^{\vc}\right)$. Also, it would be interesting to obtain a similar running time (or better) for SPP and IPP as well. Furthermore, we do not know whether polynomial kernelizations exist for these problems.

Similarly, in the light of our algorithms for the dual parameterizations of PP, IPP and SPP, we can ask whether they admit a polynomial kernel.

As we have indicated, some of our results also apply to the covering variants of the three problems (where the paths need not be disjoint). On the other hand, approximation algorithms have been designed for SPC, the covering version of SPP, in <cit.> (for general undirected graphs) and <cit.> (for chordal graphs and related undirected graph classes). Are there such algorithms for SPP (and IPP) as well?

Another line of research is reconfiguration.
In particular, shortest path reconfiguration in undirected graphs has been extensively studied, see <cit.> for a recent piece of work that also gives a nice survey, but directed graphs have attracted less attention. Also, the reconfiguration of path partitions as studied in this paper has not been touched so far, although this has natural applications in reconfiguring supply networks.

We also note that some of the techniques used in this paper for the IPP problem likely can be applied to the Hole Partition problem (where we want to partition a graph into induced cycles). The packing version of this problem was studied in <cit.>.

§ ACKNOWLEDGMENTS

This paper is an extended version of a paper presented at CIAC 2023 <cit.>. The research of the second author was financed by the French government IDEX-ISITE initiative 16-IDEX-0001 (CAP 20-25) and by the ANR project GRALMECO (ANR-21-CE48-0004).
The research of the last author was funded by a DAAD-WISE Scholarship 2022.