Quasi-equilibrium grid algorithm: Geometric construction for model reduction