  We present an algorithm for computing the main topological characteristics of
three-dimensional bodies. The algorithm is based on a discretization of Morse
theory and uses discrete analogs of smooth functions with only nondegenerate
(Morse) and the simplest degenerate critical points.
