2.8 An application of Dynamic Programming to machine renewal



Similar documents
Discuss the size of the instance for the minimum spanning tree problem.

2.3.5 Project planning

Scheduling Shop Scheduling. Tim Nieberg

2.3.4 Project planning

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

EdExcel Decision Mathematics 1

Project Scheduling by Critical Path Method (CPM)

Problem Set 7 Solutions

Warshall s Algorithm: Transitive Closure

Linear Programming. April 12, 2005

Part 2: Community Detection

Batch Production Scheduling in the Process Industries. By Prashanthi Ravi

(Refer Slide Time: 2:03)

Cpt S 223. School of EECS, WSU

Linear Programming. March 14, 2014

5.1 Bipartite Matching

CRITICAL PATH METHOD (CEE 320 VDC SEMINAR)

Project Scheduling: PERT/CPM

Chapter 11: PERT for Project Planning and Scheduling

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

Social Media Mining. Graph Essentials

6.231 Dynamic Programming and Stochastic Control Fall 2008

1 Solving LPs: The Simplex Algorithm of George Dantzig

Approximation Algorithms

ME 407 Mechanical Engineering Design Spring 2016

A Computer Application for Scheduling in MS Project

Cambridge International AS and A Level Computer Science

Data Structures and Algorithms Written Examination

Triangle deletion. Ernie Croot. February 3, 2010

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

Network Planning and Analysis

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

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) Total 92.

Foundations of Operations Research

Instruction Scheduling. Software Pipelining - 2

MECH 896 Professional Development for MEng Students. Homework Discussion. Scheduling Overview. Winter 2015: Lecture #5 Project Time Management

Modern Optimization Methods for Big Data Problems MATH11146 The University of Edinburgh

Scheduling Single Machine Scheduling. Tim Nieberg

Project Planning. Lecture Objectives. Basic Reasons for Planning. Planning. Project Planning and Control System. Planning Steps

Network Calculations

Software Engineering. Pert and Gantt exercises. Lecturer: Giuseppe Santucci

14.1 Rent-or-buy problem

LINEAR INEQUALITIES. Mathematics is the art of saying many things in many different ways. MAXWELL

6.02 Practice Problems: Routing

NP-Hardness Results Related to PPAD

The work breakdown structure can be illustrated in a block diagram:

Project Planning and Scheduling

CSE 4351/5351 Notes 7: Task Scheduling & Load Balancing

Grace Emmaus Walk #49 Recipes

Reinforcement Learning

4.6 Linear Programming duality

Algorithm Design and Analysis

Special Situations in the Simplex Algorithm

2.3 Convex Constrained Optimization Problems

Deming s 14 Points for TQM

Dynamic Programming. Lecture Overview Introduction

Introduction to Scheduling Theory

Project Management 1. PROJECT MANAGEMENT PROJECT ANALYSIS...3

Managerial Economics Prof. Trupti Mishra S.J.M. School of Management Indian Institute of Technology, Bombay. Lecture - 13 Consumer Behaviour (Contd )

What is Linear Programming?

Project Scheduling & Tracking

Reinforcement Learning

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Operational Research. Project Menagement Method by CPM/ PERT

Project Management SCM Pearson Education, Inc. publishing as Prentice Hall

Linear Programming Notes V Problem Transformations

Project Management Chapter 3

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

SWEN 256 Software Process & Project Management

IEOR 4404 Homework #2 Intro OR: Deterministic Models February 14, 2011 Prof. Jay Sethuraman Page 1 of 5. Homework #2

Project Scheduling: PERT/CPM

IE 680 Special Topics in Production Systems: Networks, Routing and Logistics*

Dynamic Programming 11.1 AN ELEMENTARY EXAMPLE

Exercise 12 " Project Management "

Goals of the Unit. spm adolfo villafiorita - introduction to software project management

5 Directed acyclic graphs

Module 3: The Project Planning Stage

Chapter 11 Monte Carlo Simulation

Modeling and Performance Evaluation of Computer Systems Security Operation 1

Near Optimal Solutions

Automata and Computability. Solutions to Exercises

PROJECT EVALUATION REVIEW TECHNIQUE (PERT) AND CRITICAL PATH METHOD (CPM)

Actually Doing It! 6. Prove that the regular unit cube (say 1cm=unit) of sufficiently high dimension can fit inside it the whole city of New York.

Project Time Management

1. Then f has a relative maximum at x = c if f(c) f(x) for all values of x in some

CS 598CSC: Combinatorial Optimization Lecture date: 2/4/2010

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

Mining Social Network Graphs

