constraints

I am getting the following error cvxpy.error.DCPError: Problem does not follow DCP rules. Specifically: The objective is not DCP

I am getting the following error cvxpy.error.DCPError: Problem does not follow DCP rules. Specifically: The objective is not DCP Question: I have been working in python trying to create a simple optimization utilizing CVXPY. I get the error: cvxpy.error.DCPError: Problem does not follow DCP rules. Specifically: The objective is not DCP. Its following subexpressions are …

Total answers: 1

Pulp Python problem setting constraints when summing values in a column

Pulp Python problem setting constraints when summing values in a column Question: Hi this is my first question here so go easy on me if I format things incorrectly. I’m trying to model a table where each value is either 1 or 0. I’d like to determine whether the sum of a column is 0 …

Total answers: 2

Find permutations which also match other constraints

Find permutations which also match other constraints Question: Given the following list: dbset = [[{‘id’: ‘10556’, ‘nation’: ‘France’, ‘worth’: ’70’}], [{‘id’: ‘14808’, ‘nation’: ‘France’, ‘worth’: ’65’}], [{‘id’: ‘11446’, ‘nation’: ‘Ghana’, ‘worth’: ’69’}], [{‘id’: ‘11419’, ‘nation’: ‘France’, ‘worth’: ’69’}], [{‘id’: ‘11185’, ‘nation’: ‘Ghana’, ‘worth’: ’69’}], [{‘id’: ‘1527’, ‘nation’: ‘Ghana’, ‘worth’: ’64’}], [{‘id’: ‘12714’, ‘nation’: ‘Moldova’, ‘worth’: …

Total answers: 2

print constraints Gurobi Python

print constraints Gurobi Python Question: I’m using Gurobi in Python and for a given set S I’m adding the constraint as follows: for i in S: m.addConstr(quicksum(x[i,j] for j in (set(V) – set(S))) >= 2) I want to print these constraints for each value of the sets S and V on the screen. For an …

Total answers: 4

How to apply 'IN' constraint to the fields of django models

How to apply 'IN' constraint to the fields of django models Question: I want that one of the fields of the model can take only some specific values say a and b. This can be achieved normally in sql by adding the ‘IN’ constraint. How can I achieve the same using django model class fields. …

Total answers: 2