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