Scheduling Using Timed Automata Borzoo Bonakdarpour Wednesday, April 13, 2005 Selected Topics in Algorithms and Complexity (CSE960)

Slides:



Advertisements
Similar presentations
On the Complexity of Scheduling
Advertisements

Priority INHERITANCE PROTOCOLS
Graphs and Finding your way in the wilderness
1 Fault Diagnosis for Timed Automata Stavros Tripakis VERIMAG.
UPPAAL Introduction Chien-Liang Chen.
Hybrid Systems Presented by: Arnab De Anand S. An Intuitive Introduction to Hybrid Systems Discrete program with an analog environment. What does it mean?
Timed Automata.
ISE480 Sequencing and Scheduling Izmir University of Economics ISE Fall Semestre.
Parallel Scheduling of Complex DAGs under Uncertainty Grzegorz Malewicz.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1 Formal Models for Stability Analysis : Verifying Average Dwell Time * Sayan Mitra MIT,CSAIL Research Qualifying Exam 20 th December.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
Formal Software Testing and Model Checking Generating Test Cases For a Timed I/O Automaton Model Leonid Mokrushin.
Model Checking Lecture 5. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Conditional scheduling with varying deadlines Ben Horowitz
1 Single Machine Deterministic Models Jobs: J 1, J 2,..., J n Assumptions: The machine is always available throughout the scheduling period. The machine.
Job Release-Time Design in Stochastic Manufacturing Systems Using Perturbation Analysis By: Dongping Song Supervisors: Dr. C.Hicks & Dr. C.F.Earl Department.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy under contract.
Chapter 11: Limitations of Algorithmic Power
Planning operation start times for the manufacture of capital products with uncertain processing times and resource constraints D.P. Song, Dr. C.Hicks.
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy under contract.
1 Completeness and Complexity of Bounded Model Checking.
Model Checking Lecture 5. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Abstract Verification is traditionally done by determining the truth of a temporal formula (the specification) with respect to a timed transition system.
Sequencing Problem.
Scheduling Parallel Task
INTRODUCTION TO SCHEDULING
Toshihide IBARAKI Mikio KUBO Tomoyasu MASUDA Takeaki UNO Mutsunori YAGIURA Effective Local Search Algorithms for the Vehicle Routing Problem with General.
Regular Model Checking Ahmed Bouajjani,Benget Jonsson, Marcus Nillson and Tayssir Touili Moran Ben Tulila
1 Outline:  Outline of the algorithm  MILP formulation  Experimental Results  Conclusions and Remarks Advances in solving scheduling problems with.
Transformation of Timed Automata into Mixed Integer Linear Programs Sebastian Panek.
Introduction to Job Shop Scheduling Problem Qianjun Xu Oct. 30, 2001.
Computer Science and Engineering Parallel and Distributed Processing CSE 8380 March 01, 2005 Session 14.
Pushdown Automata (PDAs)
Batch Scheduling of Conflicting Jobs Hadas Shachnai The Technion Based on joint papers with L. Epstein, M. M. Halldórsson and A. Levin.
Dina Workshop Analysing Properties of Hybrid Systems Rafael Wisniewski Aalborg University.
Formal Engineering Research with Models Abstractions and Transformations FERMAT Low Power Hardware Synthesis from Concurrent Action Oriented Specifications.
Lecture51 Timed Automata II CS 5270 Lecture 5.
CS5270 Lecture 41 Timed Automata I CS 5270 Lecture 4.
1 Short Term Scheduling. 2  Planning horizon is short  Multiple unique jobs (tasks) with varying processing times and due dates  Multiple unique jobs.
Approximation Schemes Open Shop Problem. O||C max and Om||C max {J 1,..., J n } is set of jobs. {M 1,..., M m } is set of machines. J i : {O i1,..., O.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Lecture 81 Optimizing CTL Model checking + Model checking TCTL CS 5270 Lecture 9.
CSC 8420 Advanced Operating Systems Georgia State University Yi Pan.
Flows in Planar Graphs Hadi Mahzarnia. Outline O Introduction O Planar single commodity flow O Multicommodity flows for C 1 O Feasibility O Algorithm.
Outline Introduction Minimizing the makespan Minimizing total flowtime
1 Outline:  Optimization of Timed Systems  TA-Modeling of Scheduling Tasks  Transformation of TA into Mixed-Integer Programs  Tree Search for TA using.
Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
Maximum Flow Problem (Thanks to Jim Orlin & MIT OCW)
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
Static Process Scheduling
Network Flow Problems Example of Network Flow problems:
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Problems in Combinatorial Optimization. Linear Programming.
Controller Synthesis For Timed Automata Authors : Eugene Asarin, Oded Maler, Amir Pnueli and Joseph Sifakis Yean-Ru Chen Embedded System Laboratory of.
TU/e Algorithms (2IL15) – Lecture 9 1 NP-Completeness NOT AND OR AND NOT AND.
Carnegie Mellon Lecture 8 Software Pipelining I. Introduction II. Problem Formulation III. Algorithm Reading: Chapter 10.5 – 10.6 M. LamCS243: Software.
Process Scheduling Schedulers and Scheduling Methods.
Progress Report 07/30. Virtual Core Scheduling Problem For every time period, the hypervisor scheduler is given a set of virtual cores with their operating.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Approximation Algorithms based on linear programming.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Scheduling with Constraint Programming
SS 2017 Software Verification Timed Automata
Instructor: Rajeev Alur
CprE 458/558: Real-Time Systems
Timed Automata Formal Systems Pallab Dasgupta Professor,
High-Level Abstraction of Concurrent Finite Automata
CSEP590 – Model Checking and Automated Verification
Presentation transcript:

Scheduling Using Timed Automata Borzoo Bonakdarpour Wednesday, April 13, 2005 Selected Topics in Algorithms and Complexity (CSE960)

Based on 1.Y. Abdeddaim, O. Maler, Job-shop scheduling using timed automata, Y. Abdeddaim, O. Maler, Scheduling under uncertainty using timed automata, Y. Abdeddaim, O. Maler, Task graph scheduling using timed automata, Krac, Wi, Decidable and undecidable problem in scheduling analysis using timed automata, 2004

Outline Preliminaries: –Timed automata –Job-Shop Scheduling Job-Shop Scheduling Using Timed Automata Scheduling under Uncertainty Task Graph Scheduling Decidable and Undecidable Problems Discussion & Future Work

TIMED AUTOMATA PART I

Preliminaries Timed automata is traditional finite state automata equipped with clock variables and timing constraints. It has been accepted as the standard formalism to model real- time programs. Initially, it was introduced for model checking and verification, but has been recently used for program synthesis and scheduling.

Clock Variables For a set X of clocks, the set  (X) of clock constraints g is defined by the grammar: g := x  c | c  x | x < c | c < x | g  g where x  X and c  Q is a rational number. A clock valuation is a function v : X  R v(x) is the value of clock variable x. All clock values increase with the same speed. u = v[Y := 0] for Y  X is a clock valuation for X such that   x  Y: v(x) = 0  Agrees with v over the rest of the clocks.

Timed Automata Formally, a timed automaton is a tuple where – V : set of locations, – V 0 : set of initial locations, – V F : set of final locations, – X : set of clocks, – E  (V   (X)  2 X  V ) is a set of transitions. s0s0 g, [ ] s1s1 The state of a real-time program is a pair (s, v) such that s is a location and v is a clock valuation for X. :

Timed Automata (cont.) Types of transitions: – Elapse of time: (s, v)  (s, v + t1) s 0 x = 3 y = 1 s 0 x = 4 y = 2 t = 1 s 0 x = 3 y = 1 s 1 x = 0 y = 1.2 [ x := 0 ] – Location switch: (s, v)  (s', v ' ) where v ' = v[ :=0] 0 t A run of the automaton is a finite sequence of transitions:  = (s 0, v 0 )  (s 1, v 1 )  …  (s n, v n ) t1t1 tntn t2t2

Example s2s2 s3s3 s1s1 s0s0 y := 0 (y = 1)?(x < 1)? (x > 1)? (x < 1)? Question: is s 3 reachable via s 2 ?

JOB-SHOP SCHEDULING PART II

Job-Shop Scheduling M is a set of machines Each job J is a triple (k, , d) where –k  N, the number of tasks –  : {1..k}  M, assignment of machines to tasks –d : {1..k}  N, duration of every task A job-shop specification is a set J = {J 1, J 2, …, J n } of jobs J i = (k i,  i, d i ) Assumptions: –A job can wait arbitrary amount of time between two tasks –No preemption

Schedules A feasible schedule for J is a relation S  J  K  T so that (i, j, t)  S indicates that job J i is busy doing jth task at time t, which satisfies: –Ordering: (i, j, t)  S and (i, j ', t ' )  S then j < j ' implies t < t ' –Covering & No preemption: For all i, j the set {t: (i, j, t)  S} is nonempty and in the form [r, r + d] and d  d i (j) –Mutual exclusion: (i, j, t)  S and (i ', j ', t)  S then  i (j)   i’ (j ' ) The length of a schedule is the maximal t over all (i, j, t)  S The optimal job-shop scheduling problem is to find a minimal length. It is known to be NP-hard.

Example M = {m 1, m 2 } J 1 = (m 1, 4), (m 2, 5) J 2 = (m 1, 3) 12 m1m1 m2m2 J1J1 J2J2 J1J1 (b) 9 m1m1 m2m2 J1J1 J2J2 J1J1 (a)

Laziness A schedule S is lazy at task j of job i if immediately before starting that task there an interval in which both the job and the corresponding machine are idle. J1J1 J2J2 m1m1 m2m2 m1m1 m2m2 J3J3 m1m1 (a) J1J1 J2J2 m1m1 m2m2 m1m1 m2m2 J3J3 m1m1 (b)

Job-shop Timed Automata 1.Constructing Job Timed Automaton ( A i ) for each job J i : One clock that represents the elapse of time for each task. Two states for each task j such that  (j) = m  m: indicates that the task is waiting to start on machine m  m: indicates that the task is executing on machine m Timing constraints is based on the duration of tasks

Example m1m1 M = {m 1, m 2 } J 1 = (m 1, 4), (m 2, 5) J 2 = (m 1, 3) m1m1 c 1 := 0 m2m2 c 1  4 m2m2 c 1 := 0 f c 1  5 J1J1 m1m1 m1m1 c 2 := 0 f c 2  3 J2J2

2.Constructing mutual exclusion composition ( A ) of the job timed automata An n-tuple q = (q 1, …, q n )  (M  M  {f}) n is conflicting if it contains two components q a = q b = m  M We compose the individual job timed automata such that in the final timed automaton  Does not contain conflicting states  Every transition of A satisfies the properties of A i for all i Job-shop Timed Automata (cont.)

Example m1m1 m1m1 c 1 := 0 m2m2 c 1  4 m2m2 c 1 := 0 f c 1  5 J1J1 m1m1 m1m1 c 2 := 0 f c 2  3 J2J2 m1,m1,m1m1 m1,m1,m1m1 m1,m1,f m1m1 m1,m1,m 1, m 1 m 1, f m2,m2,m1m1 m2,m2,m1m1 m2,m2,f m1m1 m2,m2,m 2, m 1 m 2, f m1m1 f,f, f, f c 2 := 0 c 2  3 c 1 := 0 c 1  4 c 1 := 0 c 1  5 c 2 := 0 c 2  3 c 1  4 c 1 := 0 c 1  5 c 2 := 0 c 2  3 c 2 := 0 c 1  5 c 1 := 0

Schedules and Runs A run  is complete if it starts at (s, 0) and ends in f. Theorem1: If A is a job-shop timed automaton for J then:  For every complete run  of A, its associated schedule S  corresponds to a feasible schedule for J.  For every feasible schedule S for J, there is a run  of A such that S  = S and if S is non-lazy so is . Theorem2: The optimal job-shop scheduling problem can be reduced to the problem of finding the shortest non-lazy path in a timed automata

3.Finding the shortest non-lazy path The job-shop timed automaton is acyclic Reachability problem for cyclic timed automata is PSPACE-complete. Reachability problem for acyclic timed automata is NP-complete. There exist efficient algorithms that find the shortest path in a timed automaton. Job-shop Timed Automata (cont.)

Example m1m1 m1m1 c 1 := 0 m2m2 c 1  4 m2m2 c 1 := 0 f c 1  5 J1J1 m1m1 m1m1 c 2 := 0 f c 2  3 J2J2 m1,m1,m1m1 m1,m1,m1m1 m1,m1,f m1m1 m1,m1,m 1, f m2,m2,m1m1 m2,m2,m1m1 m2,m2,f m1m1 m2,m2,m 2, m 1 m 2, f m1m1 f,f,f, m 1 f, f c 2 := 0 c 2  3 c 1 := 0 c 1  4 c 1 := 0 c 1  5 c 2 := 0 c 2  3 c 1  4 c 1 := 0 c 1  5 c 2 := 0 c 2  3 c 2 := 0 c 1  5 c 1 := 0 L(S 1 ) = 9 L(S 2 ) = 12

SCHEDULING UNDER UNCERTAINTY PART III

Scheduling Under Uncertainty The duration of tasks is within an interval [l, u] Example: J 1 = (m 1, 10), (m 3, [2, 4]), (m 4, 5) J 2 = (m 2, [2, 8]), (m 3, 7) How can we design a scheduling policy? –Follow the worst case schedule in both time and ordering –Follow only the ordering of tasks as soon as a machine is available. –Design a scheduling strategy.

Example J 1 = (m 1, 10), (m 3, [2, 4]), (m 4, 5) J 2 = (m 2, [2, 8]), (m 3, 7) 21 m1m1 m3m3 J1J1 J2J2 (b) m4m4 m2m2 m3m3 10 (2, 8) 21 m1m1 m3m3 J1J1 J2J2 (a) m4m4 m2m2 m3m (4, 8) 19 m1m1 m3m3 J1J1 J2J2 (c) m4m4 m2m2 m3m3 10

Example J 1 = (m 1, 10), (m 3, [2, 4]), (m 4, 5) J 2 = (m 2, [2, 8]), (m 3, 7) (4, 4) 20 m1m1 m3m3 J2J2 J1J1 (c) m4m4 m2m2 m3m m1m1 m3m3 J2J2 J1J1 (b) m4m4 m2m2 m3m3 10

Dynamic Scheduling What was the problem?! Instead of following a static schedule, whenever a task terminates, we reschedule the residual problem. Example (4, 8):J 1 = (m 1, 10), (m 3, [2, 4]), (m 4, 5) J 2 = (m 2, [2, 8], 7) After terminations of m 2 in J 2 after 4 time: J 1 ' = (m 1, 6), (m 3, [2, 4]), (m 4, 5) J 2 ' = (m 3, 7)

Uncertain Job-shop Automata 1.Generate job automata 2.Construct mutual exclusion composition 3.In the beginning of a run reset a global clock 4.Upon termination of a task formulate the residual problem by calculating the length of runs from the current state (q, v) to (f, v) using backward reachability. This can be done in polynomial time: h(f, v) = 0 h(q, v) = min {t + h(q ', v ' ): (q, v)  (q, v+t1)  (q ', v ' ) t0

Optimal Strategies for Timed Automata h(f, f, ,  ) = 0 h(m 4, f, c 1,  ) = 5 – c 1 h(m 3, f, , c 2 ) = 7 – c 2 h(m 4, m 3, c 1, c 2 ) = min { 7-c 2 +h(m 4, f, c c 2,  ) 5-c 1 +h(f, m 3, , c c 1 ) min { 7  c 1 if c 2  c 1  2 5  c 1 if c 2  c 1  2

Final Analysis Question: Is this a game?! Theorem: The problem of finding optimal strategies for job- shop scheduling under uncertainty is solvable using timed automata reachability algorithms.

TASK GRAPH SCHEDULING PART VI

Task Graph Scheduling In task graph scheduling, we need to schedule tasks on a limited number of machines, while respecting the precedence constraints. P1P1 P6P6 P4P4 P3P3 P7P7 P5P5 P2P

TGS Using Timed Automata 1.Generating the automata for each task p1p1 p1p1 c 1 := 0 p1p1 c 1 = 1 p3p3 p1p1 c 3 := 0  p 1 p1p1 c 3 = 6 p2p2 p2p2 c 2 := 0 p2p2 c 2 = 16

TGS Using Timed Automata (cont.) 2.Constructing chain covers H = {H 1, H 2, …, H k } of ( P,  ) –Each chain H i is linearly ordered –H i  H j =  for all i  j –  i  k H i = P p2p2 p2p2 c 1 := 0 c 1 = 16 p6p6 p6p6 p7p7 p7p7 f c 1 = 2c 1 = 16 c 1 := 0  p 1 c 1 := 0  p 3 p1p1 p1p1 c 2 := 0 c 2 = 2 p3p3 p3p3 p5p5 p5p5 f c 2 = 6 c 2 := 0 c 2 := 0  p 4 p4p4 p4p4 c 3 := 0  p 1 c 2 = 2 f

TGS Using Timed Automata (cont.) 3.Constructing mutual exclusion composition –Avoid global states with number of active tasks more the number of available machines 4.Find the shortest path

Decidable and Undecidable Problems A large class of schedulability problems are decidable It has been shown that the schedulability is undecidable if three conditions hold: 1.The execution times of tasks are uncertain. 2.A task can preempt another task. 3.A task can announce its completion time.

Open Problems Modeling other types scheduling (minimum makespan, minimum completion time) using timed automata Designing approximation algorithms

Questions & Comments