IBM ILOG Solver User's Manual > The Basics > Searching with Predefined Goals: Magic Square > Review exercises

For answers, see "Suggested answers".

  1. What information does the member function IloSolver::printInformation display?
  2. How does the predefined goal IloGenerate work?
  3. Use the magic square code that you just wrote and experiment with changing the order in which variables are bound in the solution search. Note how the number of fails, number of choice points, and elapsed time since creation change as you try the following parameters for the goal IloGenerate: the default (IloChooseFirstUnboundInt), IloChooseMinSizeInt, IloChooseMaxSizeInt, IloChooseMinMinInt, IloChooseMaxMinInt, IloChooseMinMaxInt, and IloChooseMaxMaxInt.
  4. To do this, write a line of code for each IloGenerate goal, using the default and the six other parameters. Comment out all the goals except for the one you are testing. Then comment out that goal and test another.
  5. Change the program to search for a Gnomon magic square, which is a n = 4 magic square in which the elements in each quarter (2 x 2 corner) have the same sum.