7.3 Geometric Programming

Geometric programs (GP) are a particular class of optimization problems which can be expressed in special polynomial form as positive sums of generalized monomials. More precisely, a geometric problem in canonical form is

(7.9)minimizef0(x)subject tofi(x)1,i=1,,m,xj>0,j=1,,n,

where each f0,,fm is a posynomial, that is a function of the form

f(x)=kckx1αk1x2αk2xnαkn

with arbitrary real αki and ck>0. The standard way to formulate GPs in convex form is to introduce a variable substitution

xi=exp(yi).

Under this substitution all constraints in a GP can be reduced to the form

(7.10)log(kexp(akTy+bk))0

involving a log-sum-exp bound. Moreover, constraints involving only a single monomial in x can be even more simply written as a linear inequality:

akTy+bk0

We refer to the MOSEK Modeling Cookbook and to [BKVH07] for more details on this reformulation. A geometric problem formulated in convex form can be entered into MOSEK with the help of exponential cones.

7.3.1 Example GP1

The following problem comes from [BKVH07]. Consider maximizing the volume of a h×w×d box subject to upper bounds on the area of the floor and of the walls and bounds on the ratios h/w and d/w:

(7.11)maximizehwdsubject to2(hw+hd)Awall,wdAfloor,αh/wβ,γd/wδ.

The decision variables in the problem are h,w,d. We make a substitution

h=exp(x),w=exp(y),d=exp(z)

after which (7.11) becomes

(7.12)maximizex+y+zsubject tolog(exp(x+y+log(2/Awall))+exp(x+z+log(2/Awall)))0,y+zlog(Afloor),log(α)xylog(β),log(γ)zylog(δ).

Next, we demonstrate how to implement a log-sum-exp constraint (7.10). It can be written as:

(7.13)ukexp(akTy+bk),(equiv. (uk,1,akTy+bk)Kexp),kuk=1.

This presentation requires one extra variable uk for each monomial appearing in the original posynomial constraint. The explicit representation of conic constraints in this case is:

[000100000011000000010000010100][xyzu1u2]+[01log(2/Awall)01log(2/Awall)]Kexp×Kexp.

We can now use this representation to assemble all constraints in the model.

Listing 7.8 Source code solving problem (7.12). Click here to download.
    Awall  = 200
    Afloor = 50
    alpha  = 2
    beta   = 10
    gamma  = 2
    delta  = 10
 
    % A model with variables [x,y,z,u1,u2]
    model = mosekmodel(...
        name = "gp1",...
        numvar = 5);
    model.objective("maximize", [ 1 1 1 0 0]);

    % u1 + u2 = 1
    model.appendcons(F = [ 0 0 0 1 1 ], domain = mosekdomain("equal",     rhs=1.0));
    
    % y + z <= log(Afloor)
    model.appendcons(F = [ 0 1 1 0 0 ], domain = mosekdomain("less than", rhs=log(Afloor)));
    
    % Two-sided bounds on x-y and z-y
    model.appendcons(F = [ 1 -1 0 0 0 ; ...
                           0 -1 1 0 0 ], domain = mosekdomain("greater than",dim=2, rhs=[log(alpha) log(gamma)]'));
    model.appendcons(F = [ 1 -1 0 0 0 ; ...
                           0 -1 1 0 0 ], domain = mosekdomain("less than",   dim=2, rhs=[log(beta)  log(delta)]'));

    % Conic constraints
    model.appendcons(F = sparse([1 3 3],[4 1 2],[1.0 1.0 1.0]), g = [0 1 log(alpha/Awall)]', domain = mosekdomain("exp"));
    model.appendcons(F = sparse([1 3 3],[5 1 3],[1.0 1.0 1.0]), g = [0 1 log(alpha/Awall)]', domain = mosekdomain("exp"));
    
    model.solve();
    if model.hassolution("interior")
        [xx,prosta,solsta] = model.getsolution("interior","x");
        x = xx(1:3);
        disp(exp(x));
    end