Deleting

Another option to the change command is delete. This option is used to remove an entire constraint or a variable from a problem. Return the problem to its original form by removing the constraint you added earlier. Type:

  change delete 

ILOG CPLEX displays a list of delete options.

Delete Options:

constraints delete range of constraints

variables delete range of variables

equality delete range of equality constraints

greater-than delete range of greater-than constraints

less-than delete range of less-than constraints

At the first prompt, specify that you want to delete a constraint.

   Deletion to make: constraints 

At the next prompt, enter a constraint name or number, or a range as you did when you used the display command. Since the constraint we want to delete is named new3, we enter that name:

  Delete which constraint(s): new3 
  Constraint 3 deleted.

Check to be sure that the correct range or number is specified when you perform this operation, since constraints are permanently removed from the problem. Indices of any constraints that appeared after a deleted constraint will be decremented to reflect the removal of that constraint.

The last message indicates that the operation is complete. The problem can now be checked to see if it has been changed back to its original form.

display problem all

Maximize

obj: x1 + 2 x2 + 3 x3

Subject To

c1: - x1 + x2 + x3 <= 20

c2: x1 - 3 x2 + x3 <= 30

Bounds

0 <= x1 <= 40

All other variables are >= 0.

When you remove a constraint with the delete option, that constraint no longer exists in memory; however, variables that appear in the deleted constraint are not removed from memory. If a variable from the deleted constraint appears in the objective function, it may still influence the solution process. If that is not what you want, these variables can be explicitly removed using the delete option.

Summary

The general syntax for the change command is:

  change option identifier [identifier2] new value

Previous Page: Changing Coefficients   Return to Top Next Page: Executing Operating System Commands