Integrating a Real-World Scheduling Problem into the Basic Algorithms Course Yana Kortsarts Computer Science Department Widener University, Chester, PA.

Slides:



Advertisements
Similar presentations
Chapter 6 Matrix Algebra.
Advertisements

On the Complexity of Scheduling
Elementary Linear Algebra Anton & Rorres, 9th Edition
Solving LP Models Improving Search Special Form of Improving Search
Linear Programming (LP) (Chap.29)
GRAPH BALANCING. Scheduling on Unrelated Machines J1 J2 J3 J4 J5 M1 M2 M3.
C&O 355 Mathematical Programming Fall 2010 Lecture 22 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A.
Introduction to Algorithms
Dragan Jovicic Harvinder Singh
Matrices: Inverse Matrix
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
The Maximum Network Flow Problem. CSE Network Flows.
Linear Programming.
Applied Discrete Mathematics Week 12: Trees
ICS 6N Computational Linear Algebra
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Definition of complexity class NP –Nondeterministic computation –Problems.
Totally Unimodular Matrices Lecture 11: Feb 23 Simplex Algorithm Elliposid Algorithm.
1 Introduction to Linear and Integer Programming Lecture 9: Feb 14.
Approximation Algorithms
Computer Algorithms Integer Programming ECE 665 Professor Maciej Ciesielski By DFG.
NP-complete and NP-hard problems
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy under contract.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy under contract.
Linear Equations in Linear Algebra
5.6 Maximization and Minimization with Mixed Problem Constraints
Theory of Computing Lecture 19 MAS 714 Hartmut Klauck.
259 Lecture 14 Elementary Matrix Theory. 2 Matrix Definition  A matrix is a rectangular array of elements (usually numbers) written in rows and columns.
LINEAR PROGRAMMING SIMPLEX METHOD.
C&O 355 Mathematical Programming Fall 2010 Lecture 17 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A.
Systems of Linear Equation and Matrices
Chapter 3: The Fundamentals: Algorithms, the Integers, and Matrices
Presentation by: H. Sarper
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Approximating Minimum Bounded Degree Spanning Tree (MBDST) Mohit Singh and Lap Chi Lau “Approximating Minimum Bounded DegreeApproximating Minimum Bounded.
10/11/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 22 Network.
1 1.4 Linear Equations in Linear Algebra THE MATRIX EQUATION © 2016 Pearson Education, Inc.
CSE 421 Algorithms Richard Anderson Lecture 24 Network Flow Applications.
MIT and James Orlin1 NP-completeness in 2005.
Approximation Algorithms Department of Mathematics and Computer Science Drexel University.
Linear Programming Data Structures and Algorithms A.G. Malamos References: Algorithms, 2006, S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani Introduction.
Theory of Computing Lecture 13 MAS 714 Hartmut Klauck.
1 1.3 © 2012 Pearson Education, Inc. Linear Equations in Linear Algebra VECTOR EQUATIONS.
Approximation Algorithms
Operational Research & ManagementOperations Scheduling Workforce Scheduling 1.Days-Off Scheduling 2.Shift Scheduling 3. Cyclic Staffing Problem (& extensions)
10. Lecture WS 2006/07Bioinformatics III1 V10: Network Flows V10 follows closely chapter 12.1 in on „Flows and Cuts in Networks and Chapter 12.2 on “Solving.
Flows in Planar Graphs Hadi Mahzarnia. Outline O Introduction O Planar single commodity flow O Multicommodity flows for C 1 O Feasibility O Algorithm.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
Matrices Section 2.6. Section Summary Definition of a Matrix Matrix Arithmetic Transposes and Powers of Arithmetic Zero-One matrices.
CSE 589 Part V One of the symptoms of an approaching nervous breakdown is the belief that one’s work is terribly important. Bertrand Russell.
1 CS612 Algorithms for Electronic Design Automation CS 612 – Lecture 8 Lecture 8 Network Flow Based Modeling Mustafa Ozdal Computer Engineering Department,
Flow in Network. Graph, oriented graph, network A graph G =(V, E) is specified by a non empty set of nodes V and a set of edges E such that each edge.
CompSci 102 Discrete Math for Computer Science February 7, 2012 Prof. Rodger Slides modified from Rosen.
EMIS 8373: Integer Programming Column Generation updated 12 April 2005.
Exercise 6.1 Find the number of different shortest paths from point A to point B in a city with perfectly horizontal streets and vertical avenues as shown.
C&O 355 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Paths and circuits.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
Network Topology Single-level Diversity Coding System (DCS) An information source is encoded by a number of encoders. There are a number of decoders, each.
::Network Optimization:: Minimum Spanning Trees and Clustering Taufik Djatna, Dr.Eng. 1.
Lap Chi Lau we will only use slides 4 to 19
The Maximum Network Flow Problem
Topics in Algorithms Lap Chi Lau.
Algorithm Design Methods
Linear Programming (LP) (Chap.29)
49 0 A Hybrid LS-CP Solver for the Shifts and Breaks Design Problem
ME 521 Computer Aided Design 15-Optimization
CISC5835, Algorithms for Big Data
Algorithm Design Methods
Algorithm Design Methods
Presentation transcript:

