# Dynamic programming formulation

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 1.24 Lecture 14 Dynamic programming: Job scheduling Dynamic programming formulation To formulate a problem as a dynamic program: Sort by a criterion that will allow infeasible combinations to be eli minated effi ciently Choose granularity (integer scale or precision) that allows dominated subsequences to be pruned Choose coarsest granularity that works for your problem Use dynamic programming in fairly constrained problems with tight budgets and bounds If problem is not highly constrained, you will need to apply heuristic constraints to limit the search space Choose between multistage graph, set or custom implementation Decide if a sentinel is helpful in set implementation Experiment Every problem is a special case, since DP is O(2 n ) Can you find special structure that makes your DP fast? 1

2 DP examples This lecture shows another example Job scheduling, using multistage graph Example of sorting, feasibility, pruning used effectively Example of good software implementation No graph data structure built; solution tree built directly Good but not ideal representation of tree/graph nodes; some nodes are created but not used We don t even consider 2-D arrays, linked lists, etc., which do not scale at all, but which are popular in many texts. Crazy Good DP codes are somewhat hard to write; there is much detail to handle and many lurking inefficiencies to combat We will not dwell on the code details, but they are important Knapsack problem in next lecture, using sets Example of sorting, feasibility, pruning in different framework Multistage graph doesn t work: too many nodes per stage Object oriented design is big improvement over past codes Be careful: many texts have zillions of inefficient, tiny objects Job scheduling dynamic program Each job to be scheduled is treated as a project with a profit, time required, and deadline We have a single machine over a given time (resource) Use multistage graph formulation from last lecture Algorithm pseudocode: Sort jobs in deadline order (not profit order as in greedy) Build source node for job Consider each job in deadline order: Build set of nodes for next stage (job) for each state (time spent) For current job: Build arc with no time assigned to job If time so far + current job time <= job deadline, build arc with job done Build sink node for artificial last job Trace back solution using predecessor nodes 2

3 Job scheduling algorithm We will label every node in the graph that we encounter with its profit and time used If we find a better path to that node, we update its profit and time labels This is exactly the same as the shortest path label correcting algorithm We know this algorithm runs fast The issue is then: how big is the graph? A smart formulation keeps the graph size at some polynomial bound in the problem size Otherwise, the graph becomes exponentially large and this is why dynamic programming worst case is exponential If our model is good, we also need a good implementation A bad implementation can make a good model run very slowly (A good implementation can t really speed up a bad model ) Job scheduling example Job Deadline Profit Time time units of machine time available. 3

4 V(,) Job scheduling graph: forward 1 6 V(1,) V(2,) V(3,) E(2,)= E(3,)= V(1,1) V(2,1) V(3,1) E(2,)= E(3,)= V(1,2) V(2,2) V(3,2) 3 8 E(3,)= 13 V(1,3) V(2,3) 4 9 V(3,3) 14 V pred V(1,4) V(2,4) 5 1 V(3,4) 15 Stage: Job decision Job 1 decision Job 2 decision Profit: 39 Profit: 9 Profit: 88 Time: 1 Time: 1 Time: 2 Deadline: 1 Deadline: 2 Deadline: 2 V(,) Job scheduling graph: backward 1 6 V(1,) V(2,) V(3,) E(2,)= E(3,)= V(1,1) V(2,1) V(3,1) E(2,)= E(3,)= V(1,2) V(2,2) V(3,2) 3 8 E(3,)= 13 V pred V(1,3) V(2,3) V(3,3) V(1,4) V(2,4) 5 1 V(3,4) 15 Stage: Job decision Job 1 decision Job 2 decision Profit: 39 Profit: 9 Profit: 88 Time: 1 Time: 1 Time: 2 Deadline: 1 Deadline: 2 Deadline: 2 4

