Safety plays an important role in mobile robotics where it is crucial to detect and avoid collisions between objects and robots moving in dynamic environments. Several approaches have been suggested to address the issue. In this paper, we consider a collaborative approach for collision avoidance based on the optimal time to resolve a conflict. First, the collision conditions are derived with an estimation of the time to collision. Then the maneuvers to resolve the conflict in minimum time are calculated using a constrained optimization approach. Lagrangian function is constructed and used under the safety constraints to find the closed from optimal solutions for the safe speeds. A comparison is carried out in terms of the control effort and the time to resolve the conflict. Simulation is used to illustrate the method.