> Tutorials > Interactive Optimizer Tutorial > Changing a Problem > Deleting |
Deleting |
INDEX
![]() |
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:
ILOG CPLEX displays a list of delete options.
At the first prompt, specify that you want to delete a constraint.
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 to be deleted is named new3
, enter that name:
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.
The general syntax for the change
command is:
Copyright © 1987-2003 ILOG, S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |