Constraint Technology for Solving Combinatorial Problems Project Option 2: Scene Allocation Magnus Ågren Computing Science, Information Technology, Uppsala University [email protected] — To be handed in before 08:00 on June 5, 2006 — Submission Instructions 1. The project report should be handed in individually. Do not work in pairs and hand in nearly identical solutions. It is allowed to discuss solution alternatives but not to copy each other’s programs. 2. Make sure you understand the problem and have an idea about how to solve it before you start programming. Ask for help if you feel that something is unclear. 3. Write clear and understandable code and documentation and state any assumptions you make. 4. Include external documentation describing how your program works. This includes describing the model and any particular relevant features, e.g., heuristics used, search technique(s), special data structures (if any), etc. Explain how to compile and run your program. 5. Include sample test runs of your program with inputs and outputs. Make sure that the test runs are reproducible by the program you hand in. 6. Discuss your results where this is relevant. 7. Submit your solution via the course manager before the deadline. Make a tar or zip archive of all your files. Only include .pdf or .txt files other than your source code files. Note that failure to follow the instructions above may result in a U grade. 1 The Scene Allocation Problem The Scene Allocation Problem [1] is an optimisation problem where the task is to minimise the total actor cost when shooting scenes for a movie. It is described as follows in [1]: The scene-allocation problem consists of deciding when to shoot scenes for a movie. Each scene invoves a number of actors and at most 5 scenes a day can be filmed. All actors of a scene must, of course, be present on the day the scene is shot. The actors have fees representing the amount to be paid per day they spend in the studio. The goal of the application is to minimize the production costs. The instance that we consider in this project is given as follows. There are 19 scenes that must be shot during at most five days. The set of eleven actors and their daily fees are given in Table 1. For example, Cruise has the highest daily fee of 30310 and De Niro has the second highest daily fee of 26481. Hence, if we want to minimise the total actor cost, it is probably a good idea to limit the number of days they spend on the set. Actor Daily Fee De Niro 26481 Kidman 25043 Cruise 30310 Thurman 4085 Liu 7562 Actor Daily Fee Stormare 8770 Johansson 5788 Cole 7423 Williams 3303 Bogart 9593 Pacino 9381 Table 1: The set of actors and their daily fees. The set of 19 scenes to shoot and their actors are given in Table 2. Scene 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Set of actors {Pacino} {De Niro, Pacino, Liu, Thurman} {Johansson, Cruise, Cole, Liu} {Kidman, Cole} {Cole, Stormare, De Niro, Johansson, Williams} {Bogart, Johansson, Stormare, Cruise, Williams} {Kidman, De Niro} {Cole, Thurman} {Kidman, Johansson, Cole, Cruise, Bogart} {Kidman, Johansson, Cruise, De Niro} {De Niro} {Pacino, Bogart, Johansson, Thurman, Liu} {Pacino, Thurman, Kidman, De Niro} {Stormare, Cruise} {Bogart, Thurman, Johansson, De Niro} {Cruise, Johansson, Kidman, Cole} {Cruise, De Niro, Liu} {Cruise, Johansson, Pacino, Bogart} {Kidman} Table 2: The set of scenes and which actors that participate in each scene. A (non-optimal) solution to the instance is shown in Table 3 where the total actor cost is 581736. To obtain this number, we first calculate the cost of each actor by multiplying his/her daily fee with the number of days he/she is present in any scene. The total actor cost is then the sum of 2 Day Set of scenes 1 2 3 4 5 {1, 2, 3, 4, 5} {6, 7, 8, 9} {10, 11, 12} {13, 14, 15, 16, 17} {18, 19} (a) Scene Day 1 1 2 1 3 1 4 1 5 1 6 2 7 2 8 2 9 2 10 3 11 3 12 3 13 4 14 4 15 4 16 4 17 4 18 5 19 5 (b) Table 3: Two different views of the same (non-optimal) solution to the scene allocation problem with total actor cost equal to 581736: (a) shows the set of scenes to shoot at a particular day, while (b) shows the day to shoot a particular scene. this value for all actors: Total Actor Cost = (4 · daily fee for DeNiro) + (5 · daily fee for Kidman) + (5 · daily fee for Cruise) + · · · + (4 · daily fee for Bogart) = (4 · 26481) + (5 · 25043) + (5 · 30310) + · · · + (4 · 9593) = 581736 Table 3 shows the solution in two different but equivalent ways: (a) shows the set of scenes to shoot at a particular day, while (b) shows the day to shoot a particular scene. (Hint: This directly translates to two different but equivalent ways of representing the variables of the problem.) The Task Write a constraint program for finding and displaying the first optimal solution to the given instance of the scene allocation problem. Your program should be able to produce the first optimal solution to the given instance within reasonable time on debet.it.uu.se. Bonus-Points Competition There is a competition for this project where the first (and only) prize is 15% bonus points on the written exam. To participate in the competition, clearly state that you wish to do so and report the CPU time on debet.it.uu.se that your program needs to find the first optimal solution to the given instance of the scene allocation problem. Note that there may be several winners if several people reach the same result. Two or more people are considered to have reached the same result if the absolute difference between the solution times on debet.it.uu.se for the programs of any pair of people is at most R CPU seconds.1 References [1] P. Van Hentenryck. Constraint and integer programming in OPL. INFORMS Journal on Computing, 14(4):345–372, 2002. Available at http://search.epnet.com/login.aspx?direct= true&db=buh&an=8550433 from the department’s computers. 1 The number R will be decided by the instructors after marking the projects. 3
© Copyright 2026 Paperzz