7

Given an undirected graph $G$ and two vertices $s$ and $t$, i want to find a minimum set of edges $E$ in $G$ such that every (simple) $s$-$t$-path contains at least 2 edges from $E$.
Is this problem solvable in polynomial time? What if the paths should not contain 2, but $r$ edges in $E$?

I know that for $r=1$, this is equivalent to simply finding a minimum $s$-$t$-cut, so maybe the problem can be solved by using MaxFlowMinCut-techniques?

tgnome
  • 153
  • 5

3 Answers3

2

[EDIT: updated to apply to undirected graphs]

Lemma 1. The general problem (with $r$ given as input) is solvable in polynomial time.

Proof. 1. Fix a problem instance $(G=(V, E), s, t)$. For brevity, define an $r$-cut to be any edge subset $C\subseteq E$ such that every $s$-$t$ path contains at least $r$ edges in $C$. The goal is to find a minimum-size $r$-cut. (Note that we use $E$ for the given edge set, and $C$ for the solution, whereas the post uses $E$ for the solution.)

  1. Consider the following linear-program (LP) relaxation of the problem:

$$\begin{aligned} \textsf{minimize } &\textstyle ~\sum_{e\in E} \ell_e~ \textsf{ s.t.}\\ \pi_s &{} = 0 \\ \pi_t &{} \ge r \\ |\pi_w - \pi_u| & {} \le \ell_e \le 1 && (e=\{u,w\} \in E) \end{aligned} $$

  1. Note that the LP is indeed a relaxation of the original problem. Indeed, each solution $C$ to the given instance corresponds to the integer-valued LP solution $(\ell, \pi)$ of cost $|C|$ obtained by setting $\ell_e = 1$ for $e\in C$, and setting each $\pi_v$ to the distance from $s$ to $v$ in the graph where each edge $e$ is assigned length $\ell_e$. Conversely, given any integer-valued feasible LP solution $(\ell, \pi)$, taking $C=\{e \in E : \ell_e = 1\}$ gives a solution $C$ to the given instance, of size $|C|=\sum_{e\in E} \ell_e$.

  2. Now, using any polynomial-time LP algorithm, compute a min-cost (possibly fractional) solution $(\ell, \pi)$ to the LP. Since the LP is a relaxation of the original problem, the cost $\sum_{e\in E} \ell_e$ of $(\ell, \pi)$ is a lower bound on the minimum size of any $r$-cut.

  3. Compute a random integer LP solution $(\ell', \pi')$ and corresponding $r$-cut $C$ from $(\ell, \pi)$ using the following randomized-rounding scheme:

  1. choose $\lambda \in [0, 1)$ uniformly at random
  2. let $\pi'_v = \lfloor \pi_v + \lambda \rfloor$ for each vertex $v\in V$
  3. let $\ell'_e = |\pi'_w - \pi'_u|$ for each edge $e=\{u,w\}\in E$
  4. let $C=\{e\in E: \ell'_e = 1\}$ be the $r$-cut corresponding to $(\ell', \pi')$
  1. First observe that $(\ell', \pi')$ is feasible. In particular, for any edge $\{u, w\}\in E$, we have $$\ell'_e = |\pi'_w - \pi'_u| = |\lfloor \pi_w + \lambda \rfloor - \lfloor \pi_u + \lambda \rfloor| \le 1$$ because $|(\pi_w + \lambda) - (\pi_u + \lambda)| \le \ell_e \le 1$.

  2. Next we bound the expected size of $C$.

  3. Consider any edge $e=\{u,w\}\in E$. We will show $\Pr[e\in C] \le \ell_e$.

  4. Note $|\pi_w - \pi_u| \le \ell_e \le 1$, so $$\Pr[e\in C] = \Pr_\lambda[|\lfloor \pi_w + \lambda \rfloor - \lfloor \pi_u + \lambda \rfloor| = 1] = |\pi_w - \pi_u| \le \ell_e. $$ (The second equality above follows by calculation.)

  5. So $\Pr[e\in C] \le \ell_e$ for all $e\in E$.

  6. Now, using also linearity of expectation, we have $E[|C|] = \sum_{e\in E} \Pr[e\in C] \le \sum_{e\in E} \ell_e$.

  7. That is, the expected size of the $r$-cut $C$ is at most the cost of $(\ell, \pi)$. Since the latter cost is at most OPT (the minimum size of any $r$-cut), it follows that the expected size of $C$ is at most OPT. $~~~~\Box$

BTW, since $|C|$ can't be less than OPT in any outcome, it follows that $C$ must be optimal, for any choice of $\lambda\in [0, 1)$. Essentially, every optimal solution to the LP is a convex combination of optimal integer solutions.

Neal Young
  • 993
  • 6
  • 13
1

Here's an idea, find the min-cut edge set $C$ with respect to the required $s$-$t$. Thus, all $s$-$t$ paths will have exactly one edge from this set $C$. Now collapse all end points of the edges present in $C$ into a single vertex (but do not include the edges as they would create self-loops). It is safe to assume that both $s$ and $t$ have not merged, otherwise, your required set does not exist. Now again, find a min-cut edge set $C'$ on this modified graph. Thus, all $s$-$t$ paths will have one edge from $C$ and another from $C'$. By construction, the set $C \cup C'$ would be minimal (but may not be minimum).

codeR
  • 1,983
  • 7
  • 17
0

Lemma 1: If all $s$-$t$ simple paths go through some edge $(u, v)$ then all of them also go through the nodes $u$ and $v$. Conversely if all if all $s$-$t$ simple paths go through $u$ and $v$ and there is only one path between $u$ and $v$ then all the paths go through the edge $(u, v)$.

Start BFS at $s$ and construct the BFS tree. Let $t \in L_{k}$.
Lemma 2: If there is a layer $L_{i}$ for $i$ < $k$ such that $L_{i} = \{ w \}$ (only have one node) then all $s$-$t$ paths go through $w$.

Outline of the Proof: If we remove the node from the BFS tree, then there are no paths between $s$ and $t$. This is since all non-tree edges in a BFS tree are between nodes of the same or successive layers.

Using Lemma 1 and 2, we can find all pairs of layers $L_{i}$, $L_{i+1}$ such that $|L_{i}| = |L_{i+1}| = 1$ and $i+1 \leq k$ and the set of edges between the pairs of layers, is the set of edges you're looking for.