 Hello everyone, myself Mr. R. F. R. Sayal. I work as an assistant professor in the department of computer science and engineering at Halchin Institute of Technology. So, the topic for my today's lecture is flow shop scheduling problem. Now, at the end of the session the students will be able to solve the flow shop scheduling problem. Now, as we know the processing of job requires several distinct tasks to be completed. Now, taking an example of computer programs. Now, computer programs generally run in a multi-programming environment and these are given as input to the machine which are first executed and after the execution the jobs are queued for output and then their output is printed. Now, for flow shop scheduling there are n number of jobs where every job consists of m number of tasks that is for a job i we have tasks t 1 i t 2 i t 3 i up to t m i where i ranges from 1 to n and the task t j i is to be performed on processor p j or is to be executed on processor p j where j lies between 1 to m. Now, the time required to complete the task t j i is small t j i. So, we are expected to schedule these n jobs and the scheduling is nothing but assignment of the tasks to the time intervals on the processors and the basic condition is on a processor no more than one task could be executed at the same time. Now, processing of a task t j i where j is greater than 1 cannot be started until task t j minus 1 i is completed that is for a particular job if we have 2 tasks the previous task should be completed first and then the next task can be executed. Now, n jobs each requiring m tasks are to be scheduled on the m processors. So, this is what is our flow shop scheduling problem. Now, the schedule that could be generated are first one is a non preemptive schedule and the second one is a preemptive schedule. Let us see what these schedules are a non preemptive schedule is nothing but where the tasks are processed on any processor and those tasks are not terminated until the task is complete. So, that means, once the task is started on a processor it will be completed at any cost without any other task interrupting it, but whereas a case for preemptive scheduling the processing of a task on the processor may be terminated sometimes and another task may be assigned to the processor. So, this is the difference between non preemptive and preemptive schedule. Now, the finished time f i of s of a job i is the time at which all the tasks of the job i have been completed in the schedule s. Now, similarly the finished time f of s that is capital F of s of the schedule s is given as f of s is equal to maximum of small f i of s where i ranges from 1 to n meaning the finished time of the schedule is calculated as by considering all the finished times of the jobs in that schedule and out of those which job has a maximum finish time that maximum finish time is the finish time of the schedule. Similarly, we have another term mean flow time of the schedule s which is given as 1 by n into summation of all f i of s where i ranges from 1 to n this is nothing but the average of the finished time of all jobs. Similarly, we have some other terminologies and optimal finish time OFT schedule for a given set of jobs is a non preemptive schedule for which f of s is minimum over all non preemptive schedule s. Similarly, as we had an optimal finish time as in the case of non preemptive a preemptive optimal finish time schedule for a given set of jobs is a preemptive schedule s for which f of s is minimum over all preemptive schedules s. So, these are nothing but the optimal finish times for the preemptive and the non preemptive case. We have an example where two jobs have to be scheduled on three processors and we are expected to find the schedule of the non preemptive case that is a non preemptive schedule we are expected to find out and the following matrix gives the task times this is nothing but we have two jobs it is these one column indicates the task times of the individual task for a job that is this first column indicates that the first task will take two units time second task three unit time third task final times of job one. Similarly, this is for second job now these we have to schedule on three processors these tasks have to be scheduled on the three processors. Now, since the first task of the first job requires two time units it has to be processed on processor P1 since it is the task one. So, it will be processed on processor P1 from time unit 0 to 2. Now, at the same time we know that for second job there is no time requirement on processor P1. So, hence we can say directly the task 2 of job 2 can be started. So, it will be started from this point at time instant 0 and it requires three time units. So, therefore, it will be scheduled on processor P2. In the meanwhile after finishing this the second task of job 1 that is T21 is scheduled on processor P2 and then the third task of job 2 is scheduled on processor P3 and finally, the third task of job 1 is scheduled on processor P3. So, this is the non-preemptive schedule S for the given set of jobs. Now, here the finish time of job 1 is calculated as the point at which job 1 got completed that is time instance 11. So, hence we have the answer as f 1 of s equal to 11. Now, pause the video and answer this question calculate the finish time of job 2 in the example. Now, the answer is when you see job 2 we have two tasks that is T22 and T32. So, the last task that we need to say is at what time does it get completed? So, it gets completed at time instance 5. So, therefore, f 2 of s is equal to 5 that is second job gets completed at time instance 5. The finish time f s of the non-preemptive schedule s is given as f s equal to max of f i of s where i goes from 1 to n that is max of f 1 of s comma f 2 of s this is equal to max of 11 comma 5 which is equal to 11. So, this is the finish time of the non-preemptive schedule s. Similarly, now that matrix that we had which gives that task times for the two jobs which have to be scheduled on three processors we are expected now to find out the preemptive schedule for it. So, we start with the first task of job 1 which will be processed on processor p 1 and the task 2 of job 2 is processed on processor 2 for two time units. Now, task t 2 1 is arising the task t 2 1 is scheduled on processor p 2 for three time units. Now, remember one thing t 2 2 has time units 3, but we are interrupting it or preempting it after two time units. So, that means, one time unit of execution is still pending. So, that will be done later as shown in the diagram. So, here we can see the task t 2 2 is preempted and priority is given to task t 2 1 that is task 2 of job 1 and it is executed on processor p 2. After that the remaining task that is t 3 1 is executed on processor p 3 and finally, the task t 3 2 is executed after execution of t 3 1. So, here the priority is given to the task of job 1. So, here also we can see job 1 ends at time instance 10 that is t 3 1 ends at time instance 10 and t 3 2 that is job 2 ends at time instance 12. So, the finish time of job 1 is f 1 of s equal to 10 and finish time of job 2 is f 2 of s equal to 12. The finish time that is capital FS of non-preemptive schedule s is equal to max of f i of s where i goes from 1 to n that is max of f 1 of s comma f 2 of s which is equal to max of 10 comma 12 which is equal to 12. And finally, we see an application of this flow shop scheduling an application is where we are having n machines and m jobs are to be processed on it and we know that each job requires n operations to be executed and ith operation will be executed on the machine i. And another condition is no machine can perform more than one operation simultaneously as well as the operation within one job must be performed in a predefined order or in a specified order. The main aim is to determine the optimal schedule and optimal schedule is one which takes minimum amount of time. This is the reference. Thank you.