Matrix Modelling Alan M. Frisch and Ian Miguel (York) Brahim Hnich, Zeynep Kiziltan (Uppsala) Toby Walsh (Cork)

Slides:



Advertisements
Similar presentations
Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
Advertisements

Non-Binary Constraint Satisfaction Toby Walsh Cork Constraint Computation Center.
Modelling a Steel Mill Slab Design Problem Alan Frisch, Ian Miguel, Toby Walsh AI Group University of York.
Global Constraints Toby Walsh National ICT Australia and University of New South Wales
Global Constraints Toby Walsh National ICT Australia and University of New South Wales
Global Constraints Toby Walsh NICTA and University of New South Wales
IP modeling techniques I In this handout, Modeling techniques:  Using binary variables  Restrictions on number of options  Contingent decisions  Variables.
Reducing Symmetry in Matrix Models Alan Frisch, Ian Miguel, Toby Walsh (York) Pierre Flener, Brahim Hnich, Zeynep Kiziltan, Justin Pearson (Uppsala)
Case study 5: balanced academic curriculum problem Joint work with Brahim Hnich and Zeynep Kiziltan (CPAIOR 2002)
Generating Implied Constraints via Proof Planning Alan Frisch, Ian Miguel, Toby Walsh Dept of CS University of York EPSRC funded project GR/N16129.
Leeds: 6 June 02Constraint Technology for the Masses Alan M. Frisch Artificial Intelligence Group Department of Computer Science University of York Collaborators:
Matrices: Inverse Matrix
MATH 685/ CSI 700/ OR 682 Lecture Notes
Chapter 1 Computing Tools Data Representation, Accuracy and Precision Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Transforming and Refining Abstract Constraint Specifications Alan Frisch, Brahim Hnich*, Ian Miguel, Barbara Smith, and Toby Walsh *Cork Constraint Computation.
Making Choices using Structure at the Instance Level within a Case Based Reasoning Framework Cormac Gebruers*, Alessio Guerri †, Brahim Hnich* & Michela.
Approximation Algoirthms: Semidefinite Programming Lecture 19: Mar 22.
Symmetry as a Prelude to Implied Constraints Alan Frisch, Ian Miguel, Toby Walsh University of York.
Semidefinite Programming
Alan M. Frisch Artificial Intelligence Group Department of Computer Science University of York Extending the Reach of Constraint Technology through Reformulation.
CGRASS A System for Transforming Constraint Satisfaction Problems Alan Frisch, Ian Miguel AI Group University of York Toby Walsh 4C.
Matrix Modelling Pierre Flener (Uppsala) Alan M. Frisch (York) Brahim Hnich, Zeynep Kiziltan (Uppsala) Ian Miguel, and Toby Walsh (York)
Reducing Symmetry in Matrix Models Alan Frisch, Ian Miguel, Toby Walsh (York) Pierre Flener, Brahim Hnich, Zeynep Kiziltan, Justin Pearson (Uppsala)
Modeling the Covering Test Problem Brahim Hnich, Steven Prestwich, and Evgeny Selensky Cork Constraint Computation Center UCC Supported by SFI.
Alan M. Frisch Artificial Intelligence Group Department of Computer Science University of York Co-authors Ian Miguel, Toby Walsh, Pierre Flener, Brahim.
CGRASS A System for Transforming Constraint Satisfaction Problems Alan Frisch, Ian Miguel (York) Toby Walsh (Cork)
Constraint Systems Laboratory 11/22/2005Zheng – Comprehensive1 Survey of Techniques for Detecting and Exploiting Symmetry in Constraint Satisfaction Problems.
Matrix Modelling: Déjà Vu Pierre Flener (Uppsala) Alan M. Frisch (York) Brahim Hnich, Zeynep Kiziltan (Uppsala) Ian Miguel, and Toby Walsh (York)
Global Constraints for Lexicographic Orderings Alan Frisch, Ian Miguel (University of York) Brahim Hnich, Toby Walsh (4C) Zeynep Kiziltan (Uppsala University)
Modelling a Steel Mill Slab Design Problem Alan Frisch, Ian Miguel, Toby Walsh AI Group University of York.
HAWKES LEARNING SYSTEMS math courseware specialists Copyright © 2011 Hawkes Learning Systems. All rights reserved. Hawkes Learning Systems College Algebra.
1 Chapter 2 Matrices Matrices provide an orderly way of arranging values or functions to enhance the analysis of systems in a systematic manner. Their.
Chapter 7 Matrix Mathematics Matrix Operations Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Matrices Write and Augmented Matrix of a system of Linear Equations Write the system from the augmented matrix Solve Systems of Linear Equations using.
Constraint Patterns Toby Walsh 4C, UCC & Uppsala.
ECON 1150 Matrix Operations Special Matrices
Square n-by-n Matrix.
MA2213 Lecture 5 Linear Equations (Direct Solvers)
Symmetry Breaking Ordering Constraints Zeynep Kiziltan Department of Information Science Uppsala University, Sweden A progress.
4.6 Matrix Equations and Systems of Linear Equations In this section, you will study matrix equations and how to use them to solve systems of linear equations.
Section 3.6 – Solving Systems Using Matrices
10.4 Matrix Algebra 1.Matrix Notation 2.Sum/Difference of 2 matrices 3.Scalar multiple 4.Product of 2 matrices 5.Identity Matrix 6.Inverse of a matrix.
Matrices. Definitions  A matrix is an m x n array of scalars, arranged conceptually as m rows and n columns.  m is referred to as the row dimension.
Modelling for Constraint Programming Barbara Smith CP 2010 Doctoral Programme.
Constraint Programming Research at York 1. Modelling 2. Symmetry Breaking 3. SAT 4. Applications Allocating orders to steel slabs in a steel mill Distribution.
The AllDifferent Constraint: Efficiency Measures Ian P. Gent, Ian Miguel, Peter Nightingale.
Sports Scheduling Written by Kelly Easton, George Nemhauser, Michael Trick Presented by Matthew Lai.
CP Summer School Modelling for Constraint Programming Barbara Smith 4. Combining Viewpoints, Modelling Advice.
Working with Arrays in MATLAB
Relations, Functions, and Matrices Mathematical Structures for Computer Science Chapter 4 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Relations, Functions.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
© J. Christopher Beck Lecture 21: IP and CP Models for Sports Scheduling.
WOOD 492 MODELLING FOR DECISION SUPPORT Lecture 18 Branch and Bound Algorithm.
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
CP Summer School Modelling for Constraint Programming Barbara Smith 3. Symmetry, Viewpoints.
Dynamic Symmetry breaking with AI and Algebra. Iain McDonald Dynamic Symmetry breaking with AI and Algebra.
How do you analyze and figure out what does not fit?
Introduction to Integer Programming Integer programming models Thursday, April 4 Handouts: Lecture Notes.
10.3 Reformulation The Lex-Leader Method Shant Karakashian 1.
Chapter 1 Computing Tools Variables, Scalars, and Arrays Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Part 3 Linear Programming
The assignment problem
Why network models? Visualize a mathematical model
Part 3 Linear Programming
Chapter 6. Large Scale Optimization
A more complex LP problem
Part 3 Linear Programming
THE DIMENSION OF A VECTOR SPACE
Chapter 6. Large Scale Optimization
Presentation transcript:

