Loading [MathJax]/jax/output/CommonHTML/jax.js

Saturday, July 6, 2013

Integer Variables and Quadratic Terms

This is a sequel to a previous post,"Binary Variables and Quadratic Terms", in which I described how to linearize the product of a binary variable and a general variable (possibly discrete, possibly continuous). Here I'll deal with linearizing z=xy where xX, X a discrete set, and y is an arbitrary variable.

To linearize the product, I'll need both variables to bounded. So assume that LyU and that NX=|X|<. There are a couple of ways (that I know) to proceed, and both involve introducing binary variables.

The more obvious route, suitable when NX is not large, is to add NX binary variables wa,aX and setx=aXawa,along with the SOS1 constraintaXwa=1.Thenz=aXaway,and we can linearize each of the products way as explained in the previous post. More specifically, we set z=aXaza where za=way is a new continuous variable, then linearize the expression for za (creating, per the previous post, four new constraints for each za).

The other approach is very similar but usually more efficient in terms of added variables and constraints when X is an interval (X={a,a+1,,a+NX1}) and NX is not small. Rather than creating a binary variable for each value in the domain X, we perform a binary expansion of x:x=a+Mi=02iuiwith u0,,uM{0,1} and M=log2(NX). Unless NX happens to be an integral power of 2, we also need the constraint xa+NX1. The product z=xy can now be writtenz=ay+Mi=02iwiwhere wi=uiy, and again we linearize each wi as explained in the prior post.

No comments:

Post a Comment

Due to intermittent spamming, comments are being moderated. If this is your first time commenting on the blog, please read the Ground Rules for Comments. In particular, if you want to ask an operations research-related question not relevant to this post, consider asking it on Operations Research Stack Exchange.