The inverse gravity problem is posed as a linear least-squares problem with the variables being densities of two-dimensional prisms. Upper and lower bounds on the densities are prescribed so that the problem becomes a linearly constrained least-squares problem, which is solved using a quadratic programming algorithm designed for upper and lower bound-type constraints. The solution to any problem is smoothed by damping, using the singular value decomposition of the matrix of gravitational attractions. If the solution is required to be monotonically increasing with depth, then this feature can be incorporated. The method is applied to both field and theoretical data. The results are plotted for (1) undamped, nonmonotonic, (2) damped, nonmonotonic, and (3) damped, monotonic solutions; these conditions illustrate the composite approach of interpretation where both damping techniques and linear constraints are used in refining a solution which at first is unacceptable on geologic grounds while fitting the observed data well.