## Main.DiscreteOptimization History

Changed line 40 from:

m.Obj(4*x1**2-4*x2*x1**2+x2**2+x1**2-x1+1)

to:

m.Minimize(4*x1**2-4*x2*x1**2+x2**2+x1**2-x1+1)

June 21, 2020, at 04:35 AM by 136.36.211.159 -
Deleted lines 45-63:

(:html:)

 <div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
})();
</script>


(:htmlend:)

The integer problem can be solved with Python GEKKO. The option integer=True is used to switch the variable from continuous to integer form. The APOPT solver is required to solve problem with integer variables but other solvers such as IPOPT can provide a relaxed solution where the integer conditions are not enforced.

(:source lang=python:) from gekko import GEKKO m = GEKKO() # create GEKKO model

1. create integer variables

x1 = m.Var(integer=True,lb=-1,ub=1) x2 = m.Var(integer=True,lb=-1,ub=2) m.Obj(4*x1**2-4*x2*x1**2+x2**2+x1**2-x1+1) m.options.SOLVER = 1 # APOPT solver m.solve() print('x1: ' + str(x1.value[0])) print('x2: ' + str(x2.value[0])) (:sourceend:)

March 15, 2016, at 03:32 PM by 45.56.3.173 -
Deleted lines 3-6:

At first glance it might seem solving a discrete variable problem would be easier than a continuous problem. After all, for a variable within a given range, a set of discrete values within the range is finite whereas the number of continuous values is infinite. When searching for an optimum, it seems it would be easier to search from a finite set rather than from an infinite set.

This is not the case, however. Solving discrete problems is harder than continuous problems. This is because of the combinatorial explosion that occurs in all but the smallest problems. For example if we have two variables which can each take 10 values, we have 10*10 = 100 possibilities. If we have 10 variables that can each take 10 values, we have 10^10 possibilities. Even with the fastest computer, it would take a long time to evaluate all of these.

March 15, 2016, at 03:32 PM by 45.56.3.173 -
Changed lines 5-8 from:
to:

At first glance it might seem solving a discrete variable problem would be easier than a continuous problem. After all, for a variable within a given range, a set of discrete values within the range is finite whereas the number of continuous values is infinite. When searching for an optimum, it seems it would be easier to search from a finite set rather than from an infinite set.

This is not the case, however. Solving discrete problems is harder than continuous problems. This is because of the combinatorial explosion that occurs in all but the smallest problems. For example if we have two variables which can each take 10 values, we have 10*10 = 100 possibilities. If we have 10 variables that can each take 10 values, we have 10^10 possibilities. Even with the fastest computer, it would take a long time to evaluate all of these.

Discrete decision variables are those that have only certain levels or quantities that are acceptable at an optimal solution. Examples of discrete variables are binary (e.g. off/on or 0/1), integer (e.g. 4,5,6,7), or general discrete values that are not integer (e.g. 1/4 cm, 1/2 cm, 1 cm).

March 15, 2016, at 03:22 PM by 45.56.3.173 -

(:html:) <iframe width="560" height="315" src="https://www.youtube.com/embed/RPKPjqdiX1c" frameborder="0" allowfullscreen></iframe> (:htmlend:)

December 19, 2014, at 02:22 PM by 107.188.175.164 -
February 16, 2014, at 04:55 AM by 23.255.228.67 -

(:html:) <iframe width="560" height="315" src="//www.youtube.com/embed/XhqteZIydT0?rel=0" frameborder="0" allowfullscreen></iframe> (:htmlend:)

One often encounters problems in which design variables must be selected from among a set of discrete values. Examples of discrete variables include catalog or standard sizes (I beams, motors, springs, fasteners, pipes, etc.), materials, and variables which are naturally integers such as people, gear teeth, number of shells in a heat exchanger and number of distillation trays in a distillation column. Many engineering problems are discrete in nature.

Deleted lines 18-19:

One often encounters problems in which design variables must be selected from among a set of discrete values. Examples of discrete variables include catalog or standard sizes (I beams, motors, springs, fasteners, pipes, etc.), materials, and variables which are naturally integers such as people, gear teeth, number of shells in a heat exchanger and number of distillation trays in a distillation column. Many engineering problems are discrete in nature.

February 15, 2014, at 03:29 PM by 23.255.228.67 -
Changed lines 11-12 from:
to:
February 15, 2014, at 03:26 PM by 23.255.228.67 -
Changed lines 9-11 from:
to:
February 20, 2013, at 09:50 PM by 128.187.97.21 -
February 19, 2013, at 09:48 PM by 128.187.97.21 -
Changed line 8 from:
• Branch and Bound (Select APOPT solver)
to:
• Branch and Bound with APMonitor (Select APOPT solver)
February 19, 2013, at 09:45 PM by 128.187.97.21 -
Changed line 8 from:
• Branch and Bound with APMonitor
to:
• Branch and Bound (Select APOPT solver)
February 19, 2013, at 09:38 PM by 128.187.97.21 -
Changed lines 5-7 from:
to:
February 19, 2013, at 09:36 PM by 128.187.97.21 -
January 11, 2013, at 02:23 PM by 69.169.188.188 -

(:html:)

 <div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'apmonitor'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
})();
</script>


(:htmlend:)

December 22, 2012, at 04:11 PM by 69.169.188.188 -