BCH Facility Incumbents

Hello GAMS,

Does anyone knows how to say GAMS to stop when it founds an incumbent solution for the BCH facility. I mean instead looking for the optimal solution through new incumbents founds, say to GAMS ey stop with the first incumbent solution you find. For example for this problem which is available in the BCH library examples.

You would help me a lot guys!!!

Set n nodes s sub arcs index arc(n,n,s) arcs Alias(n,nn,m),(s,ss) Parameter demand(n) node demand fcost(n,n,s) fixed cost vcost(n,n,s) variable cost xupp(n,n,s) upper bound on flow yupp(n,n,s) upper bound on build Scalar u sum of demand usetree whether the additional equation is present /0/ usett1 same /0/ usett2 same /0/ include berlin2.inc arc(m,n,s)(fcost(m,n,s) or vcost(m,n,s) or xupp(m,n,s) or yupp(m,n,s)) = yes; * Export data for use in the cut generator execute_unload ‘net.gdx’, nn ss arc demand fcost vcost u usetree usett1 usett2 xupp yupp; Variable cost x(n,n,s) flow over the arc y(n,n,s) usage of the arc Positive variables x Binary variables y Equations obj objective tt2(n) no flow through non-demanding nodes bf(n,n,s) binary forcing constraints bal(n) flow conservation constraints tree(n) outflow via one arc only tt1(n) demanding nodes are fed via one arc only; obj… sum(arc, vcost(arc)*x(arc) + fcost(arc)*y(arc)) =e= cost; bal(n)… sum(arc(m,n,s), x(m,n,s)) - sum(arc(n,m,s), x(n,m,s)) =e= demand(n); bf(arc)… x(arc) =l= xupp(arc)*y(arc); tree(n)usetree.. sum(arc(n,m,s), y(n,m,s)) =l= 1; tt1(n)(usett1 and demand(n) > 0)… sum((m,s), y(m,n,s)) =e= 1; tt2(n)$(usett2 and demand(n) = 0)… sum((m,s), y(m,n,s)) =l= 1; model master /all/; $ifi %system.mip% == cplex $goto cont $abort ‘BCH Facility not available for MIP solver %system.mip%.’ $label cont master.optfile = 1; $onecho > cplex.opt mipinterval 1 usercutcall bchdicut.inc minlp baron optcr 0.0 optca 0.5 reslim 10 optfile=1 lo=2 --cplex=1 usercutfirst 100 $offecho $onecho > baron.opt isoltol 0.99 numsol 20 gdxout bchdicut firstfeas 1 $offecho xupp(arc) = min(u,xupp(arc)); x.up(arc) = xupp(arc); y.up(arc)$yupp(arc) = yupp(arc); master.optcr=0; solve master mini cost using mip;


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Nacho,

This is pretty much independent of the the BCH stuff. You can give a very large optca (option optca=1e9) or a solver specific option that tells the solver to stop after n solutions (e.g. in a cplex.opt for solver Cplex say ‘intsollim 1’).

Hope this helps,
Michael

On Thursday, November 12, 2015 at 3:33:05 AM UTC-5, Nacho Blanco wrote:

Hello GAMS,

Does anyone knows how to say GAMS to stop when it founds an incumbent solution for the BCH facility. I mean instead looking for the optimal solution through new incumbents founds, say to GAMS ey stop with the first incumbent solution you find. For example for this problem which is available in the BCH library examples.

You would help me a lot guys!!!

Set n nodes s sub arcs index arc(n,n,s) arcs Alias(n,nn,m),(s,ss) Parameter demand(n) node demand fcost(n,n,s) fixed cost vcost(n,n,s) variable cost xupp(n,n,s) upper bound on flow yupp(n,n,s) upper bound on build Scalar u sum of demand usetree whether the additional equation is present /0/ usett1 same /0/ usett2 same /0/ include berlin2.inc arc(m,n,s)(fcost(m,n,s) or vcost(m,n,s) or xupp(m,n,s) or yupp(m,n,s)) = yes; * Export data for use in the cut generator execute_unload ‘net.gdx’, nn ss arc demand fcost vcost u usetree usett1 usett2 xupp yupp; Variable cost x(n,n,s) flow over the arc y(n,n,s) usage of the arc Positive variables x Binary variables y Equations obj objective tt2(n) no flow through non-demanding nodes bf(n,n,s) binary forcing constraints bal(n) flow conservation constraints tree(n) outflow via one arc only tt1(n) demanding nodes are fed via one arc only; obj… sum(arc, vcost(arc)*x(arc) + fcost(arc)*y(arc)) =e= cost; bal(n)… sum(arc(m,n,s), x(m,n,s)) - sum(arc(n,m,s), x(n,m,s)) =e= demand(n); bf(arc)… x(arc) =l= xupp(arc)*y(arc); tree(n)usetree.. sum(arc(n,m,s), y(n,m,s)) =l= 1; tt1(n)(usett1 and demand(n) > 0)… sum((m,s), y(m,n,s)) =e= 1; tt2(n)$(usett2 and demand(n) = 0)… sum((m,s), y(m,n,s)) =l= 1; model master /all/; $ifi %system.mip% == cplex $goto cont $abort ‘BCH Facility not available for MIP solver %system.mip%.’ $label cont master.optfile = 1; $onecho > cplex.opt mipinterval 1 usercutcall bchdicut.inc minlp baron optcr 0.0 optca 0.5 reslim 10 optfile=1 lo=2 --cplex=1 usercutfirst 100 $offecho $onecho > baron.opt isoltol 0.99 numsol 20 gdxout bchdicut firstfeas 1 $offecho xupp(arc) = min(u,xupp(arc)); x.up(arc) = xupp(arc); y.up(arc)$yupp(arc) = yupp(arc); master.optcr=0; solve master mini cost using mip;


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.