This paper is motivated by remarkable results of Mandelbaum, Shepp and
Vanderbei concerning an optimal switching problem for two Brownian mo
tions. In this paper, the discrete form of this problem, in which the
Brownian motions are replaced by random walks, is studied and solved w
ithout any restriction on the boundary data. The method proposed here
involves uncovering the structure of the solution using combinatorial
and geometric arguments, and then providing a characterization for the
two types of possible solutions, as well as explicit formulas for com
puting the solution. The extension of these methods and results to the
continuous time problem will be considered in a subsequent paper.