Skip to main content

On the Parameterized Complexity of the Connected Flow and Many Visits TSP Problem

  • Conference paper
  • First Online:
Graph-Theoretic Concepts in Computer Science (WG 2021)

Abstract

We study a variant of Min Cost Flow in which the flow needs to be connected. Specifically, in the Connected Flow problem one is given a directed graph G, along with a set of demand vertices \(D \subseteq V(G)\) with demands \(\mathsf {dem}: D \rightarrow \mathbb {N}\), and costs and capacities for each edge. The goal is to find a minimum cost flow that satisfies the demands, respects the capacities and induces a (strongly) connected subgraph. This generalizes previously studied problems like the (Many Visits) TSP.

We study the parameterized complexity of Connected Flow parameterized by |D|, the treewidth \(tw\) and by vertex cover size k of G and provide:

  1. 1.

    NP-completeness already for the case \(|D|=2\) with only unit demands and capacities and no edge costs, and fixed-parameter tractability if there are no capacities,

  2. 2.

    a fixed-parameter tractable \(\mathcal {O}^{\star }(k^{\mathcal {O}(k)})\) time algorithm for the general case, and a kernel of size polynomial in k for the special case of Many Visits TSP,

  3. 3.

    a \(|V(G)|^{\mathcal {O}(tw)}\) time algorithm and a matching \(|V(G)|^{o(tw)}\) time conditional lower bound conditioned on the Exponential Time Hypothesis.

To achieve some of our results, we significantly extend an approach by Kowalik et al. [ESA’20].

Supported by the project CRACKNP that has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No. 853234) and by the Netherlands Organization for Scientific Research under project no. 613.009.031b.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    In this problem a minimum length tour is sought that satisfies each vertex a given number of times. The generalization is by setting the demand of a vertex to the number of times the tour is required to visit that vertex and using infinite capacities.

  2. 2.

    In Appendix A we show that Flow is equivalent to the Min Cost Flow problem, which is polynomial-time solvable.

  3. 3.

    In this section, we will only use n to refer to the number of variables of a 3-CNF-SAT instance.

  4. 4.

    Here E(XX) are all edges with both endpoints in X and the restriction \(c_Y\) are all edges in c in Y (keeping multiplicities).

  5. 5.

    If n is not divisible by s, we may either add dummy variables until it is, or lower the demand of \(l_{i,n/s}\) and \(r_{i,n/s}\).

  6. 6.

    We don’t include the term |X|, since \(X \subseteq \{l_{i,k}\}_{k=1}^{n/s} \cup \{r_{i,k}\}_{k=1}^{n/s}\).

  7. 7.

    Due to the way we interpret the multiplicities as truth assignments (in particular the ‘\(-1\)’) we know each edge gets chosen at least once.

References

  1. Berger, A., Kozma, L., Mnich, M., Vincze, R.: Time- and space-optimal algorithm for the many-visits TSP. ACM Trans. Algorithms 16(3), 35:1–35:22 (2020)

    Google Scholar 

  2. Bodlaender, H.L., Cygan, M., Kratsch, S., Nederlof, J.: Deterministic single exponential time algorithms for connectivity problems parameterized by treewidth. Inf. Comput. 243, 86–111 (2015)

    Article  MathSciNet  MATH  Google Scholar 

  3. Cai, L., Ye, J.: Finding two edge-disjoint paths with length constraints. In: Heggernes, P. (ed.) WG 2016. LNCS, vol. 9941, pp. 62–73. Springer, Heidelberg (2016). https://doi.org/10.1007/978-3-662-53536-3_6

    Chapter  Google Scholar 

  4. Cosmadakis, S.S., Papadimitriou, C.H.: The traveling salesman problem with many visits to few cities. SIAM J. Comput. 13(1), 99–108 (1984)

    Article  MathSciNet  MATH  Google Scholar 

  5. Cygan, M., et al.: Parameterized Algorithms. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21275-3

    Book  MATH  Google Scholar 

  6. Cygan, M., Kratsch, S., Nederlof, J.: Fast Hamiltonicity checking via bases of perfect matchings. J. ACM 65(3), 12:1–12:46 (2018)

    Google Scholar 

  7. Etscheid, M., Kratsch, S., Mnich, M., Röglin, H.: Polynomial kernels for weighted problems. J. Comput. Syst. Sci. 84, 1–10 (2017)

    Article  MathSciNet  MATH  Google Scholar 

  8. Fortune, S., Hopcroft, J.E., Wyllie, J.: The directed subgraph homeomorphism problem. Theor. Comput. Sci. 10, 111–121 (1980)

    Article  MathSciNet  MATH  Google Scholar 

  9. Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman (1979)

    Google Scholar 

  10. Kowalik, Ł., Li, S., Nadara, W., Smulewicz, M., Wahlström, M.: Many visits TSP revisited. In: Grandoni, F., Herman, G., Sanders, P. (eds.) (ESA 2020), Volume 173 of Leibniz International Proceedings in Informatics (LIPIcs), Dagstuhl, Germany, pp. 66:1–66:22. Schloss Dagstuhl-Leibniz-Zentrum für Informatik (2020)

    Google Scholar 

  11. Philip, G., Rani, M.R., Subashini, R.: On computing the Hamiltonian index of graphs. In: Fernau, H. (ed.) CSR 2020. LNCS, vol. 12159, pp. 341–353. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-50026-9_25

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Céline Swennenhuis .

Editor information

Editors and Affiliations

Appendices

A Problem Definitions

In this section we formally introduce and discuss a number of computational problems that are relevant for this paper.

Formally, we define the Flow problem as follows.

figure b

From the definition it is clear that apart from the connectivity requirement, it is indeed equivalent to Connected Flow.

We will use the following standard definition of Min Cost Flow.

figure c

Equivalence of Flow and Min Cost Flow. We argue that Flow is equivalent to Min Cost Flow by simple reductions. First we reduce in the forward way. For each \(d \in D\), create vertices \(d_{\mathsf {out}}, d_{\mathsf {in}}\) where \(d_{\mathsf {out}}\) is a source node with outgoing flow \(\mathsf {dem}(d)\) and \(d_{\mathsf {in}}\) is a sink node with ingoing flow \(\mathsf {dem}(d)\). For all other vertices in \(V{\setminus } D\), create a node and connect to all its neighbors, where all outgoing edges to a vertex in D go to \(d_{\mathsf {in}}\) and all ingoing edges from a vertex in D connect to \(d_{\mathsf {out}}\).

For the other direction, let S be the set of source nodes and T be the set of sink nodes of the Min Cost Max Flow problem. Then add one ‘big’ node x to the graph, with demand equal to the outgoing flow from all the source nodes. Then add (tx) for all \(t \in T\) with \(\mathsf {cost}(t,x) = 0\), \(\mathsf {cap}(t,x) = \mathsf {out}(t)\). Furthermore add (xs) for all \(s \in S\) with \(\mathsf {cost}(x,s) = 0\), \(\mathsf {cap}(x,s) = \mathsf {in}(s)\).

