Shortest super-path to complete multiple paths to vertices.

35 Views Asked by At

I have a graph with multiple vertices. Let's say all vertices are connected to each other, and all edges are equal weight.

I have multiple directed paths I have to take across this graph, but I want to minimize the total number of edges I have to traverse to complete all these directed paths.

For example:
Path 1: A -> B -> C -> B
Path 2: B -> A -> C
Shortest super-path: A -> B -> A -> C -> B

How can I develop an algorithm for finding the shortest super-path?

I have considered using a Shortest Superstring algorithm, but the problem is that the vertices don't have to be strictly tangential (Shortest Superstring for the above would be ABCBAC).

This is a common problem in logistics for deliveries as well as board and video games with many multi-step quests.