title: Python linprog to maximise objective function
body: <p>It has been a while since I have done this so I am a bit rusty, but equation is:</p>
  
  <pre><code>max t(C)*x
  s.t. Ax &lt;=b
  </code></pre>
  
  <p>And I have my <strong>A</strong> matrix of constraints which is (1448x1359) :</p>
  
  <pre><code>[[ 1.  1.  0. ...,  0.  0.  0.]
  
   ..., 
  
  
   [ 0.  0.  0. ...,  1.  1.  1.]]
  </code></pre>
  
  <p>Then I have my binding <strong>b</strong> (1448x1):</p>
  
  <pre><code>[ 1.  1.  7. ...,  2.  1.  2.]
  </code></pre>
  
  <p>And my objective function to be maximised which is a vector of ones (1359,1).</p>
  
  <p>Now in other packages my maximised objective function is 841, however using linprog:</p>
  
  <pre><code>res = linprog(c=OBJ_N, A_ub=A, b_ub=b, options={"disp": True})
  </code></pre>
  
  <p>It optimised successfully to -0.0 so I wonder if I'm using the right command in python and have my constraints the right way around?</p>
  
  <p><strong>Edit</strong>: Ok that makes sense, it was trying to minimise. I have rewritten now (swapped c and b and transposed A to minimise). </p>
  
  <pre><code># (max t(C)*x s.t. Ax &lt;=b) = min t(b)*x s.t. ATy = c, y ≥ 0
  # (i): minimise number of shops no bounds
  ID = np.ones(len(w[0]))
  print(ID)
  print(ID.shape)  #1359
  
  At = A.transpose()
  
  need_divest = (A.dot(ID)) - 1
  print(need_divest)
  print(need_divest.shape)  #1448
  
  res = linprog(c=need_divest, A_eq=At, b_eq=ID, options={"disp": True})
  print(res)
  </code></pre>
  
  <p>However, I get "message: 'Optimzation failed. Unable to find a feasible starting point.'"</p>