Since Min Cost Flow is well-known to be solvable in polynomial time, we can therefore conclude that Flow is solvable in polynomial time as well.

In Kowalik et al. [10], the Many Visit TSP (MVTSP) is defined as follows.

figure d

Note that MVTSP is a special case of Connected Flow, where \(D=V\) and the capacities of all edges are infinite.

B Parameterization by Number of Demand Vertices

In this section we study the parameterized complexity of Connected Flow with parameter |D|, the number of vertices with a demand. We first prove that the problem is NP-hard, even for \(|D|=2\), by a reduction from the problem of finding two vertex disjoint paths in a directed graph. Next we show that, if \(\mathsf {cap}(e) = \infty \) for all \(e\in E\), the problem can be reduced to an instance of MVTSP, and hence solved in time \(\mathcal {O}^{\star }(4^{|D|})\).

Theorem 6

Connected Flow with 2 demand vertices is NP-complete.

Proof

We give a reduction from the problem of finding two vertex-disjoint paths in a directed graph to Connected Flow with demand set D of size 2. The directed vertex-disjoint paths problem has been shown to be NP-hard for fixed \(k = 2\) by Fortune et al. [8], so this reduction will prove our theorem for \(|D| = 2\). Note that the case of \(|D| > 2\) is harder, since we can view \(|D| = 2\) as a special case, by adding isolated vertices with demand 0.

