A MINIMIZATION THEOREM IN QUASI-METRIC SPACES AND ITS APPLICATIONS