[ library(eplex) | Reference Manual | Alphabetic Index ]

eplex_verify_solution(-ViolatedCstrs,-ViolatedVars)

EplexInstance:eplex_verify_solution(-ViolatedCstrs,-ViolatedVars)

Verifies the current solution for the problem associated with EplexInstance.
ViolatedCstrs
List of violated Constraints.
ViolatedVars
List of violated variables.

Description

This predicate checks the current solution for the problem associated with EplexInstance. It verifies that all the constraints are satisfied by the solution values for the problem variables, and that the solution values do not violate their bounds, and the values are integral for integer variables. Violated Constraints are returned in ViolatedCstrs, and violated variables in ViolatedVars.

Under normal circumstances, if the external solver produces a solution, it should produce no violations. Any violation probably indicates a problem with the external solver. However, because the external solver is a complex piece of software and may contain problems, it is a good idea to verify the solution, and this predicate provides an easy way to do this.

Each violation is returned as a structure of the following form:

  vio(type,delta,idx,item) 
where
type:
the type of violation:
norm:
the violated item is a normal constraint.
condcp:
the violated item is an active cutpool constraint.
int:
the violated item is an integer variable whose solution value is not integral.
lower:
the violated item is a variable whose solution value is less than the lower bound.
upper:
the violated item is a variable whose solution value is greater than the upper bound.
delta:
the absolute value of the violation.
idx:
the index used by the external solver for the item (most likely the row/column number in the problem matrix). This is needed to locate the violation in the solver for reporting or investigating the problem.
item:
the violated item, i.e. the constraint or variable.

For checking of constraints, a fresh copy of the constraint is made with the solution values, as this avoids binding the original variables. Any active cutpool constraints in the (logically) last solve of the problem are checked, along with the normal constraints. A constraint is considered to be violated if the difference between the sum of the left-hand side and the right-hand side for the constraint is greater than the feasibility tolerance (feasibility_tol) parameter for the instance. For variables, a bound is considered violated if the solution value falls outside the bound by more than feasibility tolerance, and integrality is considered to be violated if the fractional part of the soltuion is greater than the integrality parameter for the instance.

Fail Conditions

no solution values are available.