Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Fmincon: nonlinear binary problem
Replies: 10   Last Post: Apr 12, 2013 7:07 AM

 Messages: [ Previous | Next ]
 Johan Lofberg Posts: 48 Registered: 11/6/06
Re: Fmincon: nonlinear binary problem
Posted: Apr 11, 2013 2:25 AM

You're almost there Anna, you just need two more constraints

This ensures z_ij is 1 if both x_ik and x_jk are 1
x_ik+x_jk=<z_ij+1

Now you add the following to ensure z is zero if any x is zero
z_ij <= x_ik
z_ij <= x_jk

The linear model is now equivalent to the quadratic model

/johan

"Anna" wrote in message <kk3eig\$mcn\$1@newscl01ah.mathworks.com>...
> Thank you Bruno and Alan for the hints. I will also also thinking to linearize my objective so that I can use bintprog. I'd do it by introducing additional binary variable z_ij in such a way that:
>
> myfun=SUM(i)SUM(j)z_ij*p_ij
>
> x_ik+x_jk=<z_ij+1
>
> Would bintprog keep z_ij as 0 and enforce to 1 only if absolutely necessary?
>
> Regards,
> Anna
>
> Alan_Weiss <aweiss@mathworks.com> wrote in message <kk18lc\$smq\$1@newscl01ah.mathworks.com>...

> > On 4/9/2013 9:26 AM, Bruno Luong wrote:
> > > "Anna" wrote in message <kk133a\$9i6\$1@newscl01ah.mathworks.com>...
> > >> Hello,
> > >>
> > >> This is the first time I use Matlab's Optimization Toolbox. I'm
> > >> trying to solve a binary problem but it's not linear and I use fmincon.

> > >
> > > Never ever use fmincon for binary problem.
> > >
> > > Bruno

> >
> > To expand on Bruno's answer, there is no Optimization Toolbox solver
> > capable of handling binary problems.
> > http://www.mathworks.com/help/optim/ug/choosing-a-solver.html#brhkghv-19
> >
> > Your only choice among MATLAB solvers is ga from Global Optimization
> > Toolbox:
> >
> > Good luck,
> >
> > Alan Weiss
> > MATLAB mathematical toolbox documentation

Date Subject Author
4/9/13 Guest
4/9/13 Bruno Luong
4/9/13 Alan Weiss
4/10/13 Anna
4/11/13 Johan Lofberg
4/11/13 Anna
4/11/13 Torsten
4/11/13 Anna
4/12/13 Torsten
4/12/13 Anna
4/12/13 Torsten