I am thinking an algorithm to solve the problem below:
A given graph composed of vertices and edges.
There are N customers who want to travel from a vertex to another vertex. And each customer requirement need a directed edge to connect two vertices.
The problem is how to find the minimum number of edges to satisfy all customers requirements ?
There is a simple example:
- Customer 1 wants to travel from vertex a to vertex b.
- Customer 2 wants to travel from vertex b to vertex c.
- Customer 3 wants to travel from vertex a to vertex c.
The simplest way is to give an edge for each customers:
- edge 1: vertex a -> vertex b
- edge 2: vertex b -> vertex c
- edge 3: vertex a -> vertex c
But actually there only needs 2 edges (i.e. edge 1 and edge 2) to satisfy three customer requirements.
If the number customers is large, how to find the minimum edges to satisfy all customer requirements ?
Is there a algorithm to solve this problem ?