A simple assessed exercise Ciaran McCreesh & Patrick Prosser + 21.

Slides:



Advertisements
Similar presentations
DCS Lecture how to solve it Patrick Prosser. Put a different number in each circle (1 to 8) such that adjacent circles cannot take consecutive numbers.
Advertisements

1D Bin Packing (or “CP? Who cares?”)
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) Oct, 5, 2012.
Standard  MM3A6. Students will solve linear programming problems in two variables.  a. Solve systems of inequalities in two variables, showing the solutions.
Lecture 10: Integer Programming & Branch-and-Bound
CS112: Course Overview George Mason University. Today’s topics Go over the syllabus Go over resources – Marmoset – Blackboard – Piazza – Textbook Highlight.
Lake Highlands Soccer Association Game Scheduling Sherif Khalifa Senior Design Project May 9, 2008.
CPM!. Just do it! JChoco We jumped in, and took it for a spin Some counting problems Meeting scheduling problem … you got your hands dirty.
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) February, 3, 2010.
1 Optimization Spring 2007 (Third Quarter). 2 Some practical remarks Homepage: Exam: Written, 3 hours. There.
Economics 214 Lecture 37 Constrained Optimization.
Modeling the Covering Test Problem Brahim Hnich, Steven Prestwich, and Evgeny Selensky Cork Constraint Computation Center UCC Supported by SFI.
Linear Programming – Max Flow – Min Cut Orgad Keller.
4.1 System of linear Equations Solving graphically Solving by substitution Solving by addition.
1 MA 1128: Lecture 09 – 6/08/15 Solving Systems of Linear Equations.
Do Now 11/24/14 *PUT AWAY CELL PHONES*. Learning Goal I can write simple and compound inequalities I can solve and graph inequalities.
Consecutive Numbers Algebra I.
Multivariate Linear Systems and Row Operations.
Linear programming Lecture (4) and lecture (5). Recall An optimization problem is a decision problem in which we are choosing among several decisions.
Notes 7.3 – Multivariate Linear Systems and Row Operations.
Learn to solve inequalities with integers. Inequalities & Integers.
The Keys To Success In The Business World By: JFK-102B3W24 JFK-103B1W160.
Scene from an imaginary dinghy race. Constructing Sailing Match Race Schedules Round-Robin Pairing Lists Craig Macdonald, Ciaran McCreesh, Alice Miller,
CSCI 51 Introduction to Computer Science Dr. Joshua Stough January 20, 2009.
Teaching CP in Scotland 02/09/ how you attract students to your CP course - how do you keep them interested - goals/aims of your course - course.
After one pivot: HNT= [4 2 3]
DP TSP Have some numbering of the vertices We will think of all our tours as beginning and ending at 1 C(S, j) = length of shortest path visiting each.
5.4 – Solving Compound Inequalities. Ex. Solve and graph the solution.
CP Summer School Modelling for Constraint Programming Barbara Smith 4. Combining Viewpoints, Modelling Advice.
Chapter 7 Systems of Equations and Inequalities. 7-1 Solving Systems by Graphing Combining two or more equations together (usually joined by set brackets)
Monday, 9/26/11 9pm-10pm. Agenda Announcements Course Work Deadline (seminar assignments must be ed directly to my ) 10/11 WK 9 Assignment posted.
Chapter 1 Linear Algebra S 2 Systems of Linear Equations.
Solving Systems of Equations Algebraically Chapter 3.2.
Chapter 2) CSP solving-An overview Overview of CSP solving techniques: problem reduction, search and solution synthesis Analyses of the characteristics.
Notes – 2/13 Addition Method of solving a System of Equations Also called the Elimination Method.
CP Summer School Modelling for Constraint Programming Barbara Smith 3. Symmetry, Viewpoints.
Put a different number in each circle (1 to 8) such that adjacent circles cannot take consecutive numbers.
to one side of an equation, When you do something.
8puzzle in CP initial state goal state A trivial example.
CS112: Course Overview George Mason University. Today’s topics Go over the syllabus Go over resources – Marmoset – Blackboard – Piazza – Textbook Highlight.
How do I multiply a triple digit number by a double digit? 145 x 67 = ? 267 x 19 = ? I’m sure that you’ll agree that there are many methods that we can.
SYSTEMS OF EQUATIONS. SYSTEM OF EQUATIONS -Two or more linear equations involving the same variable.
Car Sequencing Problem Assessed exercise 2 15% 26/11/2010.
Domain Splitting, Local Search CPSC 322 – CSP 4 Textbook §4.6, §4.8 February 4, 2011.
Learning PowerPoint By: Katherine Myhr. I’m going to show a slide transition! Slide Transition!
An Introduction to Constraint Programming in JChoco.
Where are the hard problems?. Remember Graph Colouring? Remember 3Col?
Notes Over 1.6 Solving an Inequality with a Variable on One Side Solve the inequality. Then graph your solution. l l l
Interpersonal Skills.
Linear programming Lecture (4) and lecture (5). Recall An optimization problem is a decision problem in which we are choosing among several decisions.
Where are the hard problems?
Jobshop scheduling.
Exploring Microsoft Office Exploring Excel Appendix C
3.3 – Solving Systems of Inequalities by Graphing
Consecutive Numbers Algebra I.
Inequalities & Integers
Computer Science cpsc322, Lecture 14
Solving Inequalities (3-2)
GAMING IN KODU – Lesson 1.
Computer Science cpsc322, Lecture 14
Lecture 1: Jobs and Mathematics
Unit 1 Week 1.
USING GRAPHS TO SOLVE EQUATIONS
Put it all together Lesson 5.
8puzzle in CP.
Inequalities & Integers
Put it all together Lesson 6.
Column addition with several numbers
Domain Splitting CPSC 322 – CSP 4 Textbook §4.6 February 4, 2011.
Column addition with several numbers
Presentation transcript:

