title: Python linprog minimization--simplex method
body: <p>I'm using scipy.optimize.linprog library to calculate the minimization using the simplex method. I'm working on this problem in my textbook and I'm hoping someone can point me in the right direction because I'm not getting the output I expect. The problem is:</p>
  
  <pre><code>Minimize          w = 10*y1 + 15*y2 + 25*y3
  Subject to:       y1 + y2 + y3 &gt;= 1000
                    y1 - 2*y2    &gt;= 0
                              y3 &gt;= 340
  with              y1 &gt;= 0, y2 &gt;= 0
  </code></pre>
  
  <p>The code I wrote for this is:</p>
  
  <pre><code>import numpy as np
  import pandas as pd
  from scipy.optimize import linprog
  A = np.array([
  [1, 1, 1],
  [1,-2, 0],
  [0, 0, 1]])
  b = np.array([1000,0,340])
  c = np.array([-10,-15,-25])
  res = linprog(c, A_ub=A, b_ub=b,
  bounds=(0, None))
  print('Optimal value:', res.fun, '\nX:', res.x)
  </code></pre>
  
  <p>Which gives the output:</p>
  
  <pre><code>Optimal value: -18400.0
  X: [   0.  660.  340.]
  </code></pre>
  
  <p>I expect it to be:</p>
  
  <pre><code>Optimal value: -15100.0
  X: [   660.  0.  340.]
  </code></pre>
  
  <p>I can't seem to find consistency with this function but maybe it's the way I'm using it.  </p>