Skip to content

Solving Geometric Program

An answer to this question on the Mathematics Stack Exchange.

Question

(Use a Calculator) Use geometric programming to solve the following program:

Minimine: $g(x) = \frac{1000}{xy} + 2x + 2y + xy$, $\forall x,y > 0$

I am a little confused on how to begin this program, can anyone give me any tips? Thanks!

Answer

The problem can also be solved numerically using cvxpy's geometric programming capabilities, like so:

#!/usr/bin/env python3
import cvxpy as cp
x = cp.Variable(pos=True)
y = cp.Variable(pos=True)
constraints = []
objective   = 1000/x/y+2*x+2*y+x*y
prob = cp.Problem(cp.Minimize(objective), constraints)
objval = prob.solve(gp=True)
print("Objective value = {0}".format(objval))
print("x value         = {0}".format(x.value))
print("y value         = {0}".format(y.value))

As output, this gives:

Objective value = 84.82073466127639
x value         = 5.182852109768804
y value         = 5.18285210938629