Go up to 4 Designing Video Presentations
Go forward to Solution to part (b).
Solution to part (a).
I have four different solutions:
For the first solution, a segment is chosen that covers the
first topic, and all of the topics that this segment also covers are
removed from the list of topics left to cover.
- The second solution is a directly recursive
definition with no predicates defined other than in the question.
- The third solution uses an iterative method, where
we define another predicate add_to_presentation that adds to
existing an presentation to also include more topics. Presentation
then asks to add the topics it must cover to an empty presentation.
- The fourth solution generates presentations that
satisfy the length criterion, and then tests them to see if they
cover all of the topics. This is the only one that defines more than
one extra predicate.
material, ©David Poole, Alan Mackworth and Randy Goebel, 1999