Processing math: 100%

Sunday, April 21, 2024

Where Quadratic, Positive Definite and Binary Meet

A comment by Rob Pratt (of SAS) on OR Stack Exchange pointed out two things that are glaringly obvious in hindsight but that somehow I keep forgetting. Both pertain to an expression of the form xQx+cx, either in an objective function or in a second order cone constraint, where x is a vector of variables and Q and c are parameters.

The first observation does not depend on the nature of the x variables. We can without loss of generality assume that Q is symmetric. If it is not, replace Q with the symmetric matrix ˆQ=12(Q+Q), which is symmetric. A wee bit of algebra should convince you that xˆQx=xQx.

The second observation is specific to the case where the x variables are binary (which was the case in the ORSE question which drew the comment from Rob). When minimizing an objective function of the form xQx+cx or when using it in a second order cone constraint of the form xQx+cx0, you want the Q matrix to be positive definite. When x is binary, this can be imposed easily.

Suppose that x is binary and Q is symmetric but not positive definite. The following argument uses the euclidean 2-norm. Let Λ=maxy∥=1yQy, so that yQyΛ for any unit vector y. Under the assumption that Q is not positive definite, Λ0. Choose some λ>Λ and set ˆQ=Q+λI, where I is the identity matrix of appropriate dimension. For any nonzero vector y,

yˆQy=yQy+λyIy=∥y2(yyQyy+λ)≥∥y2(Λ+λ)>0.

So ˆQ is positive definite. Of course, xˆQxxQx, but this is where the assumption that x is binary sneaks in. For xi binary we have x2i=xi. So

xˆQx=xQx+λxIx=xQx+λix2i=xQx+λex

where e=(1,,1). That means the original expression xQx+cx is equal to xˆQx+(cλe)x, giving us an equivalent expression with a positive definite quadratic term.

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.