Integrating a Real-World Scheduling Problem into the Basic Algorithms Course Yana Kortsarts Computer Science Department Widener University, Chester, PA

The SAP Problem The shifts assignment problem (SAP) is a scheduling problem that commonly arises in work-force management activities Input: A collection of shifts and work-force requirements Output: The number of workers to assign to each shift in order to fulfill a pre-specified staff requirements at every hour.

Definitions Working hours are denoted by 1, 2,.., n The [i, i + 1] hour is called the i-th hour of the day. The staffing requirement for the i-th hour is b i - the number of persons needed at work from time i until time i + 1. A shift I i is a consecutive integral subinterval [s i, s i + 1,..., f i ] of [1,..., n], s i < f i Shift I i covers a time j: the shift starts at time j or earlier and ends at time j +1 or later. If I i covers j we say that j  I i (time j belongs to shift i)

The SAP Problem Solution Defines how many persons x i are going to work in each shift I i. A solution is feasible if the number of workers present at time j is b j - the load bound for hour j (1  j  n, 1  i  m, m is a number of shifts) : A feasible solution might not exist.

Example First hour is 08 : 00 to 09 : 00 and n = 5. I 1 =[8:00, 9:00, 10:00] = [1, 2] I 2 = [11 : 00, 12 : 00] = [4] I 3 =[10:00, 11:00, 12:00, 13:00] = [3, 4, 5] The load requirements: 4, 4, 5, 8, 5 Solution: x 1 = 4, x 2 = 3, x 3 = 5 x 2 + x 3 = 8

SAP – Integer Linear Programming Problem Consider shifts I i as column vectors A shift I i (from s i to f i ) is represented by a vector that has all 0 entries except the s i to f i entries that are 1 Create a 0, 1 matrix A out of all column vectors I i. A is consecutive 1’s matrix. Let The problem is to find a solution for: or determine that no such solution exists.

Example I 1 =[8:00, 9:00, 10:00] = [1, 2] I 2 = [11 : 00, 12 : 00] = [ 4] I 3 =[10:00, 11:00, 12:00, 13:00] = [3, 4, 5] The load requirements: 4, 4, 5, 8, 5

SAP – Integer Linear Programming Problem SAP is an example of an integer linear programming (ILP) problem. The integer linear programming problem is NP-hard. Special case of integer linear programming over a consecutive 1’s matrix admits a simple solution by reduction to the max- flow problem

From SAP to Max Flow Problem Add an all-0 row before the first row to the shifts matrix A and vector b A is (n + 1)  m matrix. n+1 is the number of hours (including hour 0), the number of columns is m which is the number of shift types. M is (n+1)  (n+1) matrix. M has 1 in the main diagonal, and (−1) in the diagonal immediately above the main diagonal. Other entries are 0.

Multiply the equality Ax = b from the left by matrix M For 0  i < n row i in A is replaced by the row A i − A i+1 and row n does not change. A is a consecutive 1’s matrix. Matrix M  A has exactly two non-zero entries in every column. M  b = B = (-b 1, b 1 - b 2, … b n-1 - b n, b n ) T B = (B 1, B 2, …B n ), B i = b i – b i+1 The matrix M is invertible M  Ax = B is equivalent to Ax = b

EXAMPLE n = 5 (start: 8:00, finish: 12:00) Shifts: I 1 =[10:00, 11:00, 12:00], I 2 =[9:00, 10:00, 11:00, 12:00], I 3 =[8:00, 9:00, 10:00, 11:00, 12:00], I 4 =[12:00, 13:00], I 5 = [8:00, 9:00, 10:00, 11:00], I 6 = [8:00, 9:00, 10:00] Work load: 3, 3, 5, 2, 5

Network Flows A flow network is a weighted connected directed graph N(V,E) in which each edge (v i, v j ) has a nonnegative capacity c(v i, v j ) We also distinguish two vertices in N, a source s and a destination (sink) t A legal flow f in N is an assignment of a nonnegative real numbers f(e) to each edge e of N that satisfies two conditions:  Capacity constraints: For each edge e, 0  f(e)  c(e)  Flow conservation: For each vertex v in N other than s and t, the flow into v equals the flow out of it