Given a graph G and pairs \((s_1, t_1)\) and \((s_2, t_2)\), we construct an instance \((G', D, \mathsf {dem}, \mathsf {cost}, \mathsf {cap})\) of Connected Flow. Let \(V_0 = V {\setminus } \{s_1, s_2, t_1, t_2\}\), we define

$$ V(G') = \{s_1, s_2, t_1, t_2\} \cup \{v_{\mathsf {in}} : v \in V_0\} \cup \{v_{\mathsf {out}} : v \in V_0\} $$

We let \(D = \{s_1, s_2\}\) and set \(\mathsf {dem}(s_1) = \mathsf {dem}(s_2) =1\). We also define

$$\begin{aligned} E(G') = \,&\{(v_{\mathsf {in}}, v_{\mathsf {out}}) : v \in V_0\} \\&\cup \{(s_i, v_{\mathsf {in}}) : (s_i, v) \in E(G), i = 1, 2 \} \\&\cup \{(v_{\mathsf {out}}, t_i) : (v, t_i) \in E(G), i = 1, 2\} \\&\cup \{(u_{\mathsf {out}}, v_{\mathsf {in}}): u, v \in V_0, (u,v) \in E(G)\} \\&\cup \{(t_1, s_2), (t_2, s_1)\}. \end{aligned}$$

We now set \(\mathsf {cost}(u,v) = 0\) and \(\mathsf {cap}(u,v)=1\) for every \((u,v) \in E(G')\). We prove that G has two vertex-disjoint paths (from \(s_1\) to \(t_1\) and from \(s_2\) to \(t_2\)) if and only if \((G',D,\mathsf {dem},\mathsf {cost},\mathsf {cap})\) has a connected flow of cost 0.

Let \(P_1\) and \(P_2\) be two vertex disjoint paths in G, from \(s_1\) to \(t_1\) and from \(s_2\) to \(t_2\) respectively. Intuitively we will simply walk through the same two paths in \(G'\) and then connect the end of one to the start of the other. More formally, we construct a flow f in \(G'\) as follows. Let \(P_1 = s_1, v^1, \dots , v^l, t_1\), we set \(f(s_1, v_{\mathsf {in}}^1) = f(v_{\mathsf {out}}^l, t_1) = 1\) as well as \(f(v_{\mathsf {in}}^i, v_{\mathsf {out}}^i) = f(v_{\mathsf {out}}^i, v_{\mathsf {in}}^{i+1}) = 1\) for all \(i\in [1,l]\). We do the same for \(P_2\). Finally we set \(f(t_1, s_2) = f(t_2, s_1) = 1\) and set f to 0 for all other edges. We note that all capacities have been respected and all demands have been met. The resulting flow is connected, since the paths were connected and \(f(t_1, s_2) = 1\).

For the other direction, let f be a connected flow for \((G', D, \mathsf {dem}, \mathsf {cost}, \mathsf {cap})\). Since \(\mathsf {dem}(s_1) = \mathsf {dem}(s_2) = 1\) and \(s_1\) and \(s_2\) only have one incoming edge, we have that \(f(t_1, s_2) = f(t_2, s_1) = 1\). We argue that \(G_f - \{(t_1, s_2), (t_2, s_1)\}\) consists of two vertex disjoint paths in \(G'\), one from \(s_1\) to \(t_1\) and the other from \(s_2\) to \(t_2\). First we note that for every vertex in \(G'\), it has either in-degree 1 or out-degree 1 (or possibly both). This means that since we have \(\mathsf {cap}(u,v) = 1\) for every \((u,v) \in E(G')\), every vertex in \(V(G_f)\) has in- and out-degree 1 in \(G_f\). Since \(G_f\) is connected we find that \(G_f\) is a single cycle and thus \(G_f - \{(t_1, s_2), (t_2, s_1)\}\) is the union of two vertex-disjoint paths. We now find two vertex-disjoint paths in G by contracting the edges \((v_{\mathsf {in}}, v_{\mathsf {out}})\) in \(G_f - \{(t_1, s_2), (t_2, s_1)\}\).    \(\square \)

Lemma 2

Given an instance \((G, D, \mathsf {dem}, \mathsf {cost}, \mathsf {cap})\) of Connected Flow where \(\mathsf {cap}(e)=\infty \) for all \(e\in E\), we can construct an equivalent instance of MVTSP on |D| vertices.

Proof

We construct an equivalent instance \((G', \mathsf {dem}, \mathsf {cost}')\) of MVTSP as follows. First we let \(V(G') = D\) and for \(u,v \in D\) we let \((u,v) \in E(G')\) if and only if there is a \(u-v\) path in G, disjoint from other vertices in D. We then set \(\mathsf {cost}(u,v)\) to be the total cost of the shortest such path. We keep \(\mathsf {dem}(v)\) the same.

We now show equivalence of the two instances. Let \(s' : E(G') \rightarrow \mathbb {N}\) be a valid tour on \((G', \mathsf {dem}, \mathsf {cost}')\). We construct a connected flow f on \((G, D, \mathsf {dem}, \mathsf {cost}, \mathsf {cap})\) by, for each \((u,v) \in E(G')\) adding \(s'(u,v)\) copies of the shortest D-disjoint u-v-path in G to the flow. Note that the demands are met, since the demands in both instances are the same. Also note that by definition the total cost of \(s'(u,v)\) copies of the shortest D-disjoint \(u-v\) path is equal to \(s'(u,v)\cdot \mathsf {cost}'(u,v)\) and thus the total cost of f is equal to that of \(s'\). Finally we note that the capacities are trivially met.

In the other direction, let \(f : E(G) \rightarrow \mathbb {N}\) be an optimal connected flow on \((G, D, \mathsf {dem}, \mathsf {cost}, \mathsf {cap})\). Note that \(G_f\) is connected and that every vertex in this multigraph has equal in- and out-degrees. This means we can find some Eulerian tour on \(G_f\). We now construct an MVTSP tour \(s'\) on \(G'\) by adding the edge (uv) every time v is the first vertex with demand to appear after an appearance of u in the Eulerian tour. Again it is easy to see that \(s'\) is connected and that the demands are met. The total cost of \(s'\) is the same as f, namely if it is larger, then there is some pair \(u,v \in D\) such that the cost of some path in the Eulerian tour from u to v is less than \(\mathsf {cost}'(u,v)\), which contradicts the definition of \(\mathsf {cost}'\). If it were smaller, then there is some D-disjoint path in the Eulerian tour from some u to some v which is longer than \(\mathsf {cost}'(u,v)\). We can then find a cheaper flow by replacing this path with the shortest path, contradicting the optimality of f.    \(\square \)

Since MVTSP can be solved in \(\mathcal {O}^{\star }(4^n)\) time by Kowalik et al. [10], we get as a direct consequence:

Theorem 7

Any instance instance \((G, D, \mathsf {dem}, \mathsf {cost}, \mathsf {cap})\) of Connected Flow where \(\mathsf {cap}(e)=\infty \) for all \(e\in E(G)\) can be solved in time \(\mathcal {O}^{\star }(4^{|D|})\).

C Parameterisation by Treewidth

In this section we consider the complexity of Connected Flow, when parameterized by the treewidth \(tw\) of G. We first give a \(|V(G)|^{\mathcal {O}(tw)}\) time dynamic programming algorithm for Connected Flow. Subsequently, we give a matching conditional lower bound on the complexity of MVTSP parameterized by the pathwidth of G. Since MVTSP is a special case of Connected Flow this shows that our dynamic programming algorithm is in some sense optimal.

1.1 C.1 An XP Algorithm for Connected Flow

In this subsection we show the following:

Theorem 4. Let M be an upper bound on the demands in the input graph G, and suppose a tree decomposition of width \(tw\) of G is given. Then a Connected Flow instance with G can be solved in time \(|V(G)|^{\mathcal {O}(tw)}\) and an MVTSP instance with G can be solved in time \(\min \{|V(G)|,M\}^{\mathcal {O}(tw)}|V(G)|^{\mathcal {O}(1)}\).

Proof

The algorithm is based on a standard dynamic programming approach; we only describe the table entries and omit the recurrence to compute table entries since it is standard. We assume we have a tree decomposition \(\mathcal {T} = (\{X_i\}, R )\) on the given graph. For a given bag \(X_i\), let \(\pi \) be a partition on \(X_i\). Furthermore let \(\mathbf {d}^{\mathsf {in}} = (d_v^{\mathsf {in}})_{v \in X_i} \in \mathbb {N}^{X_i}\) and \(\mathbf {d}^{\mathsf {out}} = (d_v^{\mathsf {out}})_{v \in X_i} \in \mathbb {N}^{X_i}\) be two vectors of integers, indexed by \(X_i\). We define the dynamic programming table entry \(T(X_i, \pi , \mathbf {d}^{\mathsf {in}}, \mathbf {d}^{\mathsf {out}})\) to be the cost of the cheapest partial solution on the graph ‘below’ the bag \(X_i\), among solutions whose connected components agree with the partition \(\pi \) and whose in and out degrees agree with the vectors \(\mathbf {d}^{\mathsf {in}}\) and \(\mathbf {d}^{\mathsf {out}}\). More formally, for \(r \in V(R)\) the root of the tree decomposition, we consider a bag \(X_j\) to be below another bag \(X_i\) if one can reach j from i by a directed path in the directed tree obtained from R by orienting every edge away from r. We will denote this as \(X_j \preccurlyeq X_i\) and define \(Y_i = \cup _{X_j \preccurlyeq X_i}X_j\). For each bag \(X_i\), a partition \(\pi \) of \(X_i\) and sequences \(\mathbf {d}^\mathsf {in}\) and \(\mathbf {d}^\mathsf {out}\) satisfying (i) \(0\leqslant d^\mathsf {in}_v,d^\mathsf {out}_v \leqslant \mathsf {dem}(v)\) for each \(v \in D\) and (ii) \(0\leqslant d^\mathsf {in}(v),d^\mathsf {out}(v) \leqslant M |V(G)|\) for each \(v \notin D\), define \(T(X_i, \pi , \mathbf {d}^{\mathsf {in}}, \mathbf {d}^{\mathsf {out}}) = \min _s \mathsf {cost}(s)\) over all \(s : Y_i^2 \rightarrow \mathbb {N}\) such that the following conditions hold:

  1. 1.

    \(\sum _{u \in Y_i} s(u,v) = \sum _{u \in Y_i} s(v,u) = \mathsf {dem}(v)\) for all \(v \in D \cap (Y_i {\setminus } X_i)\)

  2. 2.

    \(\sum _{u \in Y_i} s(u,v) = d^{\mathsf {in}}_v\) for all \(v \in X_i\)

  3. 3.

    \(\sum _{u \in Y_i} s(v,u) = d^{\mathsf {out}}_v\) for all \(v \in X_i\)

  4. 4.

    All blocks of the partition \(\pi \) are weakly connected in \(G_s\).

  5. 5.

    \(s(u,v) \leqslant \mathsf {cap}(u,v)\) for all \((u,v) \in E(G[Y_i])\)

We can compute the table starting at the leaves of R and work our way towards the root.

Let us examine the necessary size of this dynamic programming table. First we note that there are at most \(|V(G)|^{\mathcal {O}(1)}\) bags in the tree decomposition. Next we consider the values \(d_v^{\mathsf {in}}\) and \(d_v^{\mathsf {out}}\). Note that we can assume that an optimal solution only visits any vertex without demand at most M|V(G)| times: Any solution can be decomposed into a collection of paths between vertices with demand. Each such path can be assumed to not visit any vertex more than once (except possibly in the end points of the path) since the solution is of minimum weight and all costs are non-negative. We find that each vertex gets visited at most M|V(G)| times and thus we only need to consider M|V(G)| many values of \(d_v^{\mathsf {in}}\) and \(d_v^{\mathsf {out}}\). Thus the degree values of the partial solutions contribute a factor of \((M|V(G)|)^{\mathcal {O}(tw)}\) to the overall running time of the algorithm if the given instance is a Connected Flow instance, and only \(M^{\mathcal {O}(tw)}\) if the given instance is an MVTSP instance (in which all vertices are demand vertices).

We argue that we may assume that \(M=|V(G)|^{\mathcal {O}(1)}\). Together with the fact that the number of possibilities for \(\pi \) is \(tw^{\mathcal {O}(tw)}\leqslant |V(G)|^{\mathcal {O}(tw)}\), the claimed result for Connected Flow follows. We support this assumption using a variation on the proof of Theorem 3.4 from Kowalik et al. [10]. Let r be some optimal solution to Flow, then by applying Lemma 1 with T being some subtree of \(G_s\) spanning all demand vertices, we find that there is some optimal solution s of Connected Flow such that \(|r(u,v) - s(u,v)| \leqslant 2n\) at every edge (uv).

We now construct a flow f from r by subtracting simple directed cycles from r. Note that each time that we subtract such a cycle, the result is again a flow. We start with \(f = r\) everywhere. Now if there is an edge \((u,v) \in E\) for which \(f(u,v) > \max \{ r(u,v) - 2n - 1, 0 \}\), we can find a simple directed cycle \(C \in G_f\), containing (uv), as f is a flow and thus \(G_f\) is Eulerian. Then define \(f'(u,v) = f(u,v) - [(u,v) \in C]\). Note that \(f'\) is again a flow. Set \(f = f'\). We then repeat this process of subtracting simple directed cycles from f until \(f(u,v) \leqslant \max \{ r(u,v) - 2n - 1, 0 \}\) for every edge (uv).

Note that \(0\leqslant s(u,v)-f(u,v)\) for all \((u,v)\in E\). Then define the instance with \(\mathsf {dem}'(v) = \mathsf {dem}(v) - \sum _{u \in V} f(u,v)\) and \(\mathsf {cap}'(u,v) = \mathsf {cap}(u,v) - f(u,v)\) for which \(s(u,v) - f(u,v)\) is an optimal connected flow. If \(\mathsf {dem}'(v) \leqslant 2n^2 + n\) we are done. Otherwise let \(r'\) be a relaxed solution for the new instance. Note that there is some edge \((u',v')\) for which \(r'(u',v') > 2n + 1\) and thus we can repeat the previous argument to find a non-zero flow \(f'\) such that \(f'(u,v) \leqslant \max \{ r'(u,v) - 2n - 1, 0 \}\) on every edge and define a corresponding new instance. Since each time we subtract a non-zero flow, after some number of repetitions we find \(\mathsf {dem}'(v) \leqslant 2n^2 + n\).

For the result for MVTSP, the above approach would give a running time of \(\min \{|V(G)|, M\}^{\mathcal {O}(tw)}tw^{\mathcal {O}(tw)}|V(G)|^{O(1)}\). However, the factor \(tw^{\mathcal {O}(tw)}\) in the running time needed to keep track of all partitions \(\pi \) can be reduced to \(2^{\mathcal {O}(tw)}\) via a standard application of the rank based approach (see e.g. [5, Section 11.2.2] or [2, 6]).    \(\square \)

1.2 C.2 Lower Bound

We now present a modified version of a reduction from 3-CNF-SAT to Hamiltonian Cycle parameterized by pathwidth from Cygan et al. [6]. We modify it to be a reduction to MVTSP instead.

We will produce an instance of MVTSP that is symmetric in the sense that the graph G is undirected, hence we denote edges as unordered pairs of vertices (i.e. \(\{u,v\} = \{v,u\}\)). As a consequence, when c is a tour on G, then we say \(c(u,v) = c(v,u)\). The general proof strategy is as follows. For a given 3-CNF-SAT formula \(\phi \) on n variablesFootnote 3 we will construct an equivalent MVTSP instance (Gd). This graph will consist of n/s paths, for some value s, with each path propagating some information encoding the value of s variables of \(\phi \). For each clause of \(\phi \) we will add a gadget which checks if the assignment satisfies the clause. We then bound the size and the pathwidth of the constructed graph G. This allows us to conclude a lower bound based on this reduction.

Gadgets. We start by borrowing the following gadget from Cygan et al. [6], called a 2-label gadget (Fig. 2).

Fig. 2.
figure 2

A 2-label gadget.

The key feature of this gadget is that if all vertices in the gadget have demand equal to 1, then if a solution tour enters the gadget at \(v_3\), it has to leave the gadget at \(v_9\) and vice versa. A similar relation holds for \(v_1\) and \(v_7\). We will refer to any edge connected to either \(v_1\) or \(v_7\) as having label 1 and any edge connected to \(v_3\) or \(v_9\) as having label 2. We will use this gadget to construct a gadget that can detect certain multisets of edges in a part of a graph. In this construction we will chain 2-label gadgets together using label 1 edges. Whenever we do this, we always connect the vertex \(v_7\) of one gadget to the vertex \(v_1\) in the next. To keep things concise, in the rest of this section we will refer to any 2-label gadget as if it were a single vertex.

This next gadget is also inspired by a construction from Cygan et al. [6].

Definition 2

A scanner gadget in an unweighted MVTSP instance (Gd) is described by a tuple \((X,a,b,\mathcal {F})\), where \(X\subseteq V\), \(a,b \in V {\setminus } X\) with \(\mathsf {dem}(a) = \mathsf {dem}(b) = 1\), \(\mathcal {F}\) is a family of multisets of edges inFootnote 4 E(XX) and \(\emptyset \notin \mathcal {F}\). A tour c of G is consistent with \((X,a,b,\mathcal {F})\) if its restriction \(c_{E(X,X)}\) is in \(\mathcal {F}\) and if \(c(a,b) > 0\).

When refering to the gadget as a subgraph, we will use \(G_\mathcal {F}\). We implement the scanner gadget using the following construction, obtaining a different instance \((G', \mathsf {dem}')\) of MVTSP.

  • Remove the edges in E(XX).

  • Add an independent set \(I = \{ s_1, \dots , s_\ell \}\) and edges \(\{ a, s_1 \}\) and \(\{ s_\ell , b \}\), for \(\ell = |\mathcal {F}|\).

  • Let \(\mathcal {F} = \{ F_1, \dots , F_\ell \}\). For \(i = 1, \dots , \ell \) we do the following.

    • Let \(F_i = \{e_1^{q_1}, \dots , e_z^{q_z}\}\), that is \(F_i\) contains \(q_i\) copies of \(e_i\).

    • Add a path \(P_i = \{p_i^{1}, \dots , p_i^{t_i}\}\) of 2-label gadgets, where \(t_i = |F_i| = \sum _{i=j}^z q_j\). We connect the gadgets in a chain using label 1 edges.

    • Connect \(p_i^1\) to \(s_{i-1}\) and \(s_i\) using label 1 edges (green edges in Fig. 3) and connect \(p_i^{|F_i|}\) to \(s_i\) and \(s_{i+1}\) using label 1 edges (blue edges in Fig. 3).

    • For all \(j = 1, \dots , z\) add label 2 edges from x \(p_i^{j'}\) and from y to \(p_i^{j'}\) for \(e_j = \{ x, y \}\) and for \(q_j\) different, previously unused values of \(j'\) (red edges in Fig. 3).

  • We set the demand of all added vertices to 1.

Fig. 3.
figure 3

Example of the scanner gadget.

The function of the gadget is captured by the following lemma.

Lemma 3

There exists an tour on \((G, \mathsf {dem})\) that is consistent with \((X,a,b,\mathcal {F})\) if and only if there exists a tour on \((G', \mathsf {dem}')\).

The proof will closely follow that in Cygan et al. [6].

Proof

Suppose we have a tour on \((G,\mathsf {dem})\) which is consistent with a gadget \((X, a, b, \mathcal {F})\). Let \(F_i \in \mathcal {F}\) be the restriction of the tour on E(XX). Then the tour on \((G, \mathsf {dem})\) can be extended to a tour on \((G', \mathsf {dem}')\) by replacing the \(q_j\) instances of an edge \(\{u,v\} \in F_i\) with two edges \(\{u,p_i^{j'}\}\) and \(\{v,p_i^{j'}\}\) for \(q_j\) different values of \(j'\). We also replace the edge \(\{a,b\}\) by the path

$$ a, s_1, P_1, \dots ,P_{i-1}, s_i, P_{i+1}, s_{i+1}, \dots , P_\ell , s_\ell , b. $$

Since the obtained tour visits all vertices in the gadget exactly once and since the restriction of the adjusted tour connects the same pairs of vertices in X as the restriction of the original tour, the obtained tour will be a solution for the instance \((G',\mathsf {dem}')\).

For the other direction, suppose we have a tour \(c'\) on \((G', \mathsf {dem}')\). Note that by the nature of the 2-label gadgets any tour cannot cross from some \(s_i\) into X through one of the 2-label gadgets in one of the paths \(P_i\). Thus the tour can only travel from outside the gadget to \(s_i\), by going through a or b. Therefore the tour must include the edges \(\{a,s_1\}\) and \(\{s_\ell ,b\}\). Furthermore \(s_1\) and \(s_\ell \) must be connected by some path \(P'\) in the tour. Because I is an independent set, \(P'\) has to jump back and forth between the \(P_i\)’s and the \(s_i\)’s and has to include every \(s_i\), since this is the only way to reach a vertex \(s_i\) with a tour.

This means that there will be exactly one path \(P_{i_0}\) which is not covered by \(P'\). We can now obtain a tour c of \((G, \mathsf {dem})\) by first setting \(c(u,v) = c'(u,v)\) for \(\{u,v\} \ne \{a,b\}\) for u or v not in X. We then include any edge in X a number of times according to its multiplicity in \(F_{i_0}\) i.e. we set \(c(u,v) = F_{i_0}(u,v)\). Finally we set \(c(a,b) = 1\). Note that since \(c(a,b) >0\) and \(F_{i_0} \in \mathcal {F}\), we find that c is consistent with \((X,a,b,\mathcal {F})\).    \(\square \)

The following lemma will allow us to implement the gadget without increasing the pathwidth of the graph too much.

Lemma 4

The scanner gadget has pathwidth at most \(|X| + 21\).

Proof

We define the bags of the decomposition as follows

$$\begin{aligned} B_a&:= X \cup \{a, s_1\} \\ B_{i,j}&:= X \cup \{s_{i-1}, s_i, s_{i+1}, p_i^j, p_i^{j+1}\}\\ B_b&:= X \cup \{b, s_\ell \}. \end{aligned}$$

We now have the following path decomposition of \(G_\mathcal {F}\)

$$ B_a,B_{1,1},B_{1,2},\dots B_{1,t_1},B_{2,1}, \dots B_{\ell ,t_\ell },B_b. $$

It is easy to check that every vertex/edge is covered by some bag and that for every vertex v the set of bags containing v form an interval in the decomposition.    \(\square \)

Construction. Suppose we are given a 3-CNF-SAT formula \(\phi = C_1 \wedge \dots \wedge C_m\). We will construct an equivalent unweighted MVTSP instance \(\varGamma _\phi \) using scanner gadgets. We will interpret a tuple \((q, j) \in \{1, \dots , 2^s\} \times \{1, \dots , n/s\}\) as an assignment of \(x_{(j-1)s + 1}, \dots , x_{js}\) by first decomposing

$$ q - 1 = \sum \limits _{i = 1} ^s c_i 2^{i-1} $$

and setting \(x_{(j-1)s + i}\) as true if \(c_i = 1\) and false if \(c_i = 0\). We say a clause C is satisfied by a set Q of such tuples, if \(j \ne j'\) for all \((q,j), (q,j') \in Q\), and if the partial assignment collectively given by the tuples satisfies C (Fig. 4).

Fig. 4.
figure 4

Construction of the graph \(\varGamma _\phi \).

  • We start by creating vertices \(l_{i,1}, \dots , l_{i, n/s}\) and \(r_{i,1}, \dots , r_{i, n/s}\) for \(i = 1, \dots , m\) and some constant s to be determined laterFootnote 5.

  • We set the demand of \(l_{1,j}\) to \(2^s + 1\) for \(j = 1, \dots , n/s\) and add edges \(\{l_{1,j}, l_{1,j+1} \}\) for \(j = 1, \dots , n/s - 1\).

  • We set the demand of every other \(l_{i,j}\) and every \(r_{i,j}\) to \(2^s\) and add edges \(\{ l_{i,j}, r_{i,j} \}\), \(\{ r_{i,j}, l_{i+1,j} \}\) and \(\{r_{m,j}, l_{1,j} \}\) for \(i = 1, \dots , m-1\) and \(j = 1, \dots , n/s\).

  • We connect \(l_{1,1}\) to \(l_{1,n/s}\) using a path \(a_1, \dots , a_{m+1}\).

  • For \(i = 1, \dots , m\) let \(x_a, x_b, x_c\) be the variables appearing in \(C_i\). We set \(j_1 = \lceil a/s \rceil , j_2 = \lceil b/s \rceil , j_3 = \lceil c/s \rceil \). Let

    $$ X = \{l_{i,j_1}, l_{i,j_2}, l_{i,j_3}, r_{i,j_1}, r_{i,j_2}, r_{i,j_3}\} $$

    and let \(\mathcal {F}_{C_i}\) be the set of all

    $$ F = \{\{l_{i,j_1},r_{i,j_1}\}^{q_1}, \{l_{i,j_2},r_{i,j_2}\}^{q_2}, \{l_{i,j_3},r_{i,j_3}\}^{q_3}, \} $$

    such that \(Q = \{ (q_1, j_1), (q_2, j_2), (q_3, j_3) \}\) satisfies \(C_i\).

  • For \(i = 1, \dots , m\) we implement a scanner gadget \(G_{C_i}\) using the tuple \((X_i, a_i, a_{i+1}, \mathcal {F}_{C_i})\)

We prove the following useful facts about this graph.

Lemma 5

\(\varGamma _\phi \) is a yes instance of MVTSP if and only if \(\phi \) has a satisfying assignment.

Proof

Let \(x_1, \dots , x_n\) be the variables used in the formula \(\phi \). Let \(\chi _1, \dots , \chi _n\) be some satisfying assignment. We first define the tour on the construction before implementing the scanner gadgets, which we will refer to as \(\varGamma _\phi '\), and then use Lemma 3 to find the desired tour on \(\varGamma _\phi \). Set \(c(l_{i,j}, l_{i+1,j}) = c(l_{1,1}, a_1) = c(a_{m+1}, l_{1,n/s}) = c(a_i, a_{i+1}) = 1\). We choose

$$ c'(l_{i,j}, r_{i,j}) = 1 + \sum \limits _{k=1}^{s} 2^{k-1} \chi _{(j-1)s + k} $$

for \(i = 1, \dots , m\) and \(j = 1, \dots , n/s\). Due to the chosen demands we need to choose

$$ c'(r_{i,j}, l_{i+1,j}) = 2^{s+1} - c'(l_{i,j}, r_{i,j}) $$

for \(i = 1, \dots , m\) and \(j = 1, \dots , n/s\), where we interpret i modulo m, i.e. \(m + 1 \equiv 1\). Note that \(c'\) is connected and satisfies the demands on \(\varGamma _\phi '\). Also note that since \(\chi \) is a satisfying assignment, \(c'\) is consistent with all the scanner gadgets \(G_{C_i}\) and thus by Lemma 3 we there is some valid tour c on \(\varGamma _\phi \).

Now suppose we find a valid tour c on \(\varGamma _\phi \). Then by Lemma 3 there exists a tour \(c'\) on \(\varGamma _\phi '\) consistent with each gadget \(G_{C_i}\). By definition of \(G_{C_i}\) the values of \(c'(l_{i,j}, r_{i,j})\) encode an assignment satisfying \(C_i\) for \(i = 1, \dots , m\). Since for \(i \geqslant 2\) the demands of \(l_{i,j}\) and \(r_{i,j}\) equal \(2^s\) we have that \(c'(l_{i,j}, r_{i,j}) = 2^{s+1} - c'(r_{i,j}, l_{i+1, j}) = c'(l_{i+1,j}, r_{i+1,j})\) and therefore the values of \(c'(l_{1,j}, r_{1,j})\) encode an assignment satisfying all clauses \(C_1,\ldots ,C_m\), which means we find an assignment which satisfies \(\phi \).    \(\square \)

Lemma 6

\(\varGamma _\phi \) has pathwidth at most \(3n/s + 21\).

Proof

We define the bags of the decomposition as follows. First we add

$$ A = \{ l_{1,1}, \dots , l_{1, n/s} \} $$

to every bag. Let \(W_1, \dots , W_{l_i}\) be a path decomposition of \(G_{C_i}\). We define bag \(X_{i,j}\) as follows

$$ X_{i,j} = A \cup \{l_{i,k}\}_{k=1}^{n/s} \cup \{r_{i,k}\}_{k=1}^{n/s} \cup W_j. $$

We then define \(Y_i\) as \(\{l_{i+1,k}\}_{k=1}^{n/s} \cup \{r_{i,k}\}_{k=1}^{n/s}\) The final path decomposition then becomes

$$ X_{1,1}, \dots , X_{1,l_1}, Y_1, X_{2,1}, \dots , X_{i,l_i},Y_i, X_{i+1,1}, \dots , X_{m,l_m}. $$

Note that all vertices and edges are covered by the decomposition. The set of bags containing any of the vertices of A gives the whole decomposition. The set of bags containing any \(l_{i,j}\) or \(r_{i,j}\) for \(i \geqslant 2\) gives the path \(X_{i,1} \dots X_{i,l_1}\) with \(Y_i\) at the end for \(r_{i,j}\) and \(Y_{i-1}\) at the beginning for \(l_{i,j}\). Any vertex in the gadgets gives a single set \(X_{i,j}\). By Lemma 4 the width of this path decomposition is at mostFootnote 6

$$ 3\frac{n}{s} + 21. $$

   \(\square \)

Now we use our reduction to prove the following lower bound:

Theorem 5. Let M be an upper bound on the demands in a graph G. Then MVTSP cannot be solved in time \(f(pw)\min \{|V(G)|,M\}^{o(pw)}|V(G)|^{\mathcal {O}(1)}\), unless ETH fails.

Proof

We start by proving the following claim.

Claim 6

\(|V(G_{C_i})| = \mathcal {O}(2^{3s})\) for \(i = 1, \dots , m\).

Proof of Claim. Note that \(\mathcal {F}_{C_i}\) is defined on at most three unique edges with each edge being chosen at most \(2^s\) timesFootnote 7. Therefore we can represent \(\mathcal {F}_{C_i}\) by tuples \((z_1, z_2, z_3) \in [2^s]^3\). Since each tuple contributes a path of \(z_1 + z_2 + z_3\) vertices, we find that

$$\begin{aligned} |V(G_{C_i})|&= 8 + |\mathcal {F}_{C_i}| + \sum \limits _{(z_1, z_2, z_3) \in \mathcal {F}_{C_i}} z_1 + z_2 + z_3 \\&\leqslant 2^{3s + 1} + \sum \limits _{z_1, z_2 = 1}^{2^s} \left( 2^s (z_1 + z_2) + \sum \limits _{z_3 = 1}^{2^s} z_3 \right) \\&\leqslant 2^{3s + 1} + \sum \limits _{z_1, z_2 = 1}^{2^s} \left( 2^s (z_1 + z_2) + 2^{s+1} \right) \\&\leqslant 2^{3s + 1} + \sum \limits _{z_1 = 1}^{2^s} \left( 2^{2s} z_1 + 2^{2s+1} + 2^{2s + 1} \right) \\&\leqslant 2^{3s+3}. \end{aligned}$$

   \(\blacksquare \)

Note that by Lemma 5, solving a 3-CNF-SAT instance \(\phi \) reduces to solving MVTSP on \(\varGamma _\phi \) for some choice of s. We remark that

$$\begin{aligned} \mathcal {O}(f(pw)\min \{|V(G)|,M\}^{o(pw)}|V(G)|^{\mathcal {O}(1)}) \leqslant \mathcal {O}(f(pw)M^{o(pw)}|V(G)|^{\mathcal {O}(1)}). \end{aligned}$$

It is therefore sufficient to show that there is no \(\mathcal {O}(f(pw) M^{o(pw)} |V(G)|^{\mathcal {O}(1)})\) time algorithm for MVTSP, unless ETH fails.

Suppose we have a \(\mathcal {O}\left( f(pw) M^{o(pw)} |V(G)|^{\mathcal {O}(1)}\right) \) time algorithm for MVTSP. Let \(s = 4n/g(n)\) for some strictly increasing function \(g(n) = 2^{o(n)}\) such that \(f(g(n)) = 2^{o(n)}\). Note that \(s = o(n)\) and \(pw\leqslant g(n)\) for large enough n. We construct the instance \(\varGamma _\phi \) as previously described. We first note that by Claim 6

$$ |V(\varGamma _\phi )| = 2m\frac{n}{s} + \sum _{i=1}^m |V(G_{C_i})| = \mathcal {O}\left( m\left( \frac{n}{s} + 2^{3s}\right) \right) $$

and by Lemma 6 we have that for any choice of s and large enough n, \(\varGamma _\phi \) has pathwidth at most 4n/s. By applying our hypothetical algorithm for MVTSP to \(\varGamma _\phi \) we now find an algorithm for 3-CNF-SAT running in time

$$\begin{aligned} \mathcal {O}\left( f(pw) M^{o(pw)} |V(\varGamma _\phi )|^{\mathcal {O}(1)} \right)&= \mathcal {O}\left( f(4n/s) (2^s)^{o(n/s)} \left( m \left( \frac{n}{s} + 2^{3s}\right) \right) ^{\mathcal {O}(1)} \right) \\&= \mathcal {O}\left( f(g(n)) \cdot 2^{o(n)} \cdot \left( m \left( g(n)/4 + 2^{o(n)} \right) \right) ^{\mathcal {O}(1)} \right) . \end{aligned}$$

We may assume that \(m = 2^{o(n)}\) by the sparsification lemma. Using this and the fact that \(g(n) = 2^{o(n)}\) we find

$$\begin{aligned}&= \mathcal {O}\left( 2^{o(n)} \cdot \left( 2^{o(n)} \right) ^{\mathcal {O}(1)} \right) \\&= \mathcal {O}\left( 2^{o(n)}\right) . \end{aligned}$$

This contradicts ETH, completing our proof.    \(\square \)

D Proofs Deferred to Appendix

1.1 D.1 Proofs of Claims from Subsection 2.1

Claim 1. For any \(v\in V\) and any inclusion-wise minimal \(C\in \mathcal {C}\):

figure e

Proof

We only prove the first inequality. The second inequality can be proved with an analogous argumentation. Assume not, i.e. assume there exists \(C\in \mathcal {C}\) and \(v\in V\) such that there exist \(x_1,x_2,x_3 \in V\) with \((x_i, v) \in C\) for \(i=1,2,3\). Each of these edges must be either in \(A_s\) or \(A_r\). Assume without loss of generality that \((x_1,v),(x_2,v) \in A_s\). (We will only need the fact that at least two of these edges are either both in \(A_r\) or both in \(A_s\). The case of at least two edges in \(A_r\) has equivalent reasoning.) Both \((x_1,v)\) and \((x_2,v)\) can be paired with the edge it traverses v with, i.e. its subsequent edge in the tour, as \((x_1,v),(x_2,v) \in A_s\) are positively oriented. Let \(e_1, e_2\) be these subsequent edges. Then note that C can be split into two smaller \((s-r)\) directed tours \(C_1\) and \(C_2\), with \(C_1\) starting with edge \(e_1\) and ending with \((x_2,v)\), and \(C_2\) starting with edge \(e_2\) and ending with \((x_1,v)\). This contradicts the assumption that C was inclusion-wise minimal.    \(\square \)

Claim 2. For all \(e\in T\), \(f(e)>0\) and f is a flow for the given instance.

Proof

We first show that for all \(e \in E\):

$$\begin{aligned} \min \{r(e),s(e)\} \leqslant f(e) \leqslant \max \{r(e),s(e)\} . \end{aligned}$$

If \(e \not \in A\), Eq. (2) implies that \(r(e) = f(e) = s(e)\). If \(e \in A_s\), by definition \(r(e)<s(e)\) and we can see from (2) that if the multiplicity of e changes, it is because copies of e are added to r to form f (and none are removed). Because \(m_A(e) \leqslant s(e) - r(e)\), at most this many copies of e can be added to r to form f. Hence \(r(e) \leqslant f(e) \leqslant r(e) + (s(e)-r(e)) = s(e)\). Similarly, if \(e \in A_r\), \(r(e) > s(e)\) and at most \(r(e) - s(e)\) copies of e are removed from r to form f.

Next we prove that f is an allowed solution to the given Flow instance. Let \(C \in \mathcal {C}^+\) and let \(e,e'\) be two subsequent edges from C with common vertex v. If \(e \in A_s\) and \(e' \in A_r\), then the in- and out-degrees of v do not change while adding a copy of e and removing a copy of \(e'\) (in Eq. (2)), because the orientation of e and \(e'\) is different. This is also true if \(e\in A_r\) and \(e' \in A_s\). If \(e, e' \in A_r\), then both e and \(e'\) have a copy removed in Eq. (2). Since the orientation of e and \(e'\) is the same, both the in- and out-degree of v go down by one. We remark that this situation only happens if \(v \not \in D\) by definition of \((s-r)\) directed tours. Similarly, if \(e, e' \in A_s\), the in- and out-degree of v increases by one. Since r was an allowed solution, this implies that the number of incoming- and outgoing edges of v in f are equal, in other words, the flow is preserved. Since for \(v \in D\), the total incoming (and total outgoing) edges do not change, the demands are satisfied by f. Furthermore, the capacity constraints are satisfied since \( f(e) \leqslant \max \{r(e),s(e)\} \leqslant \mathsf {cap}(e)\).

We show that \(T\subseteq {{\,\mathrm{supp}\,}}(f)\). Let \(e \in T^+\), then \(e \in A_s\) so copies of e are added to r to form f in Eq. (2). Since \(e \in T^+\), at least one tour \(C \in \mathcal {C}^+\) contains e. Hence, \(f(e)>0\). If \(e \in T {\setminus } T^+\), then \(r(e)>0\) because \(T^+ = T {\setminus } {{\,\mathrm{supp}\,}}(r)\) by definition. We also see that \(s(e)>0\) because \(T\subseteq {{\,\mathrm{supp}\,}}(s)\) by assumption. Using our earlier result that \(\min \{r(e),s(e)\} \leqslant f(e) \), we conclude that \(f(e)>0\).    \(\square \)

1.2 D.2 Proof of Claim 3 from Subsection 2.2

Claim 3. Each table entry \(T_j(\pi ,\mathbf {c}^{\mathsf {in}},\mathbf {c}^{\mathsf {out}})\) can be computed from all table entries \(T_{j-1}\).

Proof

Compute table entries for \(j=0\) as follows. Set \(T_0(\{\{x_1,\},\dots ,\{x_{k'}\}\},\mathbf {0},\mathbf {0})\) to 0, and all other entries of \(T_0\) to \(\infty \), as \(V_0 = X'\) is an independent set and so a flow of zero on every edge is the only possible flow.

Now assume \(j> 0\). We compute the values of \(T_{j}(\pi ,\mathbf {c}^{\mathsf {in}},\mathbf {c}^{\mathsf {out}})\) as the minimum of the following value over all suitable \(\mathbf {h}^{\mathsf {in}}_i = (h^{\mathsf {in}}_1,\dots ,h^{\mathsf {in}}_{k'}) \in \mathbb {N}^{k'}\), \(\mathbf {h}^{\mathsf {out}}_i = (h^{\mathsf {out}}_1,\dots ,h^{\mathsf {out}}_{k'}) \in \mathbb {N}^{k'}\), and all suitable partitions \(\pi '\) of \(X'\):

$$T_{j-1}(\pi ',\mathbf {c}^{\mathsf {in}}-\mathbf {h}^{\mathsf {in}},\mathbf {c}^{\mathsf {out}}-\mathbf {h}^{\mathsf {out}}) + \sum _{i=1}^{k'} \left( h^{\mathsf {in}}_i \cdot \mathsf {cost}(b_{j},x_i) + h^{\mathsf {out}}_i\cdot \mathsf {cost}(x_i,b_{j})\right) . $$

Here we interpret \(h^{\mathsf {in}}_i\) as the multiplicity of the edge \((b_j,x_i)\) and \(h^{\mathsf {out}}_i\) as the multiplicity of the edge \((x_i,b_j)\). Therefore, we require \(h^{\mathsf {in}}_i \leqslant \mathsf {cap}(b_j,x_i)\) and \(h^{\mathsf {out}}_i \leqslant \mathsf {cap}(x_i,b_j)\) so that the capacity constraints hold. Furthermore, we require that the solution is flow preserving in \(b_j\), i.e. \(\sum _{i =1}^{k'} h^{\mathsf {in}}_i = \sum _{i =1}^{k'} h^{\mathsf {out}}_i\) and \(\sum _{i =1}^{k'} h^{\mathsf {in}}_i = \mathsf {dem}(b_j)\) if \(b_j \in D\). For \(\pi '\) we require for all \(S\in \pi \) that either \(S \in \pi '\) or there exist \(S'_1, \dots S'_\ell \in \pi '\) such that \(S_1\cup \dots \cup S_\ell = S\) and \(S'_1,\dots ,S'_\ell \) are all connected to \(b_j\). This latter can be formalized by requiring that for each \(t\in [1,\ell ]\), there is an \(x_i\in S'_t\) such that \(h^{\mathsf {in}}_i + h^{\mathsf {out}}_i >0\).

Notice that with this recurrence, the table entries are computed correctly as only the vertex \(b_j\) was added, compared to the table entries \(T_{j-1}\). Therefore we may assume that only the edges incident to \(b_j\) were added to another solution for some table entry in \(T_{j-1}\).    \(\square \)

1.3 D.3 Proofs of Claims from Subsection 2.3

Claim 4. We may assume that for both \(\overrightarrow{F}\) and \(\overleftarrow{F}\), their underlying undirected edge sets do not contain cycles.

Proof

We change r such that for both \(\overrightarrow{F}\) and \(\overleftarrow{F}\), their underlying undirected edge sets do not contain cycles. Assume that there is an alternating cycle \(C \subseteq \overleftarrow{F}\), meaning that its underlying edge set is a cycle and (hence) the edges alternate between being in positive and negative orientation. We can then create solutions \(r'\) and \(r''\) of Flow by alternatingly adding and removing edges from C. Note that we can start by either adding or removing, giving us these two different solutions \(r'\) and \(r''\). Since the edges added to r to form \(r'\) are exactly the edges that were removed from r to form \(r''\), and vice versa, it holds that \(\mathsf {cost}(r)-\mathsf {cost}(r') = -(\mathsf {cost}(r)-\mathsf {cost}(r''))\). Since r is an optimal solution, we conclude \(\mathsf {cost}(r)=\mathsf {cost}(r')=\mathsf {cost}(r'')\). We can therefore choose either \(r'\) or \(r''\) to replace r, such that \(\overleftarrow{F}\) now has one alternating cycle less without changing any of the edges of r outside C. Hence we can iteratively remove the cycles from \(\overleftarrow{F}\) and \(\overrightarrow{F}\) and obtain an optimal solution r to the Flow instance in which both \(\overleftarrow{F}\) and \(\overrightarrow{F}\) are forests in polynomial time.    \(\square \)

Claim 5. There exists an optimal solution \(f'\) of the MVTSP instance such that for all \(i,j \in [1,k]\), \(b \in R_{ij}\) and \(x_\ell \in X\) it holds that \(r(x_\ell ,b) = f'(x_\ell ,b)\) and \(r(b,x_\ell ) = f'(b,x_\ell )\).

Proof

We build this \(f'\) iteratively from f, by removing any edges \((x_{i'},b)\) and \((b,x_{j'})\) for \(i' \ne i\) and \(j' \ne j\) for each \(b \in R_{ij}\). In particular, this implies that \(r(x_i,b) = f'(x_i,b)\) and \(r(b,x_j) = f'(b,x_j)\), as b then only has edges coming from \(x_i\) and to \(x_j\) and since b has a fixed demand.

Throughout the process we retain optimality and connectivity for \(f'\). Furthermore, after each step, the solutions r and \(f'\) differ at at most \(8k^2\) edges. We start by setting \(f' =f\).

Let us consider \(b \in R_{ij}\) and suppose that \(f'(x_\ell ,b) >0\) for some \(\ell \not = i\). Note that we can tackle the case where \(f'(b,x_\ell )>0\) for some \(\ell \ne j\) with similar steps. We remark that \(|\overrightarrow{A_{ij}}(\ell )| = 8k^2 +2\) as \(R_{ij} \not = \emptyset \). As at most \(8k^2\) edges are different between r and \(f'\), there are vertices \(v,w \in \overrightarrow{A_{ij}}(\ell )\) such that all of the edges adjacent to v and w have the same multiplicities in r and \(f'\), i.e. \(f'(x,v) = r(x,v)\) and \(f'(x,w) = r(x,w)\) for all \(x\in X\).

Define flow \(f''\) with at most the same costs as \(f'\) by removing one copy of the edges \((x_\ell ,b)\) and \((x_i,v)\) and adding one copy of the edges \((x_i,b)\) and \((x_\ell ,v)\), see Fig. 5. As \(b \not \in \overrightarrow{A_{ij}}(\ell )\) and \(v \in \overrightarrow{A_{ij}}(\ell )\), the cost of \(f''\) is indeed at most the cost of \(f'\) by definition of the set \(\overrightarrow{A_{ij}}(\ell )\).

We now argue that \(f''\) is connected. As \(f'\) is a solution to MVTSP, it must be connected. Since we removed \((x_\ell ,b)\) and \((x_i,v)\) from \(f'\) to form \(f''\), proving that the pairs \(x_\ell ,b\) and \(x_i,v\) are connected in \(f''\) proves \(f''\) to be connected. The edges \((x_i,w)\), \((w,x_j)\) and \((v,x_j)\) in \(f''\) connect \(x_i\) and v. As a consequence, \(x_\ell \) and b are also connected, because of the edges \((x_\ell ,v)\) and \((x_i,b)\).

We remark that the number of edges that differ between \(f''\) and r has not changed. Hence, we continue with setting \(f' = f''\) and repeat until \(f'\) has the required properties.    \(\square \)

Fig. 5.
figure 5

Adjusting flow \(f'\), depicted on the left, to get flow \(f''\), depicted on the right. The blue edges are replaced by the red edges, the rest of the solutions are equal. The vertex w assures the new solution remains connected

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Mannens, I., Nederlof, J., Swennenhuis, C., Szilágyi, K. (2021). On the Parameterized Complexity of the Connected Flow and Many Visits TSP Problem. In: Kowalik, Ł., Pilipczuk, M., Rzążewski, P. (eds) Graph-Theoretic Concepts in Computer Science. WG 2021. Lecture Notes in Computer Science(), vol 12911. Springer, Cham. https://doi.org/10.1007/978-3-030-86838-3_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-86838-3_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-86837-6

  • Online ISBN: 978-3-030-86838-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics