

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Part B
Constraint Satisfaction and Combinatorial Optimisation (CSO) Open Examination Issued at: Monday 11 March 2002
Submission due: 12:00 Wednesday 22 May 2002
Your attention is drawn to the Guidelines on Mutual Assistance and Collaboration in the Student’s Handbook.
All queries on this assessment should be addressed to Alan Frisch.
Your examination number must be written on the front of your submission. You must not identify yourself in any other way.
We shall assume that for each product the list of sizes is consistent in that if the product is available in n units then it is available in all multiples of n since one could purchase multiple packages of size n. Any package sizes that exceed the refrigerator capacity are not listed.
(a) (10 marks) Write an Eclipse program that tells Penny how much of each product to buy each week for this special case. If there are no solutions to the problem, your program should fail. If there is a solution then it ought to be returned to the user through variable bindings. Indeed, through the “More?” facility of Eclipse your program ought to be capable of returning all solutions. The aim of this question is to write a very simple program that is correct, but without considering efficiency. Give a couple of examples of your program running, one showing that it recognises a non-trivial failure and one showing it returning multiple solutions.