Previous Up

9.6  Exercise

  1. Consider the “farm” problem in section 9.5. (Source code may be found in farm.ecl, if you have access to it.) Try running this program to find the answer. Note that other, larger solutions are available by selecting more.

    This implementation sums three integer variables (FA, FB and FC), and then constrains their order to remove symmetries. Would this be a good candidate for the global constraint ordered_sum/2? Modify the program so that it does use ordered_sum/2. How does the run time compare with the original?


Previous Up