Consider a graph with V vertices and n routes (cars). Each path (car) starts from one vertex and traverses the V vertices just one time (there is not any loop in each route).
In each iteration (i.e., time), just one route (car) can be in each of the vertices (no collision between vehicles). If it is not feasible (two cars collide each other), the route (car) sticks in its vertex on that iteration (car wait on that vertex). How can we find the minimum number of cycles in which all of the routes (cars) can traverse the graph?
Example: An example with 5 vertices, and 2 routes
In this example, there are 5 vertices: Blue, Black, Purple, Orange, Green The first route is: Blue, Black, Green, Purple, Orange (Green Line) The second route is: Green, Orange, Black, Purple, Blue (Black Line)
Minimum number of iterations: 5
The 1st route is: Blue, Black, Green, Wait, Purple, Orange (Green Line)
The 2nd route is: Green, Orange, Black, Purple, Blue, Wait (Black Line)
In this example, the first car waits on iteration #4 to prohibit the collision with the second car on the Purple vertex.