Matrix Modelling Alan M. Frisch and Ian Miguel (York) Brahim Hnich, Zeynep Kiziltan (Uppsala) Toby Walsh (Cork)

What is matrix modelling?  Constraint programs with one or more matrix of decision vars  Common patterns in such models Extend modelling languages & solvers to exploit them

Obvious matrix models  Often the problem has a matrix in the specification  Many timetabling and scheduling problems Mike Trick schedules the College baseball league using a matrix model!

Sports scheduling. 0 vs 72 vs 72 vs 60 vs 41 vs 63 vs 54 vs 5Period 3 0 vs 5 1 vs 4 3 vs 7 Week 5 3 vs 4 0 vs 6 1 vs 5 Week 6 1 vs 31 vs 22 vs 54 vs 66 vs 7Period 4 5 vs 65 vs 70 vs 31 vs 72 vs 3Period 2 2 vs 43 vs 64 vs 70 vs 20 vs 1Period 1 Week 7Week 4Week 3Week 2Week 1 Regin’s Round Robin Tournament model

Matrix modelling  Matrix models are very common in other applications Even if the matrix is not so obvious in the problem specification

Example: warehouse location  Supply chain management  How many warehouses do we build and where do we build them? One in the middle of the US One on each coast …  Problem (and solution) taken from OPL manual

Matrix model: variables 0..1 Store Warehouse Supply 0..1 Open Warehouse

Matrix model:constraints  Each store has a warehouse: row sum Supply=1  Warehouse capacity: column sum Supply <= ci  Channelling constraints: Supply[i,j]=1 implies Open[i]=1  Optimization variable: Cost = matrix sum Supply[i,j]*distcost[i,j] + opencost * row sum Open 0..1 Open Warehouse 0..1 Store Warehouse Supply

