Nonlinear Fokker-Planck equation: stability, distance and the corresponding extremal problem in the spatially inhomogeneous case