An adaptive handover algorithm for wireless communication systems is addressed in this paper. Moving from the Generalized Extended Least Square handover algorithm proposed in [1], we model the handover mechanism as a hybrid system, and we include it in a dynamic optimization problem which is solved through the use of a trellis diagram. The objective function takes into account the parameters that influence the handover mechanism. The optimal solution of the program allows to evaluate performance of the handover in terms of the probability of handover and probability of outage.