Matrix model: spot the difference! 0..1 Store Warehouse Supply 0..1 Open  =1 …  <c1  <c2 …

Matrix model: spot the difference! 0..1 Course Periods Sched 0..l0..1 Load  =1 … l<  <d l<  <d …

Balance academic curriculum problem  Very similar matrix model Channelling now to weighted sum not 0/1 var Optimization var changes  Matrix modelling Exploiting these patterns Provide high level primitives To state such problems compactly To reason effectively

Diversity of matrix models  Combinatorial problems BIBDs, magic squares, projective planes, …  Design Rack configuration, template and slab design, …  Scheduling Classroom, social golfer, …  Assignment Warehouse location, progressive party, …

Why matrix model?  Ease of problem statement Side constraints, variable indexing, …  Improved constraint propagation Symmetry breaking, indistinguishable values, linear models, … Suggests two lines of attack 1.Matrix operations should become first class objects in constraint programming languages. 2.MATLAB should be extended so it is a constraint modelling language

Common constraint types  Row or column sum  Weighted row/column sum  Single non-zero entry  Matrix sum  Scalar product  Channelling  Ordering rows/matrices This pretty much describes all the examples! These constraints should be provided as language primitives? Efficient and powerful propagators developed?

Ease of problem statement  Steel mill slab design  Nasty “colour” constraint Stops it being simple knapsack problem  Channel into matrix model Colour constraint easily and efficiently stated

Steel mill slab design possible slab sizes (1, 3 or 4), 9 orders 5 colours, but only 2 allowed on any one slab abcdefghi

Example solution f gi e cd b h a (size 4)(size 3)(size 1) (size 3)(size 1) 2

Matrix model for the slab design problem oaoa obob ococ odod oeoe ofof ogog ohoh oioi oaoa obob ococ odod oeoe ofof ogog ohoh oioi s1s1 1 s2s2 1 … RedGreenBlueOrangeBrown s1s1 1 s2s2 1 … Col sum=1, row sum<slab size Col sum=1, row sum<2

Example solution oaoa obob ococ odod oeoe ofof ogog ohoh oioi oaoa obob ococ odod oeoe ofof ogog ohoh oioi s1s s2s s3s s4s … RedGreenBlueOrangeBrown s1s s2s s3s s4s …00000 s 1 = 4, s 2 = 3, s 3 = 3, s 4 = 3

Improved propagation  Warehouse location Could have used 1-d matrix, Supply(store)=warehouse But then warehouse capacity constraint Difficult to state  Need to sum demand from all stores such that Supply(store)=warehouse Difficult to propagate

Improved propagation  Warehouse location Instead of 1-d matrix, Supply(store)=warehouse We used 2-d matrix, Supply(store,warehouse)=0/1 2-d matrix allows us to use purely linear constraints => can even use LP solver

Symmetry breaking  Often rows or columns (or both) are symmetric All weeks (cols) can be permuted in a timetable All slabs (rows) of same size can be permuted  Lex order rows/cols Can do both if row and cols are both symmetric Efficient O(n) GAC algorithm, patent pending Never work with children or animals

Lexicographically ordering rows breaks all row symmetry Lexicographically ordering cols breaks all col symmetry Symmetry-breaking

Lexicographically ordering both rows & cols does not break all row & col symmetry: Symmetry-breaking problem Other techniques for dealing with symmetry like SBDS also have problems as there are n! symmetries

Indistinguishable values  Values in problem can be indistinguishable In progressive party problem: Assign(guest,period)=host But host boats of same size are indistinguishable  Channel into 0/1 matrix with extra dimension Assign3(guest,period,host)=0/1 Value symmetry => variable symmetry

Transforming value symmetry into variable symmetry  Suppose all values are indistinguishable {b, d}ca abcdabcd Now the rows are indistinguishable So we are in a previously solved case!

Variable indexing  Use variables to index into arrays E.g. channelling in progressive party problem Assign3(guest,period,Assign(guest,period))=1 compared to Assign3(guest,period,host)=1 iff Assign(guest,period)=host Reduces number of constraints from cubic to quadratic Hooker (and others) argue that such indexing is one of the significant advantages CP has over IP

Conclusions  Matrix models common  Common types of constraints posted on matrices Row/column sum, symmetry breaking, channelling, …  Matrix operations should be made first-class objects in modelling languages MATLAB, EXCEL, …