0

How would I find the constraint value of a variable using SAT_INTEGER_PROGRAMMING given a feasible solution. Essentially solution_value() but for constraint.

Looked through documentation and nothing that helps with that above

Laurent Perron
  • 8,594
  • 1
  • 8
  • 22
Mona
  • 23
  • 3

1 Answers1

1

Assuming you are using pywraplp, there is ComputeConstraintActivities which computes the sum of the linear terms of each constraint. Have a look at linear_programming.py for usage.

If you are using model_builder, then this should be followed.

watchdogs132
  • 185
  • 1
  • 1
  • 5
  • Am using pywraplp. What i was wondering if I can get the variable value given a constraint. Not the sum of all constraint variables – Mona Mar 08 '23 at 18:54
  • 1
    Makes no sense. Variables have one solution value independently of constraints – Laurent Perron Mar 08 '23 at 19:05