Projects and Posts

YALMIP: Making Optimization Easier Since 2004

In a previous post, I discussed an assignment problem inspired by the Girls Scouts. From the modeling point of view, it was a little tricky because I needed to linearize some quadratic constraints over binary variables. From the software point of view, I used YALMIP—which always makes my optimization life easier.

Recently, Johan Löfberg, the developer of YALMIP, emailed a few ways to improve my use of YALMIP. In particular, he suggested the use of multidimensional arrays for storing my YALMIP variables—something I didn’t know you could do but is extremely helpful in this case. He also mentioned YALMIP’s binmodel command, which automatically linearizes nonlinear constraints over binary variables. What an excellent, time-saving command!

One other side advantage: the model setup time decreased from 1.1 seconds to 0.2 seconds, and the solver time decreased from 0.4 seconds down to (essentially) 0.0 seconds.

Thank you, Johan!

Projects and Posts