in R Binbin Lu, Martin Charlton National Centre for Geocomputation National University of Ireland Maynooth The R User Conference 2011

Sect Least Common Multiple

LECTURE 5: SOFTWARE PROJECT MANAGEMENT. Software Engineering Mike Wooldridge

In order to describe motion you need to describe the following properties.

Priori ty

Sugar Cookies. Ice Box Cookies. Hannah Christiane Hansen Cox. Hannah Christiane Hansen Cox. Ingredients: Ingredients:

CHAPTER 1. Basic Concepts on Planning and Scheduling

Minimum cost maximum flow, Minimum cost circulation, Cost/Capacity scaling

Leaving Certificate Technology. Project Management. Teacher Notes

CSC2420 Spring 2015: Lecture 3

Simplified External memory Algorithms for Planar DAGs. July 2004

Lecture 17 : Equivalence and Order Relations DRAFT

Transcription:

ex-.6-. Foundations of Operations Research Prof. E. Amaldi.6 Shortest paths with nonnegative costs Given the following graph, find a set of shortest paths from node to all the other nodes, using Dijkstra s algorithm. Can we solve the problem with Dynamic Programming? If yes, do so..7 Shortest paths with negative costs and ill-posedness Given the following graph, find the shortest paths between all pairs of nodes, or show that the problem is ill-posed by exhibiting a circuit of total negative cost. 7 8.8 An application of Dynamic Programming to machine renewal A company must buy a new machine and then decide a renewal plan for the next years, making sure that, at any point in time, the available machine works properly. At the beginning of each year of the planning horizon, the company must decide whether to keep the old machine or to substitute it. The maintenance costs and the expected revenue (when the machine is resold) are indicated in the following table. years maintenance (keuro) revenue when resold (keuro) - 7 6 9 Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio

ex-.6-. Foundations of Operations Research Prof. E. Amaldi To avoid high maintenance costs of old machines, the machine can be resold at the beginning of the second, third, fourth, and fifth year, and an new one can be bought. For the sake of simplicity, we suppose that a new machine always costs k Euro. Show that the problem of determing a machine renewal plan of minimal total net cost (total cost for buying/rebuying the machine + maintenance costs - total revenue) can be solved via Dynamic Programming by finding a shortest path in an acyclic directed graph. Find an optimal renewal plan. Is it unique?.9 Project planning The preparation of the apple pie has long been a tradition at Rossi s family. First the weight of the ingredients has to be determined: flour, sugar, butter, eggs, apples, cream. The butter must then be melted down, and added to a mixture of flour, sugar, and eggs. Apples must be added to this new mixture, once they have been peeled and cut into thin slices. The mixture can then be cooked, in the already heated oven. It is advisable to whip the cream only after the apple slices have been added to the mixture. Once the cake is cooked, the cream is used to garnish it. The following table reports the time needed for each activity. Activity Time (minutes) A Weight the ingredients B Melt the butter C Mix flour, eggs and sugar D Peel the apples and cut them into slices E Heat the oven F Add butter to the mixture 8 G Add apples to the mixture H Cook the mixture in the oven I Whip the cream L Garnish Draw the graph (with activities associated to arcs) which represents the project precedences. Determine the earliest times and latest times associated to each node and determine the minimum total completion time of the project. Identify the critical activities and draw Gantt s diagram at earliest.. Shortest paths with negative costs Given the following graph, find the shortest paths between all pairs of nodes, or show that the problem is ill-posed, by exhibiting a circuit of total negative cost. Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio

ex-.6-. Foundations of Operations Research Prof. E. Amaldi - - Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio

ex-.6-. Foundations of Operations Research Prof. E. Amaldi Solution.6 Shortest paths with nonnegative costs Dijkstra s algorithm determines all the shortest paths from a given node s to all the other nodes in the graph. It can be applied to any (directed) graph with nonnegative edge costs. Data structures: S (subset of nodes with fixed labels), initialized to {s}; L(i) (cost of the shortest path from s to i), initialized to L(s) = ; p(i) (predecessor of node i in the shortest path from s to i), initialized to p(s) = s. Description: at each iteration, from the cut induced by S, we identify an arc (v, h), such that L(v) + c vh is minimum (c vh is the cost of the arc (v,h)). S S {h}, L(h) L(v)+c vh, p(h) v. The algorithm halts when S = V. Iterations: Initialization: S = {},L() =,p() = ; (v,h) = (,), L() =, p() =, S = {,}; (v,h) = (,), L() =, p() =, S = {,,}; (v,h) = (,), L() =, p() =, S = {,,,}; (v,h) = (,), L() =, p() =, S = {,,,,}; (v,h) = (,), L() =, p() =, S = {,,,,,}; (v,h) = (,7), L(7) =, p(7) =, S = {,,,,,,7}; (v,h) = (,6), L(6) =, p(6) =, S = G: STOP; Wecanplotthebehaviourofthealgorithmasfollows. Inthepictures, anodeishighlighted if it is in S, while an arc is represented with a dashed line if it can be selected in the current iteration, and in a solid line when it is chosen. The labels on the nodes in S indicate the cost of the shortest path from node. When a dashed arc is incident to two nodes in S, it is removed. This way, the dashed arcs always belongs to the cut induced by S. The arc (i,j) that is selected is always that with minimum cost L(i)+c ij. : L: : L: L: : L: L: L: : L: L: L: L: Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio

ex-.6-. Foundations of Operations Research Prof. E. Amaldi L: L: L: L: L: L: L: : 7: L: L: L: L: L: L: L: L: L: 6: 8: 6 L: 7 L: L: L: L: L: L: L: L: L: A topological order can be introduced as follows. At iteration i, for i = {,...,n}, pick a node with no incident arcs, label it as node i, remove it from the graph, iterate until all nodes are removed, or there is no node with no incident arcs in this case the graph is not acyclic. The graph we are dealing with is acyclic, and its node indices already induce its topological order. The Dynamic Programming technique can therefore be applied. It has complexity O(m), smaller than that of the Dijkstra algorithm of O(n +m). L() =, p() = ; L() = L()+c =, p() = ; L() = min{l()+c,l()+c } = min{+,+} =, p() = ; L() = min{l()+c,l()+c } = min{+,+} =, p() = ; L() = min{l()+c,l()+c } = min{+,+} =, p() = ; L() = min{l()+c,l()+c } = min{+,+} =, p() = ; L(6) = min{l()+c 6,L()+c 6 } = min{+,+} =, p(6) = ; L(7) = min{l()+c 7,L()+c 7,L(6)+c 67 } = min{+,+,+} =,p(7) = ;.7 Shortest paths with negative costs and ill-posedness Since the graph contains negative arc costs, we use Floyd-Warshall s algorithm that finds a shortest path between each pair of nodes, or establishes that the problem is ill-posed by exhibiting a circuit of negative cost. The graph can contain cycles, but such cycles have to be of nonnegative cost. It has complexity O(n ), where n is the number of nodes in the graph. Data structures: let D be a matrix such that element d ij is, at the beginning of the algorithm, the cost of arc (i,j) and, at the end, the cost of a shortest path from i to j. Let P be a matrix of precedecessors (P = (p ij ), where p ij is the precedecessor of node j in the shortest path from i to j). Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio

ex-.6-. Foundations of Operations Research Prof. E. Amaldi Description: at each iteration, we select a node with index h n and compute the length of the paths via h for all pairs of nodes (i,j) different from h. If the path from i to j, passing through h, is shorter than that the original one from i to j, matrices D and P are updated: d ij is set to the cost of the path through h, and p ij is updated to p hj. The algorithm halts when one of the following conditions holds () all nodes have been selected for the triangulations () there is a circuit of negative cost: the problem of finding a shortest path (not necessarily simple!) it not well defined. Indeed, it is possible to go through the negative cost circuit an arbitrary number of times, reducing the cost of the path containing such circuit at each iteration. The problem is, evidently, unbounded. (a) Initial configuration D 8 - -7 P In considering all pairs of nodes i,j, including those where i or j equals h, some useless iterations are performed. Indeed, they amount to check whether a path from i to h is shorter than that from i to h plus that from h to itself Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio 6

ex-.6-. Foundations of Operations Research Prof. E. Amaldi (b) Iteration h = (triangulation on node ) d +d = 8 > d = d +d = > d = d +d = 8 < d = update d,p d +d = < d = update d,p d +d = 6 > d = d +d = < d = update d,p d +d ij = ( i,j) (c) Iteration h = (triangulation on node ) D 8 8 - -7 P d +d = 8 > d = d +d = 7 < d = 8 update d,p d +d = > d = d +d = 6 > d = d +d = > d = d +d = 9 > d = d +d = < d = update d,p d +d = < d = D 7 8 - - -7 - P update d,p d +d = > d = Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio 7

