Added min all pair's algorithm by Johnson