G53CLP Constraint Logic Programming Constraint Optimisation Problems – Demos in OPL Studio Dr Rong Qu.

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick Recursion rA recursive function must have at least two parts l A part that solves a simple case of the.
Advertisements

Examples for Discrete Constraint Programming
CPAIOR02 School on OptimizationC. Le Pape1 Integrating Operations Research Algorithms in Constraint Programming Claude Le Pape ILOG S.A.
Algorithm Design Methods Spring 2007 CSE, POSTECH.
Modelling with Finite Domains u Domains and Labelling u Complex Constraints u Labelling u Different Problem Modellings u Efficiency u Using SICStus Prolog.
 Review: The Greedy Method
Linear Programming. Introduction: Linear Programming deals with the optimization (max. or min.) of a function of variables, known as ‘objective function’,
IP modeling techniques I In this handout, Modeling techniques:  Using binary variables  Restrictions on number of options  Contingent decisions  Variables.
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
Planning with Linear Programming
1 Chapter 8: Modelling with Finite Domain Constraints Where we examine how modelling and controlling search interact with finite domain constraints.
G53CLP Constraint Logic Programming Modeling CSPs – Case Study I Dr Rong Qu.
5-1 Chapter 5 Tree Searching Strategies. 5-2 Satisfiability problem Tree representation of 8 assignments. If there are n variables x 1, x 2, …,x n, then.
Quantitative Techniques for Decision Making M.P. Gupta & R.B. Khanna © Prentice Hall India LINEAR PROGRAMMING GRAPHIC METHOD 2 CHAPTER.
6 - 1 § 6 The Searching Strategies e.g. satisfiability problem x1x1 x2x2 x3x3 FFF FFT FTF FTT TFF TFT TTF TTT.
Integer Programming Integer programming is a solution method for many discrete optimization problems Programming = Planning in this context Origins go.
By Neng-Fa Zhou1 Solving Constraint Satisfaction and Optimization Problems with CLP(FD) Neng-Fa Zhou The City University of New York
Flow of Control MINS298c Fall 1998 Chapter 9. Overview ABAP Programming Structures for: –Iteration –Decisions Control Flow –If … Then –Do & While loops.
D1: Linear Programming.
VARIABLES AND EXPRESSIONS NUMERICAL EXPRESSION A NAME FOR A NUMBER VARIABLE OR ALGEBRAIC EXPRESSION AN EXPRESSION THAT CONTAINS AT LEAST ONE VARIABLE.
Integer Programming and Logic-Based Modeling Jan Fábry, Jan Pelikán ___________________________________________________________________________ MME 2003,
A GAMS TUTORIAL. WHAT IS GAMS ? General Algebraic Modeling System Modeling linear, nonlinear and mixed integer optimization problems Useful with large,
A Constraint Programming Approach to Solving a Ship Loading Problem Andreas Jordan Professor Markus Stumptner.
Module B: Linear Programming
Network Models (2) Tran Van Hoai Faculty of Computer Science & Engineering HCMC University of Technology Tran Van Hoai.
Formulas and Literal Equations Unit 4, Lesson 6. Literal Equation A literal equation is __________________ _____________________________________ _____________________________________.
Graph Colouring Various Models. an obvious model SAT sets demo random graphs chromatic number maxCol phase transition.
Event Scheduling Using Constraint Programming November 22, 2002 Martin Henz, School of Computing, NUS
Integer Programming Key characteristic of an Integer Program (IP) or Mixed Integer Linear Program (MILP): One or more of the decision variable must be.
Advanced Algorithms Analysis and Design By Syed Hasnain Haider.
LECTURE 13. Course: “Design of Systems: Structural Approach” Dept. “Communication Networks &Systems”, Faculty of Radioengineering & Cybernetics Moscow.
3 -1 Chapter 3 The Greedy Method 3 -2 A simple example Problem: Pick k numbers out of n numbers such that the sum of these k numbers is the largest.
A Second Look at Constraint Programming February 17/18, 2000.
|
Chapters 1-5 Review C++ Class. Chapter 1 – the big picture Objects Class Inheritance Reusability Polymorphism and Overloading.
Nurse scheduling problem 25 nurses ( Team A:13, B:12 ) Experienced nurses and new nurses 3 shifts ( day, evening, night ), meetings, days off Time span.
Scheduling with Constraint Programming February 24/25, 2000.
Arithmetic Expressions Addition (+) Subtraction (-) Multiplication (*) Division (/) –Integer –Real Number Mod Operator (%) Same as regular Depends on the.
1 CSC 1401 S1 Computer Programming I Hamid Harroud School of Science and Engineering, Akhawayn University
G53CLP Constraint Logic Programming
4.3 Functions. Functions Last class we talked about the idea and organization of a function. Today we talk about how to program them.
Lecture 6 Knapsack Problem Quadratic Assignment Problem
Algorithm Design Methods 황승원 Fall 2011 CSE, POSTECH.
Integer Programming Definition of Integer Programming If requiring integer values is the only way in which a problem deviates from.
Linear Programming.  Linear Programming provides methods for allocating limited resources among competing activities in an optimal way.  Linear → All.
G53CLP Constraint Logic Programming Modeling CSPs – Case Study II Dr Rong Qu.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
Optimizing SMU Student Senate Budgeting Procedure Kevin Lavelle.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
11D Applications of linear programming. There are three types of applications that we look at in Further Maths – Manufacturing problems (Ex 11C) – Blending.
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
HPC 2.6 – Operations on Functions; Composite Functions Learning Targets: -Form the sum, difference, product, and quotient of two functions. -Form the composite.
Algorithm Design Methods
Linear Programming A firm sells bags of sugar in two sizes, 1 kg and 500 g. In one day the factory can process 5000 kg of sugar and pack a maximum of 7000.
Basic C++ What’s a declaration? What’s a definition?
Exam 2 LZW not on syllabus. 73% / 75%.
Number partitioning.
1.4 Rewriting Equations.
A QUICK START TO OPL IBM ILOG OPL V6.3 > Starting Kit >
For this assignment, copy and past the XHTML to a notepad file with the .html extension. Then add the code I ask for to complete the problems.
Algorithm Design Methods
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
Lecture 6 Greedy Algorithms
Algorithm Design Methods
1. Introduction.
The Greedy Approach Young CS 530 Adv. Algo. Greedy.
Differentiation and Optimisation
Dynamic Programming Sequence of decisions. Problem state.
Algorithm Design Methods
Presentation transcript:

