You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, I have two different cvx optimization problem (named p1, p2). Now I am trying to combine these two to form improved relaxation (p3).
Here are the formulation for each of the problem. I think I need the last constraint in P3 (That is currently commented out but I get assertion error. Also p2 gives inf solution. I may be messing something.
constraints = [X[i, i] == x[i] for i in range(n)]
constraints += [0 <= x, x <= 1]
constraints += [X[i, j] <= 1 for i in range(n) for j in range(n)]
constraints += [x[i] + x[j] <= X[i, j] + 1 for i in range(n) for j in range(n)]
constraints += [X[i, j] <= x[i] for i in range(n) for j in range(n)]
p2:
X = cp.Variable((n, n), symmetric=True)
objective = cp.Minimize(cp.trace(Q @ X))
constraints = [X[i, i] == x[i] for i in range(n)]
constraints += [0 <= x, x <= 1]
p3: (improved relaxed)
objective = cp.Minimize(cp.trace(Q @ X))
constraints = [X[i, i] == x[i] for i in range(n)]
constraints += [0 <= x, x <= 1]
constraints += [X[i, j] <= 1 for i in range(n) for j in range(n)]
constraints += [x[i] + x[j] <= X[i, j] + 1 for i in range(n) for j in range(n)]
constraints += [X[i, j] <= x[i] for i in range(n) for j in range(n)]
# constraints += [X == x.reshape(-1, 1) @ x.reshape(1, -1), X >> 0]
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there, I have two different cvx optimization problem (named p1, p2). Now I am trying to combine these two to form improved relaxation (p3).
Here are the formulation for each of the problem. I think I need the last constraint in P3 (That is currently commented out but I get assertion error. Also p2 gives inf solution. I may be messing something.
p1:
X = cp.Variable((n, n), symmetric=True)
objective = cp.Minimize(cp.trace(Q @ X))
p2:
X = cp.Variable((n, n), symmetric=True)
objective = cp.Minimize(cp.trace(Q @ X))
constraints = [X[i, i] == x[i] for i in range(n)]
constraints += [0 <= x, x <= 1]
p3: (improved relaxed)
Beta Was this translation helpful? Give feedback.
All reactions