In this paper we extend and unify the results of [Rivin, Ann. of Math. 143 (1996)] and [Rivin, Ann. of Math. 139 (1994)]. As a consequence, the results of [Rivin, Ann. of Math. 143 (1996)] are generalized from the framework of ideal polyhedra in H-3 to that of singular Euclidean structures on surfaces, possibly with an infinite number of singularities (by contrast, the results of [Rivin, Ann. of Math. 143 (1996)] can be viewed as applying to the case of non-singular structures on the disk, with a finite number of distinguished points). This leads to a fairly complete understanding of the moduli space of such Euclidean structures and thus, by the results of [Penner, Comm. Math. Phys. 113 (1987) 299-339; Epstein, Penner, J. Differential Geom. 27 (1988) 67-80; Naatanen, Penner, Bull. London Math. Soc. 6 (1991) 568-574] the author [Rivin, Ann. of Math. 139 (1994); Rivin, in: Lecture Notes in Pure and Appl. Math., Vol. 156, 1994], and others, further insights into the geometry and topology of the Riemann moduli space. The basic objects studied are the canonical Delaunay triangulations associated to the aforementioned Euclidean structures. The basic tools, in addition to the results of [Rivin, Ann. of Math. 139 (1994)] and combinatorial geometry are methods of combinatorial optimization-linear programming and network flow analysis; hence the results mentioned above are not only effective but also efficient. Some applications of these methods to three-dimensional topology are also given (to prove a result of Casson's). (C) 2002 Elsevier Inc. All rights reserved.