G53CLP Constraint Logic Programming Constraint Optimisation Problems – Demos in OPL Studio Dr Rong Qu

2 SEND MORE MONEY - model S E N D + M O R E = M O N E Y Variables: Domain: G53CLP – Constraint Logic ProgrammingDr R. Qu

3 SEND MORE MONEY - model //.mod file //declaration //variables enum Letters {S, E, N, D, M, O, R, Y}; //domain var int l[Letters] in 0..9; … G53CLP – Constraint Logic ProgrammingDr R. Qu

4 SEND MORE MONEY - model //.mod file //declaration … //problem - constraints solve { alldifferent(l) onDomain; l[S] <> 0; l[M] <> 0;... }; G53CLP – Constraint Logic ProgrammingDr R. Qu

5 SEND MORE MONEY - model //.mod file //declaration … //problem - constraints solve { *l[S] + 100*l[E] + 10*l[N] + l[D] *l[M] + 100*l[O] + 10*l[R] + l[E] = 10000*l[M] *l[O] + 100*l[N] + 10*l[E] + l[Y]; }; G53CLP – Constraint Logic ProgrammingDr R. Qu

G52AIP – AI Programming 6 SEND MORE MONEY - model

G52AIP – AI Programming 7 SEND MORE MONEY – decision tree

8 SEND MOST MONEY – model S E N D + M O S T = M O N E Y Variables: Domain: G53CLP – Constraint Logic ProgrammingDr R. Qu

9 Smuggler’s Knapsack Problem A smuggler has a knapsack of capacity 9 He can only make one trip He can smuggle Bottles of whiskysize 4profit 15 Bottles of perfumesize 3profit 10 Cartons of cigarettessize 2profit 7 He wants At least a profit of 30 Maximise the profit G53CLP – Constraint Logic ProgrammingDr R. Qu

10 Smuggler’s Knapsack Problem Variables W, P, C Domain {0, …, 9} Constraints 4*W + 3*P + 2*C <= 9; 15*W + 10*P + 7*C >=30; Bottles of whisky size 4 profit 15 Bottles of perfume size 3 profit 10 Cartons of cigarettes size 2 profit 7 G53CLP – Constraint Logic ProgrammingDr R. Qu

11 Knapsack Problems Which items should be put in the bag to maximise the profit G53CLP – Constraint Logic ProgrammingDr R. Qu

12 Knapsack Problems General problems Given a number of items with associated costs and values Determine the collection of items so that Total cost is minimised, or within a limit Total value is maximised G53CLP – Constraint Logic ProgrammingDr R. Qu

13 Simple Assignment Problem In a factory 4 workers 4 products Profits of assigning workers to products Each worker has one product Each product is assigned to one worker At least total profit >= 19 p1p2p3p4 w17134 w28251 w34372 w43163 G53CLP – Constraint Logic ProgrammingDr R. Qu

14 Simple Assignment Problem Variables l i,j : worker i assigned to product j Domain 0, 1 Constraints sum (l i ) = 1, i={..4} sum (weight i,j * l i,j ) >= 19 G53CLP – Constraint Logic ProgrammingDr R. Qu