> The Basics > Adding Visit Disjunctions > Suggested Answers > Exercise 1
How is the visit penalty cost used in this problem?
Suggested Answer
You use the member function IloVisit::setPenaltyCost
to set the cost of not performing visit1
to 20 units. This allows the visit to not be performed, since only one visit of each pair will be performed. You use the member function IloVisit::setPenaltyCost
to set the cost of not performing visit2
to 10 units. This means that the solution will be more likely to include the visit1
of each pair, rather than the visit2
of each pair, since the penalty for not performing visit1
of each pair is higher than the penalty for not performing visit2
.