IBM ILOG Solver User's Manual > Developing Solver Applications > Designing Models > Use appropriate search strategies > Example |
Example |
INDEX
![]() |
Let's continue the preceding example. The code presented in the preceding section would search in these ways:
vars
.
In contrast, we could first try the highest values, since we are interested in the highest possible sum. For that purpose, we define our own selector to choose the variables with the largest maximum values in their domains. In our definition, we use the implementation class IlcIntSelectI
. (The IBM ILOG Solver Reference Manual documents IlcIntSelectI
.) Here's the code to do this:
This improved version searches in this way:
Here's the output, demonstrating the improvement in the number of tries:
Sum = 15 #tries = 5 |
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |