title: cvxpy contrained normalization equations (abs)
body: <p>I am working in an optimization problem (A*v = b) where I would like to rank a set of alternatives X = {x1,x2,x3,x4}. However, I have the following normalization constraint: |v[i] - v[j]| &lt;= 1, which can be in the form -1 &lt;= v[i] - v[j] &lt;= 1.
  My code is as follows:</p>
  
  <pre><code>import cvxpy as cp
  
  n = len(X) #set of alternatives
  v = cp.Variable(n)
  objective = cp.Minimize(cp.sum_squares(A*v - b))
  constraints = [0 &lt;= v]
  #Normalization condition -1 &lt;= v[i] - v[j] &lt;= 1
  for i in range(n):
      for j in range(n):
          constraints = [-1 &lt;= v[i]-v[j], 1 &gt;= v[i]-v[j]]
  prob = cp.Problem(objective, constraints)
  # The optimal objective value is returned by `prob.solve()`.
  result = prob.solve()
  # The optimal value for v is stored in `v.value`.
  va2 = v.value
  </code></pre>
  
  <p>Which outputs:</p>
  
  <pre><code>[-0.15  0.45 -0.35  0.05]
  </code></pre>
  
  <p>Result, which is not close to what should be and even have negative values. I think, my code for the normalization contraint most probably is wrong.</p>