title: Python Pulp absolute constraints
body: <p>Suppose I have a set of decision variables in my PuLP definition:</p>
  
  <pre><code>vals = [-v for k, v in (DecisionVars.items())]
  </code></pre>
  
  <p>And I want to create a constraint related to the <strong>absolute</strong> value of the sum of all constraints. So something like:</p>
  
  <pre><code>for i in range(len(DecisionVars)):
     prob += lpSum(abs(vals[:i+1])) &lt;= some_limit, "Absolute constraint"
  </code></pre>
  
  <p>But I cant seem to apply the <code>abs()</code> operator to my constraints?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Ok, if I make use of the information in this post <a href="https://stackoverflow.com/questions/29795632/sum-of-absolute-values-constraint-in-semi-definite-programming">sum of absolute values constraint in semi definite programming</a> then my question can be formulated differently. I am now trying to evaluate:</p>
  
  <pre><code>abs(x1) + abs(x2) + abs(x3) &lt;= some_limit
  </code></pre>
  
  <p>As pointed out in the link above, the answer might be to create a 1-norm of the vector x (where x is the vector of decision variables as above). I can see that <code>numpy</code> has <code>numpy.linalg.norm</code> but I cannot see how this can recursively create my set of constraints in PuLP. I'm struggling to create the correct syntax using <code>lpSum</code>.</p>