5 Job class public class Job implements Comparable { int jobnbr; // Package access int deadline; // Package access int profit; // Package access int time; // Package access public Job(int j, int d, int p, int t) { jobnbr= j; deadline= d; profit= p; time= t; public int compareto(object other) { Job o= (Job) other; if (deadline < o.deadline) return -1; else if (deadline > o.deadline) return 1; else return ; public String tostring() { return("j: "+ jobnbr+" D: "+ deadline+" P: "+ profit+" T: "+ time); JobScheduler public class JobScheduler { private Job[] jobs; // Input set of jobs to schedule private int nbrjobs; // Number of input jobs private int endtime; // Latest end time of job (=max resource) private int[] path; // List of nodes in the optimal solution private int jobsdone; // Output: total number of jobs private int totalprofit; // Output private int nodes; // Nodes generated in DP graph private int[] nodeprofit; // Profit of jobs prior to this node private int[] nodetime; // Time spent on jobs prior to node private int[] pred; // Predecessor node with best profit private int stagenodes; // Difference in node numbers from // one stage to next 5

6 JobScheduler constructor, jsd() public JobScheduler(Job[] j, int e) { jobs = j; endtime = e; nbrjobs= jobs.length; path= new int[nbrjobs+1]; nodes= (nbrjobs-1)*(endtime+1)+2; // nodes= stages*states + source, sink nodeprofit= new int[nodes]; nodetime= new int[nodes]; pred= new int[nodes]; for (int i= ; i < nodes; i++) pred[i]= -1; stagenodes= endtime+1; public void jsd() { buildsource(); buildcenter(); buildsink(); backpath(); buildsource() private void buildsource() { nodeprofit[]= ; // Source is node nodetime[]= ; // Treat stage as special case because it has only 1 node // If job not in solution set ( time and profit). nodeprofit[1]= ; nodetime[1]= ; pred[1]= ; // If job feasible if (jobs[].time <= jobs[].deadline) { int tonode= 1+ jobs[].time; time; nodeprofit[tonode]= jobs[].profit; nodetime[tonode]= jobs[].time; pred[tonode]= ; 6

7 buildcenter() private void buildcenter() { for (int stage= 1; stage < nbrjobs-1; stage++) { // Generate virtual arcs for (int node=(stage-1)*stagenodes+1; node<= stage*stagenodes;node++) if (pred[node] >= ) { // If job not in solution,build arc if it is on optimal sequence if (nodeprofit[node] >= nodeprofit[node+stagenodes]) { nodeprofit[node+stagenodes]= nodeprofit[node]; nodetime[node+stagenodes]= nodetime[node]; pred[node+stagenodes]= node; // If job feasible build virtual arc if it is on optimal sequence if (nodetime[node]+jobs[stage].time <= jobs[stage].deadline) { int nextnode= node + stagenodes + jobs[stage].time; time; if (nodeprofit[node]+jobs[stage].profit>=nodeprofit[nextnode]){ nodeprofit[nextnode]= nodeprofit[node]+ jobs[stage].profit; nodetime[nextnode]= nodetime[node]+ jobs[stage].time; pred[nextnode]= node; buildsink() private void buildsink() { int stage= nbrjobs - 1; int sinknode= (nbrjobs-1)*stagenodes + 1; for (int node=(stage-1)*stagenodes+1; node <= stage*stagenodes; node++) if (pred[node] >= ) { // Generate only single best virtual arc from previous node // Job feasible if (nodetime[node] + jobs[stage].time <= jobs[stage].deadline) { // Job in solution if (nodeprofit[node]+ jobs[stage].profit >= nodeprofit[sinknode]) { nodeprofit[sinknode]= nodeprofit[node]+ jobs[stage].profit; nodetime[sinknode]= nodetime[node]+ jobs[stage].time; pred[sinknode]= node; // Job not in solution if (nodeprofit[node] >= nodeprofit[sinknode]) { nodeprofit[sinknode]= nodeprofit[node]; nodetime[sinknode]= nodetime[node]; pred[sinknode]= node;

8 backpath(), outputjobs() private void backpath() { // Trace back predecessor nodes from sink to source path[nbrjobs]= (nbrjobs-1)*stagenodes + 1; // Sink node for (int stage= nbrjobs-1; stage >= 1; stage--) path[stage]= pred[path[stage+1]]; public void outputjobs() { System.out.println("Jobs done:"); for (int stage= ; stage < nbrjobs; stage++) { if (nodeprofit[path[stage]]!= nodeprofit[path[stage+1]]) { System.out.println(jobs[stage]); jobsdone++; totalprofit += jobs[stage].profit; System.out.println("\nJobs done: " + jobsdone + " total profit: "+ totalprofit); main() public static void main(string[] args) { Job[] jobs= new Job[]; jobs[]= new Job(, 1, 39, 1); jobs[1]= new Job(1, 2, 9, 1); jobs[2]= new Job(2, 2, 88, 2); jobs[3]= new Job(3, 2, 2, 1); jobs[4]= new Job(4, 3, 3, 3); jobs[5]= new Job(5, 3, 25, 2); jobs[6]= new Job(6, 4,, 1); int endtime= 4; Arrays.sort(jobs); // In deadline order JobScheduler j= new JobScheduler(jobs, endtime); j.jsd(); jsd(); j.outputjobs(); 8

9 Job scheduling DP complexity Complexity is minimum of: O(nM), where n is number of jobs (stages) M is min( p i, t i, d i ) O(2 n ) Intuitively, if no pruning occurs and the time resource is large, the number of nodes can double at each stage (job) This leads to O(2 n ) complexity If the times, deadlines or profits are constrained, many fewer nodes are generated This leads to O(nM) complexity Example uses of job scheduling Transportation vehicle fleet maintenance Many vehicles, many jobs with priority and benefit Routine or scheduled maintenance Accident repair Upgrades Manufacturing facility scheduling Marketing requirement for production of products with expected profit margins, deadlines and times Facilities making a range of products (e.g., in China) Robotics: control of real-time tasks Taxi dispatch (with extensions) 9

10 Other dynamic programming examples Most resource allocation problems are solved with linear programming Sophisticated solutions use integer programming now DP is used with nonlinear costs or outputs, often in process industries (chemical, etc.) with continuous but complex and expensive output DP for resource allocation has dimensionality curse when there is more than one resource: Have triplets of (cost, time, profit) for example, instead of pair of (cost, profit) Our job scheduling DP is a nice exception Dynamic programming is also used in: Production control Markov models of systems Financial portfolio management (risk management) Multi player game solutions! Reliability design D D 1 D 2 D n-1 D D D 1 D 1 D D 1 D 2 D n-1 D 2 D n-1 D 2 D n-1 D 2 Multiple devices are used at each stage. Monitors determine which devices are functioning properly. We wish to obtain maximum reliability within a cost constraint 1

11 Reliability design formulation If a stage i contains m i devices D i : Probability that all have a fault = (1-r i ) mi Reliability of stage y i = 1 (1-r i ) mi We want to maximize reliability= n Subject to a cost constraint: n m i c m C i i 1, and it integer mi (1 (1 r ) ) We need a more flexible representation: sets (but of a different sort that our Set class) i Reliability design example Device D D1 D2 Device type Input buffer Processor Output buffer Cost \$3 \$15 \$2 Reliability Maximum cost= \$15 11

12 V(,) Reliability design conceptual graph.9 V(1,3) 1.99 V(1,6) V(1,9) Max = \$ Must have at Rel Pred Stage: 1 2 D decision D 1 decision D 2 decision Cost: \$3 Cost: \$15 Cost: \$2 Reliability:.9 Reliability:.8 Reliability: V(,) Rel Pred Reliability design conceptual graph.9 V(1,3) 1.99 V(1,6) V(1,9) Max = \$ Must have at E(1,1)= V(2,45) V(2,6) V(2,5) 8 Max = \$85 Must have at Stage: 1 2 D decision D 1 decision D 2 decision Cost: \$3 Cost: \$15 Cost: \$2 Reliability:.9 Reliability:.8 Reliability:

13 V(,) Rel Pred Reliability design conceptual graph.9 V(1,3) 1.99 V(1,6) V(1,9) Max = \$ Must have at E(1,1)= V(2,45) V(2,6) V(2,5) Dominated-label correction Max = \$85 Must have at Stage: 1 2 D decision D 1 decision D 2 decision Cost: \$3 Cost: \$15 Cost: \$2 Reliability:.9 Reliability:.8 Reliability: V (,) Rel Pred Reliability design conceptual graph V(1,3) V(2,45) V(3,65 E(1,1)=.8 E(2,1)= V(1,6) V(2,6) V(3,8 E(2,1)= V(1,9) Max = \$ Must have at Stage: V(2,5) V(3, Dominated V(3,95 14 Max = \$ Must have at V(3,1) 15 D decision D 1 decision D 2 decision Cost: \$3 Cost: \$15 Cost: \$2 Reliability:.9 Reliability:.8 Reliability: V(3,15) 13

14 V(,) Rel Pred Reliability design conceptual graph V(1,3) V(2,45) V(3,65 E(1,1)=.8 E(2,1)= V(1,6) V(2,6) V(3,8 E(2,1)= V(1,9) Max = \$ Must have at V(2,5) V(3, Dominated Dominated V(3,95 14 Max = \$ Must have at V(3,1) 15 Stage: 1 2 D decision D 1 decision D 2 decision Cost: \$3 Cost: \$15 Cost: \$2 Reliability:.9 Reliability:.8 Reliability:.5 Dominated V(3,15) Reliability DP needs different data structure Explosion of number of nodes Dominance is a more general concept than label correction Nodes with lower reliability but higher cost are pruned This is necessary to prune most dynamic programming graphs Heuristics are usually used Asymptotic analysis is not very helpful any more Most problems are O(min( graph size, 2 n )) Approaches with similar worst cases can have very different actual running times. Must experiment. Next time we ll cover the set implementation for dynamic programming We get rid of the nodes as well as the graph! 14

15 Things to notice in this formulation Sorting We didn t sort in the example, but in real problem it s always worth doing Almost always sort by benefit/cost ratio to get dominance In this problem, sort by failure probability/cost Having redundancy in cheap components with high failure rate is likely to be the most effective strategy Sorting replaces many ad-hoc heuristics, gives same effect There is no sink node There are tricks to avoid solving the last stage see see text Heuristics Prune at each stage based on benefit/cost ratio. Eliminate the states with small improvements over the preceding state Load obvious solution elements into the source node via heuristic E.g in knapsack, load first 5 of expected 1 items in profit/weight order If you need to do these things, branch and bound is better approach 15

### 1.204 Lecture 10. Greedy algorithms: Job scheduling. Greedy method

1.204 Lecture 10 Greedy algorithms: Knapsack (capital budgeting) Job scheduling Greedy method Local improvement method Does not look at problem globally Takes best immediate step to find a solution Useful

### Dynamic programming. Doctoral course Optimization on graphs - Lecture 4.1. Giovanni Righini. January 17 th, 2013

Dynamic programming Doctoral course Optimization on graphs - Lecture.1 Giovanni Righini January 1 th, 201 Implicit enumeration Combinatorial optimization problems are in general NP-hard and we usually

### Chapter 15: Dynamic Programming

Chapter 15: Dynamic Programming Dynamic programming is a general approach to making a sequence of interrelated decisions in an optimum way. While we can describe the general characteristics, the details

### Scheduling Shop Scheduling. Tim Nieberg

Scheduling Shop Scheduling Tim Nieberg Shop models: General Introduction Remark: Consider non preemptive problems with regular objectives Notation Shop Problems: m machines, n jobs 1,..., n operations

### Classification - Examples

Lecture 2 Scheduling 1 Classification - Examples 1 r j C max given: n jobs with processing times p 1,...,p n and release dates r 1,...,r n jobs have to be scheduled without preemption on one machine taking

### Approximation Algorithms

Approximation Algorithms or: How I Learned to Stop Worrying and Deal with NP-Completeness Ong Jit Sheng, Jonathan (A0073924B) March, 2012 Overview Key Results (I) General techniques: Greedy algorithms

### Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi

Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi Lecture - 15 Limited Resource Allocation Today we are going to be talking about

Approximation Algorithms Chapter Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should I do? A. Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one

### Scheduling. Open shop, job shop, flow shop scheduling. Related problems. Open shop, job shop, flow shop scheduling

Scheduling Basic scheduling problems: open shop, job shop, flow job The disjunctive graph representation Algorithms for solving the job shop problem Computational complexity of the job shop problem Open

### 5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1

5 INTEGER LINEAR PROGRAMMING (ILP) E. Amaldi Fondamenti di R.O. Politecnico di Milano 1 General Integer Linear Program: (ILP) min c T x Ax b x 0 integer Assumption: A, b integer The integrality condition

### Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

### INTEGER PROGRAMMING. Integer Programming. Prototype example. BIP model. BIP models

Integer Programming INTEGER PROGRAMMING In many problems the decision variables must have integer values. Example: assign people, machines, and vehicles to activities in integer quantities. If this is

### Optimization Modeling for Mining Engineers

Optimization Modeling for Mining Engineers Alexandra M. Newman Division of Economics and Business Slide 1 Colorado School of Mines Seminar Outline Linear Programming Integer Linear Programming Slide 2

### Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Complexity Theory IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Outline Goals Computation of Problems Concepts and Definitions Complexity Classes and Problems Polynomial Time Reductions Examples

### ! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three

### SIMS 255 Foundations of Software Design. Complexity and NP-completeness

SIMS 255 Foundations of Software Design Complexity and NP-completeness Matt Welsh November 29, 2001 mdw@cs.berkeley.edu 1 Outline Complexity of algorithms Space and time complexity ``Big O'' notation Complexity

### Scheduling Single Machine Scheduling. Tim Nieberg

Scheduling Single Machine Scheduling Tim Nieberg Single machine models Observation: for non-preemptive problems and regular objectives, a sequence in which the jobs are processed is sufficient to describe

### Offline sorting buffers on Line

Offline sorting buffers on Line Rohit Khandekar 1 and Vinayaka Pandit 2 1 University of Waterloo, ON, Canada. email: rkhandekar@gmail.com 2 IBM India Research Lab, New Delhi. email: pvinayak@in.ibm.com

### ! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of

### Classification - Examples -1- 1 r j C max given: n jobs with processing times p 1,..., p n and release dates

Lecture 2 Scheduling 1 Classification - Examples -1-1 r j C max given: n jobs with processing times p 1,..., p n and release dates r 1,..., r n jobs have to be scheduled without preemption on one machine

### Algorithms and Data Structures

Algorithm Analysis Page 1 BFH-TI: Softwareschule Schweiz Algorithm Analysis Dr. CAS SD01 Algorithm Analysis Page 2 Outline Course and Textbook Overview Analysis of Algorithm Pseudo-Code and Primitive Operations

### COMP-424: Artificial intelligence. Lecture 7: Game Playing

COMP 424 - Artificial Intelligence Lecture 7: Game Playing Instructor: Joelle Pineau (jpineau@cs.mcgill.ca) Class web page: www.cs.mcgill.ca/~jpineau/comp424 Unless otherwise noted, all material posted

### Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows

TECHNISCHE UNIVERSITEIT EINDHOVEN Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows Lloyd A. Fasting May 2014 Supervisors: dr. M. Firat dr.ir. M.A.A. Boon J. van Twist MSc. Contents

### Converting a Linear Program to Standard Form

Converting a Linear Program to Standard Form Hi, welcome to a tutorial on converting an LP to Standard Form. We hope that you enjoy it and find it useful. Amit, an MIT Beaver Mita, an MIT Beaver 2 Linear

### Compact Representations and Approximations for Compuation in Games

Compact Representations and Approximations for Compuation in Games Kevin Swersky April 23, 2008 Abstract Compact representations have recently been developed as a way of both encoding the strategic interactions

### 1.204 Lecture 6. Data structures: stacks, queues, trees, dictionaries. Data structures

1.204 Lecture 6 Data structures: stacks, queues, trees, dictionaries Data structures Correct and efficient representation of data and applicable rules Stack: last in, first out discipline Queue: first

### Why? A central concept in Computer Science. Algorithms are ubiquitous.

Analysis of Algorithms: A Brief Introduction Why? A central concept in Computer Science. Algorithms are ubiquitous. Using the Internet (sending email, transferring files, use of search engines, online

### Max Flow, Min Cut, and Matchings (Solution)

Max Flow, Min Cut, and Matchings (Solution) 1. The figure below shows a flow network on which an s-t flow is shown. The capacity of each edge appears as a label next to the edge, and the numbers in boxes

### 6.231 Dynamic Programming and Stochastic Control Fall 2008

MIT OpenCourseWare http://ocw.mit.edu 6.231 Dynamic Programming and Stochastic Control Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 6.231

### Near Optimal Solutions

Near Optimal Solutions Many important optimization problems are lacking efficient solutions. NP-Complete problems unlikely to have polynomial time solutions. Good heuristics important for such problems.

### 2.3 Scheduling jobs on identical parallel machines

2.3 Scheduling jobs on identical parallel machines There are jobs to be processed, and there are identical machines (running in parallel) to which each job may be assigned Each job = 1,,, must be processed

### Single machine models: Maximum Lateness -12- Approximation ratio for EDD for problem 1 r j,d j < 0 L max. structure of a schedule Q...

Lecture 4 Scheduling 1 Single machine models: Maximum Lateness -12- Approximation ratio for EDD for problem 1 r j,d j < 0 L max structure of a schedule 0 Q 1100 11 00 11 000 111 0 0 1 1 00 11 00 11 00

### A Branch and Bound Algorithm for Solving the Binary Bi-level Linear Programming Problem

A Branch and Bound Algorithm for Solving the Binary Bi-level Linear Programming Problem John Karlof and Peter Hocking Mathematics and Statistics Department University of North Carolina Wilmington Wilmington,

### Algorithms and Data Structures

Algorithms and Data Structures CMPSC 465 LECTURES 20-21 Priority Queues and Binary Heaps Adam Smith S. Raskhodnikova and A. Smith. Based on slides by C. Leiserson and E. Demaine. 1 Trees Rooted Tree: collection

### On the effect of forwarding table size on SDN network utilization

IBM Haifa Research Lab On the effect of forwarding table size on SDN network utilization Rami Cohen IBM Haifa Research Lab Liane Lewin Eytan Yahoo Research, Haifa Seffi Naor CS Technion, Israel Danny Raz

### Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi

Project and Production Management Prof. Arun Kanda Department of Mechanical Engineering Indian Institute of Technology, Delhi Lecture - 9 Basic Scheduling with A-O-A Networks Today we are going to be talking

### Scheduling Home Health Care with Separating Benders Cuts in Decision Diagrams

Scheduling Home Health Care with Separating Benders Cuts in Decision Diagrams André Ciré University of Toronto John Hooker Carnegie Mellon University INFORMS 2014 Home Health Care Home health care delivery

### CS/COE 1501 http://cs.pitt.edu/~bill/1501/

CS/COE 1501 http://cs.pitt.edu/~bill/1501/ Lecture 01 Course Introduction Meta-notes These notes are intended for use by students in CS1501 at the University of Pittsburgh. They are provided free of charge

### Chapter 10: Network Flow Programming

Chapter 10: Network Flow Programming Linear programming, that amazingly useful technique, is about to resurface: many network problems are actually just special forms of linear programs! This includes,

LINKED DATA STRUCTURES 1 Linked Lists A linked list is a structure in which objects refer to the same kind of object, and where: the objects, called nodes, are linked in a linear sequence. we keep a reference

### Efficiency of algorithms. Algorithms. Efficiency of algorithms. Binary search and linear search. Best, worst and average case.

Algorithms Efficiency of algorithms Computational resources: time and space Best, worst and average case performance How to compare algorithms: machine-independent measure of efficiency Growth rate Complexity

### AI and computer game playing. Artificial Intelligence. Partial game tree for Tic-Tac-Toe. Game tree search. Minimax Algorithm

AI and computer game playing Artificial Intelligence Introduction to game-playing search imax algorithm, evaluation functions, alpha-beta pruning, advanced techniques Game playing (especially chess and

### A Beam Search Heuristic for Multi-Mode Single Resource Constrained Project Scheduling

A Beam Search Heuristic for Multi-Mode Single Resource Constrained Project Scheduling Chuda Basnet Department of Management Systems The University of Waikato Private Bag 3105 Hamilton chuda@waikato.ac.nz

### Measuring the Performance of an Agent

25 Measuring the Performance of an Agent The rational agent that we are aiming at should be successful in the task it is performing To assess the success we need to have a performance measure What is rational

### Introduction to LAN/WAN. Network Layer

Introduction to LAN/WAN Network Layer Topics Introduction (5-5.1) Routing (5.2) (The core) Internetworking (5.5) Congestion Control (5.3) Network Layer Design Isues Store-and-Forward Packet Switching Services

### Automated Scheduling Methods. Advanced Planning and Scheduling Techniques

Advanced Planning and Scheduling Techniques Table of Contents Introduction 3 The Basic Theories 3 Constrained and Unconstrained Planning 4 Forward, Backward, and other methods 5 Rules for Sequencing Tasks

### Nonlinear Optimization: Algorithms 3: Interior-point methods

Nonlinear Optimization: Algorithms 3: Interior-point methods INSEAD, Spring 2006 Jean-Philippe Vert Ecole des Mines de Paris Jean-Philippe.Vert@mines.org Nonlinear optimization c 2006 Jean-Philippe Vert,

### DATA ANALYSIS IN PUBLIC SOCIAL NETWORKS

International Scientific Conference & International Workshop Present Day Trends of Innovations 2012 28 th 29 th May 2012 Łomża, Poland DATA ANALYSIS IN PUBLIC SOCIAL NETWORKS Lubos Takac 1 Michal Zabovsky

### Discuss the size of the instance for the minimum spanning tree problem.

3.1 Algorithm complexity The algorithms A, B are given. The former has complexity O(n 2 ), the latter O(2 n ), where n is the size of the instance. Let n A 0 be the size of the largest instance that can

### 2.3.5 Project planning

efinitions:..5 Project planning project consists of a set of m activities with their duration: activity i has duration d i, i = 1,..., m. estimate Some pairs of activities are subject to a precedence constraint:

### Dynamic Programming. Lecture 11. 11.1 Overview. 11.2 Introduction

Lecture 11 Dynamic Programming 11.1 Overview Dynamic Programming is a powerful technique that allows one to solve many different types of problems in time O(n 2 ) or O(n 3 ) for which a naive approach

### 2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

Code No: R05220502 Set No. 1 1. (a) Describe the performance analysis in detail. (b) Show that f 1 (n)+f 2 (n) = 0(max(g 1 (n), g 2 (n)) where f 1 (n) = 0(g 1 (n)) and f 2 (n) = 0(g 2 (n)). [8+8] 2. (a)

### Inverse Optimization by James Orlin

Inverse Optimization by James Orlin based on research that is joint with Ravi Ahuja Jeopardy 000 -- the Math Programming Edition The category is linear objective functions The answer: When you maximize

### Assembly line balancing to minimize balancing loss and system loss. D. Roy 1 ; D. Khan 2

J. Ind. Eng. Int., 6 (11), 1-, Spring 2010 ISSN: 173-702 IAU, South Tehran Branch Assembly line balancing to minimize balancing loss and system loss D. Roy 1 ; D. han 2 1 Professor, Dep. of Business Administration,

### A new Branch-and-Price Algorithm for the Traveling Tournament Problem (TTP) Column Generation 2008, Aussois, France

A new Branch-and-Price Algorithm for the Traveling Tournament Problem (TTP) Column Generation 2008, Aussois, France Stefan Irnich 1 sirnich@or.rwth-aachen.de RWTH Aachen University Deutsche Post Endowed

### Problems, Methods and Tools of Advanced Constrained Scheduling

Problems, Methods and Tools of Advanced Constrained Scheduling Victoria Shavyrina, Spider Project Team Shane Archibald, Archibald Associates Vladimir Liberzon, Spider Project Team 1. Introduction In this

### Sport Timetabling. Outline DM87 SCHEDULING, TIMETABLING AND ROUTING. Outline. Lecture 15. 1. Problem Definitions

Outline DM87 SCHEDULING, TIMETABLING AND ROUTING Lecture 15 Sport Timetabling 1. Problem Definitions Marco Chiarandini DM87 Scheduling, Timetabling and Routing 2 Problems we treat: single and double round-robin

### Data Structure [Question Bank]

Unit I (Analysis of Algorithms) 1. What are algorithms and how they are useful? 2. Describe the factor on best algorithms depends on? 3. Differentiate: Correct & Incorrect Algorithms? 4. Write short note:

### Discrete Optimization

Discrete Optimization [Chen, Batson, Dang: Applied integer Programming] Chapter 3 and 4.1-4.3 by Johan Högdahl and Victoria Svedberg Seminar 2, 2015-03-31 Todays presentation Chapter 3 Transforms using

### D1.1 Service Discovery system: Load balancing mechanisms

D1.1 Service Discovery system: Load balancing mechanisms VERSION 1.0 DATE 2011 EDITORIAL MANAGER Eddy Caron AUTHORS STAFF Eddy Caron, Cédric Tedeschi Copyright ANR SPADES. 08-ANR-SEGI-025. Contents Introduction

### Real Time Scheduling Basic Concepts. Radek Pelánek

Real Time Scheduling Basic Concepts Radek Pelánek Basic Elements Model of RT System abstraction focus only on timing constraints idealization (e.g., zero switching time) Basic Elements Basic Notions task

### CSC2420 Spring 2015: Lecture 3

CSC2420 Spring 2015: Lecture 3 Allan Borodin January 22, 2015 1 / 1 Announcements and todays agenda Assignment 1 due next Thursday. I may add one or two additional questions today or tomorrow. Todays agenda

### Economics 326: Marshallian Demand and Comparative Statics. Ethan Kaplan

Economics 326: Marshallian Demand and Comparative Statics Ethan Kaplan September 17, 2012 Outline 1. Utility Maximization: General Formulation 2. Marshallian Demand 3. Homogeneity of Degree Zero of Marshallian

### Lecture 10: Regression Trees

Lecture 10: Regression Trees 36-350: Data Mining October 11, 2006 Reading: Textbook, sections 5.2 and 10.5. The next three lectures are going to be about a particular kind of nonlinear predictive model,

### Data Structures. Algorithm Performance and Big O Analysis

Data Structures Algorithm Performance and Big O Analysis What s an Algorithm? a clearly specified set of instructions to be followed to solve a problem. In essence: A computer program. In detail: Defined

### Linear Programming Notes V Problem Transformations

Linear Programming Notes V Problem Transformations 1 Introduction Any linear programming problem can be rewritten in either of two standard forms. In the first form, the objective is to maximize, the material

### VEHICLE ROUTING PROBLEM

VEHICLE ROUTING PROBLEM Readings: E&M 0 Topics: versus TSP Solution methods Decision support systems for Relationship between TSP and Vehicle routing problem () is similar to the Traveling salesman problem

### Dynamic Vehicle Routing in MATSim

Poznan University of Technology Department of Motor Vehicles and Road Transport ZPSiTD Dynamic Vehicle Routing in MATSim Simulation and Optimization Michal Maciejewski michal.maciejewski@put.poznan.pl

### Instruction Scheduling. Software Pipelining - 2

and Software Pipelining - 2 Department of Computer Science and Automation Indian Institute of Science Bangalore 560 012 NPTEL Course on Principles of Compiler Design Outline Simple Basic Block Scheduling

### Chapter 13: Binary and Mixed-Integer Programming

Chapter 3: Binary and Mixed-Integer Programming The general branch and bound approach described in the previous chapter can be customized for special situations. This chapter addresses two special situations:

### Bicolored Shortest Paths in Graphs with Applications to Network Overlay Design

Bicolored Shortest Paths in Graphs with Applications to Network Overlay Design Hongsik Choi and Hyeong-Ah Choi Department of Electrical Engineering and Computer Science George Washington University Washington,

### CS 2112 Spring 2014. 0 Instructions. Assignment 3 Data Structures and Web Filtering. 0.1 Grading. 0.2 Partners. 0.3 Restrictions

CS 2112 Spring 2014 Assignment 3 Data Structures and Web Filtering Due: March 4, 2014 11:59 PM Implementing spam blacklists and web filters requires matching candidate domain names and URLs very rapidly

### Data Mining Practical Machine Learning Tools and Techniques

Ensemble learning Data Mining Practical Machine Learning Tools and Techniques Slides for Chapter 8 of Data Mining by I. H. Witten, E. Frank and M. A. Hall Combining multiple models Bagging The basic idea

### SYSM 6304: Risk and Decision Analysis Lecture 5: Methods of Risk Analysis

SYSM 6304: Risk and Decision Analysis Lecture 5: Methods of Risk Analysis M. Vidyasagar Cecil & Ida Green Chair The University of Texas at Dallas Email: M.Vidyasagar@utdallas.edu October 17, 2015 Outline

### Introduction to Scheduling Theory

Introduction to Scheduling Theory Arnaud Legrand Laboratoire Informatique et Distribution IMAG CNRS, France arnaud.legrand@imag.fr November 8, 2004 1/ 26 Outline 1 Task graphs from outer space 2 Scheduling

### Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

CSE341T 08/31/2015 Lecture 3 Cost Model: Work, Span and Parallelism In this lecture, we will look at how one analyze a parallel program written using Cilk Plus. When we analyze the cost of an algorithm

### The first step in solving a problem recursively is to formulate a recursive definition of the problem.

Chapter 8 Recursion The subject of this chapter is recursion, an implicit application of the stack ADT. A recursive method is a method that carries out its task by making a call(s) to itself. Each recursive

### CAD Algorithms. P and NP

CAD Algorithms The Classes P and NP Mohammad Tehranipoor ECE Department 6 September 2010 1 P and NP P and NP are two families of problems. P is a class which contains all of the problems we solve using

### A Fast Algorithm For Finding Hamilton Cycles

A Fast Algorithm For Finding Hamilton Cycles by Andrew Chalaturnyk A thesis presented to the University of Manitoba in partial fulfillment of the requirements for the degree of Masters of Science in Computer

### Prescriptive Analytics. A business guide

Prescriptive Analytics A business guide May 2014 Contents 3 The Business Value of Prescriptive Analytics 4 What is Prescriptive Analytics? 6 Prescriptive Analytics Methods 7 Integration 8 Business Applications

### Data Structures and Algorithms Written Examination

Data Structures and Algorithms Written Examination 22 February 2013 FIRST NAME STUDENT NUMBER LAST NAME SIGNATURE Instructions for students: Write First Name, Last Name, Student Number and Signature where

### CMPSCI611: Approximating MAX-CUT Lecture 20

CMPSCI611: Approximating MAX-CUT Lecture 20 For the next two lectures we ll be seeing examples of approximation algorithms for interesting NP-hard problems. Today we consider MAX-CUT, which we proved to

### Application Survey Paper

Application Survey Paper Project Planning with PERT/CPM LINDO Systems 2003 Program Evaluation and Review Technique (PERT) and Critical Path Method (CPM) are two closely related techniques for monitoring

### Using Ant Colony Optimization for Infrastructure Maintenance Scheduling

Using Ant Colony Optimization for Infrastructure Maintenance Scheduling K. Lukas, A. Borrmann & E. Rank Chair for Computation in Engineering, Technische Universität München ABSTRACT: For the optimal planning

### CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team

CS104: Data Structures and Object-Oriented Design (Fall 2013) October 24, 2013: Priority Queues Scribes: CS 104 Teaching Team Lecture Summary In this lecture, we learned about the ADT Priority Queue. A

### Data Structures and Algorithms

Data Structures and Algorithms Computational Complexity Escola Politècnica Superior d Alcoi Universitat Politècnica de València Contents Introduction Resources consumptions: spatial and temporal cost Costs

### On some Potential Research Contributions to the Multi-Core Enterprise

On some Potential Research Contributions to the Multi-Core Enterprise Oded Maler CNRS - VERIMAG Grenoble, France February 2009 Background This presentation is based on observations made in the Athole project

### Applied Algorithm Design Lecture 5

Applied Algorithm Design Lecture 5 Pietro Michiardi Eurecom Pietro Michiardi (Eurecom) Applied Algorithm Design Lecture 5 1 / 86 Approximation Algorithms Pietro Michiardi (Eurecom) Applied Algorithm Design

### Introduction to Data-flow analysis

Introduction to Data-flow analysis Last Time LULESH intro Typed, 3-address code Basic blocks and control flow graphs LLVM Pass architecture Data dependencies, DU chains, and SSA Today CFG and SSA example

### Lecture Outline Overview of real-time scheduling algorithms Outline relative strengths, weaknesses

Overview of Real-Time Scheduling Embedded Real-Time Software Lecture 3 Lecture Outline Overview of real-time scheduling algorithms Clock-driven Weighted round-robin Priority-driven Dynamic vs. static Deadline

### Resource Allocation and Scheduling

Lesson 3: Resource Allocation and Scheduling DEIS, University of Bologna Outline Main Objective: joint resource allocation and scheduling problems In particular, an overview of: Part 1: Introduction and

### CS473 - Algorithms I

CS473 - Algorithms I Lecture 9 Sorting in Linear Time View in slide-show mode 1 How Fast Can We Sort? The algorithms we have seen so far: Based on comparison of elements We only care about the relative

### Research Paper Business Analytics. Applications for the Vehicle Routing Problem. Jelmer Blok

Research Paper Business Analytics Applications for the Vehicle Routing Problem Jelmer Blok Applications for the Vehicle Routing Problem Jelmer Blok Research Paper Vrije Universiteit Amsterdam Faculteit

### Chapter 11: PERT for Project Planning and Scheduling

Chapter 11: PERT for Project Planning and Scheduling PERT, the Project Evaluation and Review Technique, is a network-based aid for planning and scheduling the many interrelated tasks in a large and complex

### Software Pipelining - Modulo Scheduling

EECS 583 Class 12 Software Pipelining - Modulo Scheduling University of Michigan October 15, 2014 Announcements + Reading Material HW 2 Due this Thursday Today s class reading» Iterative Modulo Scheduling:

### Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li

Computer Algorithms NP-Complete Problems NP-completeness The quest for efficient algorithms is about finding clever ways to bypass the process of exhaustive search, using clues from the input in order

### Clustering and scheduling maintenance tasks over time

Clustering and scheduling maintenance tasks over time Per Kreuger 2008-04-29 SICS Technical Report T2008:09 Abstract We report results on a maintenance scheduling problem. The problem consists of allocating

### Algebraic Computation Models. Algebraic Computation Models

Algebraic Computation Models Ζυγομήτρος Ευάγγελος ΜΠΛΑ 201118 Φεβρουάριος, 2013 Reasons for using algebraic models of computation The Turing machine model captures computations on bits. Many algorithms