a b s t r a c tMorse theory is a fundamental tool for analyzing the geometry and topology of smooth manifolds. This tool was translated by Forman to discrete structures such as cell complexes, by using discrete Morse functions or equivalently gradient vector fields. Once a discrete gradient vector field has been defined on a finite cell complex, information about its homology can be directly deduced from it. In this paper we introduce the foundations of a homology-based heuristic for finding optimal discrete gradient vector fields on a general finite cell complex K. The method is based on a computational homological algebra representation (called homological spanning forest or HSF, for short) that is an useful framework to design fast and efficient algorithms for computing advanced algebraic-topological information (classification of cycles, cohomology algebra, homology A(1)-coalgebra, cohomology operations, homotopy groups, . . .). Our approach is to consider the optimality problem as a homology computation process for a chain complex endowed with an extra chain homotopy operator.