ex-.6-. Foundations of Operations Research Prof. E. Amaldi (d) Iteration h = (triangulation on node ) d +d = > d = d +d = 8 > d = d +d = 8 > d = d +d = < d = update d,p d +d = > d = d +d = < d = 8 update d,p d +d = < d = update d,p d +d = > d = 7 d +d = < d = D 7 - - -7 - - P update d,p We obtain d = < and the algorithm halts: we found a circuit of total negative cost of - ( )..8 An application of Dynamic Programming to machine renewal Consider a directed graph with 6 nodes: nodes from to are associated to the beginning of each year, while node 6 indicates the end of the period of interest. For each pair i,j, i,j =,...,, i < j, arc (i,j) represents the choice of reselling, at the beginning of year j, a machine that was bought at the beginning of year i. The cost c ij is defined as j i c ij = a+ m k r j i, k=i where a is the buying cost of Euros, m k is the maintenance cost for year k, and r j is the price at which the machine is sold. We obtain the following directed acyclic graph 6 7 7 7 7 7 Any path from to 6 corresponds to a plan, with a cost equivalent to that of the path. Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio 8

ex-.6-. Foundations of Operations Research Prof. E. Amaldi Therefore, we need to look for a shortest path from to 6. We apply the Dynamic Programming algorithm, obtaining (a) L() = ; (b) L() = 7, p() = ; (c) L() =, p() = ; (d) L() = 9, p() = ; (e) L() =, p() = ; (f) L(6) =, p(6) =. A shortest path (of cost ) is 6. It amounts to buy a new machine every years. Note that there is another optimal solution: 7..9 Project planning The following table indicates the duration of each activity and the related precedence relations: Activities Duration Predecessors A Weight the ingredients - B Meld the butter down A C Mix flour, eggs, and sugar A D Peel and cut the apples into slices A E Heaten the oven - F Add butter to the mixture 8 B,C G Add apples to the mixture D,F H Cook the mixture in the oven E,G I Whip the cream G L Garnish H,I We derive the precedence graph as follows. For each activity, we introduce an arc whose cost is equivalent to the duration of the activity (its two nodes represent the beginning and the end of the activity). For each precedence relation A i < A j, an fictitious arc (i,j) of duration is introduced (dashed lines) between the ending node of A i and the beginning node of j. We add a node s, connected to the beginning node of each activity, with cost, for all activities with no prerequisites. Similarly, we add a node t, and connect to it all the ending nodes for all the activities that are not a prerequisite for any other activities, with cost. B F A C I s D G L t E H Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio 9

ex-.6-. Foundations of Operations Research Prof. E. Amaldi The graph can be reduced to a smaller one as shown in the lectures. The following graph is obtained. B F s A C G I E D H L t We use the Critical Path Method (CPM) to determine the ASAP and ALAP values, T min,t max, for each node of the graph. The algorithm is composed of two phases, were the Dynamic Programing technique is applied to find longest and shortest paths in the graph. The algorithm is outlined as follows. (a) T min () = ; (b) sort the nodes in topological order; (c) for each h =,...,n: let T min (h) = max{t min (i)+d ih (i,h) δ (h)}; (d) T max (n) = T min (n); (e) for each h = n,...,: let T max (h) = min{t max (i) d ih (i,h) δ + (h)}. We obtain the following solution [,] [,] [,] s A B F 8 [8,8] [,] C G I [,] D E H [,] [6,6] [67,67] L t The slacks for the activities are (a) σ(a) = T max () T min () d = = Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio

ex-.6-. Foundations of Operations Research Prof. E. Amaldi (b) σ(b) = T max () T min () d = = (c) σ(c) = T max () T min () d = = (d) σ(d) = T max () T min () d = 8 = (e) σ(e) = T max (6) T min () d 6 = = (f) σ(f) = T max () T min () d = 8 8 = (g) σ(g) = T max (6) T min () d 6 = 8 = (h) σ(h) = T max (8) T min (7) d 78 = 6 = (i) σ(i) = T max (8) T min (6) d 68 = 6 = (j) σ(i) = T max (9) T min (8) d 89 = 67 6 7 = The critical activities are A,C,F,G,H,L. The ASAP Gantt diagram is I E D B A C F G H L 6 6 67 Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio

ex-.6-. Foundations of Operations Research Prof. E. Amaldi. Shortest paths with negative costs. We apply Floyd-Warshall s algorithm. (a) Initial configuration (b) Iteration h = (triangulation on node ) d +d = + = 6 > d = d +d = + = = d = d +d = + = > d = d +d = + = > d = (c) Iteration h = (triangulation on node ) d +d = + = 6 > d = d +d = + = 9 > d = d +d = + = > d = d +d = + = = d = (d) Iteration h = (triangulation on node ) d +d = = > d = d +d = = < d = update d,p d +d = = > d = d +d = = > d = D - - D - - D - - D - - - P P P P Document prepared by L. Liberti, S. Bosio, S. Coniglio, and C. Iuliano. Translation to English by S. Coniglio