In this study, a nonlinear programming approach using the successive quadratic programming optimization technique is developed for the optimal design of a pipeline network for water supply systems. The proposed method eliminates the equality constraints describing the hydraulics by a suitable choice of dependent and independent variables. The dependent variables are chosen based on graph theoretic decomposition of the network structure. This makes it possible to compute analytically the reduced constraints, objective function gradients, and reduced Hessian in a very efficient manner. This method of decomposition ensures that the nodal and loop balances are exactly satisfied and is robust for any initial starting point, able to handle incorrect initial flow directions. The method gives solutions comparable to the previous optimal solutions for the design of new as well as expansion of existing water distribution networks. ©ASCE.