Define the flow network N(A, b) The vertices of the network are v i, 0  i  n v i corresponds to row (hour) i in the matrix Add a source s and a sink t. The connection of the vertices to the source/sink are defined via the signs and values of B:  B i < 0: add an edge of capacity -B i from s to v i  B i > 0: add an edge of capacity B i from v i to t

The shifts define the edges between vertices. If shift starts at time q and ends at time p we add an edge from v q−1 to v p. The edge has infinite capacity. Each column j of the matrix M·A is represented by the edge e j Each e j with (M·A) kj = -1 and (M·A) ij =1 goes out of v k into v i

s v4v4 v2v2 v5v5 v0v0 v3v3 tv1v

SAP admits a feasible solution if and only if there is a saturating flow in N(A, b): there is a legal flow so that the flow along all edges entering t equals their capacity. The flow along edges gives the values to be given to shifts: a flow value f(e j ) on edge e j corresponds to the choice of x j = f(e j ) and vice-versa

s v4v4 v2v2 v5v5 v0v0 v3v3 tv1v1 3/3 2/2 3/3 5/5 Solution

Teaching SAP One of the arguments raised at times by students of the basic algorithms classes is that the material taught seems to be “detached” from real-world applications. This claim has some foundation. It seems useful and encouraging to illustrate for the students the power of the algorithms taught in the basic algorithms course through a real-world problem. A concrete application that is important enough for commercial companies to actually write a code for it.

Teaching SAP Solving the SAP problem is indeed a component in some real-world software applications, such as the OPA software designed by Ximes Inc. corporation, located in Vienna Could be integrated into content conventionally taught in the basic algorithms course which includes polynomial time algorithms for the maximum flow problem. Illustrates practical application of flow algorithms

Teaching SAP Illustrates the importance of the seemingly abstract topic of linear algebra in real-world problems Allows to introduce a fundamental problem: integer linear programming, which is a central problem in combinatorial optimization SAP is an excellent programming project. The students gain experience in important things such as constructing graphs, multiplying matrices, and programming classic algorithms for maximum flow.

References [1] N. Balakrishnan and R.T. Wong, A network model for the rotating workforce scheduling problem, Networks, 20:25–42, [2] J.J. Bartholdi, J.B. Orlin, and H.D. Ratliff, Cyclic scheduling via integer programs with circular ones, Operations Research, 28:110–118, [3] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein, Introduction to Algorithms, Second Edition. MIT press, [4] T.G. Crainic, M. Gendreau, and J.M. Farvolden, A simplex-based tabu search for capacitated network design, INFORMS Journal on Computing, 12(3), [5] J. R. Driscoll, H. N. Gabow, R. Shrairman, and R. E. Tarjan, Relaxed heaps: An alternative to fibonacci heaps with applications to parallel computation, Communications of the ACM, 31(11):1343–1354, [6] Michael R. Garey and David S. Johnson, Computers and Intractability: A Guide to the Theory of NP-Completeness, Freeman and Co., [7] Johannes G¨artner, Nysret Musliu, and Wolfgang Slany, Rota: a research project on algorithms for workforce scheduling and shift design optimization, AI Communications: The European Journal on Artificial Intelligence, 14(2):83–92, [8] Fred Glover and Manuel Laguna, Tabu search, Kluwer Academic Publishers, 1997.

References [9] V. Klee and G. Minty, How good is the simplex algorithm? Academic Press, In Shisha, O., ed.: Inequalities, Volume III. [10] S. R. Kosaraju and A. L. Delcher, Large-scale assembly of DNA strings and space-efficient construction of suffix trees, In Proceedings of the twenty- seventh annual ACM symposium on Theory of computing, pages 169 – 177, [11] G. Laporte, The art and science of designing rotating schedules, Journal of the Operational Research Society, 50:1011–1017, [12] Nysret Musliu, Johannes G¨artner, and Wolfgang Slany, Efficient generation of rotating workforce schedules, Discrete Applied Mathematics, 118(1-2):85– 98, [13] Nysret Musliu, Andrea Schaerf, and Wolfgang Slany, Local search for shift design, European Journal of Operational Research (to appear). [14] Nysret Musliu, Andrea Schaerf, and Wolfgang Slany, Local search for shift design, Technical Report DBAI-TR , Technische Universit ¨at Wien, 2001, [15] G.M. Thompson, A simulated-annealing heuristic for shift scheduling using non-continuously available employees, Comput. Oper. Res., 23(3):275–288, 1996.