A simple assessed exercise Ciaran McCreesh & Patrick Prosser + 21

Simple assessed exercise 10 credit course 10 weeks 30 lectures Equivalent to 100 hours in total 30 lectures 20% coursework Self study

Simple assessed exercise Simple exercise is 5% (about 1 day’s effort) Handed out 2 nd week of course Get students using CP (get hands dirty) Students have a rough idea about how CP works

Simple assessed exercise Goals Must be easy to make progress Must be interesting Should be fun students want to solve this problem Google-proof

Simple assessed exercise

You are given n players to be allocated to m teams (where n % m = 0). There are constraints of the form together(i,j) and apart(i,j) where together(i,j) means that players i and j must be in the same team apart(i,j) that players i and j must be in different teams. By default, players can be in any team with any other player. Team Allocator

Simple assessed exercise You are given n players to be allocated to m teams (where n % m = 0). There are constraints of the form together(i,j) and apart(i,j) where together(i,j) means that players i and j must be in the same team apart(i,j) that players i and j must be in different teams. By default, players can be in any team with any other player. Team Allocator 12 4 together 3 9 together 5 9 apart 2 8 apart 6 8

Simple assessed exercise You are given n players to be allocated to m teams (where n % m = 0). There are constraints of the form together(i,j) and apart(i,j) where together(i,j) means that players i and j must be in the same team apart(i,j) that players i and j must be in different teams. By default, players can be in any team with any other player. Team Allocator 12 4 together 3 9 together 5 9 apart 2 8 apart players split into 4 teams (each of 3 players)

Simple assessed exercise You are given n players to be allocated to m teams (where n % m = 0). There are constraints of the form together(i,j) and apart(i,j) where together(i,j) means that players i and j must be in the same team apart(i,j) that players i and j must be in different teams. By default, players can be in any team with any other player. Team Allocator 12 4 together 3 9 together 5 9 apart 2 8 apart 6 8 Players 3 and 9 in same team Players 5 and 9 in same team

Simple assessed exercise You are given n players to be allocated to m teams (where n % m = 0). There are constraints of the form together(i,j) and apart(i,j) where together(i,j) means that players i and j must be in the same team apart(i,j) that players i and j must be in different teams. By default, players can be in any team with any other player. Team Allocator 12 4 together 3 9 together 5 9 apart 2 8 apart 6 8 Players 2 and 8 in different teams Players 6 and 8 in different teams

Simple assessed exercise You are given n players to be allocated to m teams (where n % m = 0). There are constraints of the form together(i,j) and apart(i,j) where together(i,j) means that players i and j must be in the same team apart(i,j) that players i and j must be in different teams. By default, players can be in any team with any other player. Team Allocator

They are given code

They have to add code

They are given problem instances

An example: txt

Create an array of constrained integer variables player[0] to player[11] Each has a domain {1..4}, the teams they can be in For apart(i,j) post constraint player[i] ≠ player[j] For together(i,j) post constraint player[i] = player[j] Use occurrence or cardinality constraint to ensure that each team occurs n/m times (i.e. number of players per team is satisfied) Simple solution (and an instance) Easy to get hands dirty

Create an array of constrained integer variables player[0] to player[11] Each has a domain {1..4}, the teams they can be in For apart(i,j) post constraint player[i] ≠ player[j] For together(i,j) post constraint player[i] = player[j] Use occurrence or cardinality constraint to ensure that each team occurs n/m times (i.e. number of players per team is satisfied) Simple solution (and an instance) Easy to get hands dirty A variant of equitable graph colouring

Use a 0/1 model, 2D array, row for team, column for player Use set variables, a set for each team Pre-processing Symmetry breaking Variable ordering heuristics We have hard instances (>12 hours to solve) Devoted 1 lecture to discussing problem after deadline Alternatives & richness

The dark side of ex01

Alternatives & richness The dark side of ex01

Google-proof? 20 animals escape from the zoo We have 5 cages to put them in Each cage can take at most 4 animals The following animals cannot be in the same cage The rabbit and the fox The spider and the fly The worm and the robin …

Simple assessed exercise It does take some effort to make an exercise

conclusion This went surprisingly well I think they liked the problem Generated a lot of discussion & interaction I think they got the idea of CP and the problems we can solve Not just mashing up data

… with a little help from my friends