1

Given an undirected graph and a start and end node, I am trying to find two edge-disjoint paths such that the sum of their lengths is minimized. In particular, each path must start at the start node, end at the end node, and no edge can be traversed by both nodes. Is there an efficient algorithm to solve this problem?

I know that if I just need the shortest path, I can use Dijkstra's algorithm, but finding one path with Dijkstra's algorithm and then searching for another is sometimes not optimal at all, since edges in the first path may have blocked a possible and way shorter path.

I have tried implementing the edge_disjoint_path algorithm from the Python networkx package. But I must say that the result is very varying from okay to really bad. My network is not that big. "Only" 6000 nodes and 7500 edges.

D.W.
  • 167,959
  • 22
  • 232
  • 500

1 Answers1

1

I think it is possible to use Suurballe's algorithm for this case by just replacing every undirected edge with two directed edges in each direction.

This is because Suurballe's algorithm would never choose two paths $P_1, P_2$, s. t. $e_x \in P_1$ and $\overleftarrow{e_x} \in P_2$ ($\overleftarrow{e_x}$ is the opposite edge of $e_x$). The proof is by contradiction:

Assume the two edge-disjoint paths with the shortest length would be $P_1 = e_{i_1}, \dots e_{i_{a-1}}, e_{i_{a}},e_{i_{a+1}} \dots e_{i_k}$ and $P_2 = e_{j_1}, \dots e_{j_{b-1}}, e_{j_{b}},e_{j_{b+1}}, \dots e_{h_l}$ with $e_{i_a} = \overleftarrow{e_{j_b}}$.

But then the two paths $e_{i_1}, \dots e_{i_{a-1}}, e_{j_{b+1}} \dots e_{j_l}$ and $e_{j_1}, \dots e_{j_{b-1}}, e_{i_{a+1}} \dots e_{i_k}$ would obviously be shorter and still edge-disjoint.

Because Suurballe's algorithm is never choosing opposite edges and is correct for the directed case, it works for undirected graphs as well.

SimonNW
  • 161
  • 4