  Integer variables allow the treatment of some portfolio optimization problems
in a more realistic way and introduce the possibility of adding some natural
features to the model. We propose an algebraic approach to maximize the
expected return under a given admissible level of risk measured by the
covariance matrix. To reach an optimal portfolio it is an essential ingredient
the computation of different test sets (via Gr\"obner basis) of linear
subproblems that are used in a dual search strategy.
