Download presentation
Presentation is loading. Please wait.
1
Advanced Algorithms Analysis and Design
By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
2
Lecture No. 18 2-Line Assembly Scheduling Problem
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
3
Today Covered 2-Line Assembly Scheduling Algorithm using Dynamic Programming Time Complexity n-Line Assembly Problem Brute Force Analysis n-Line Assembly Scheduling Algorithm using Dynamic Programming Generalization and Applications Conclusion Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
4
Assembly-Line Scheduling Problem
There are two assembly lines each with n stations The jth station on line i is denoted by Si, j The assembly time at that station is ai,j. An auto enters factory, goes into line i taking time ei After going through the jth station on a line i, the auto goes on to the (j+1)st station on either line There is no transfer cost if it stays on the same line It takes time ti,j to transfer to other line after station Si,j After exiting the nth station on a line, it takes time xi for the completed auto to exit the factory. Problem is to determine which stations to choose from lines 1 and 2 to minimize total time through the factory. Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
5
Mathematical Model Defining Objective Function
Base Cases f1[1] = e1 + a1,1 f2[1] = e2 + a2,1 Two possible ways of computing f1[j] f1[j] = f2[j-1] + t2, j-1 + a1, j OR f1[j] = f1[j-1] + a1, j For j = 2, 3, . . ., n f1[j] = min (f1[j-1] + a1, j, f2[j-1] + t2, j-1 + a1, j) Symmetrically f2[j] = min (f2[j-1] + a2, j, f1[j-1] + t1, j-1 + a2, j) Objective function = f* = min(f1[n] + x1, f2[n] + x2) Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
6
Dynamic Algorithm FASTEST-WAY(a, t, e, x, n) 1 ƒ1[1] e1 + a1,1
for j 2 to n do if ƒ1[ j - 1] + a1, j ≤ ƒ2[ j - 1] + t2, j a1, j then ƒ1[ j] ƒ1[ j - 1] + a1, j l1[ j] 1 else ƒ1[ j] ƒ2[ j - 1] + t2, j a1, j l1[ j] 2 if ƒ2[ j - 1] + a2, j ≤ ƒ1[ j - 1] + t1, j a 2, j Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
7
Contd.. then ƒ2[ j] ƒ2[ j - 1] + a2, j l2[ j] 2
else ƒ2[ j] ƒ1[ j - 1] + t1, j a2, j l2[ j] 1 if ƒ1[n] + x1 ≤ ƒ2[n] + x2 then ƒ* = ƒ1[n] + x1 l* = 1 else ƒ* = ƒ2[n] + x2 l* = 2 Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
8
Optimal Solution: Constructing The Fastest Way
Print-Stations (l, n) i l* print “line” i “, station” n for j n downto 2 do i li[j] print “line” i “, station” j - 1 Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
9
n-Line Assembly Problem
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
10
n-Assembly Line Scheduling Problem
There are n assembly lines each with m stations The jth station on line i is denoted by Si, j The assembly time at that station is ai,j. An auto enters factory, goes into line i taking time ei After going through the jth station on a line i, the auto goes on to the (j+1)st station on either line It takes time ti,j to transfer from line i, station j to line i’ and station j+1 After exiting the nth station on a line i, it takes time xi for the completed auto to exit the factory. Problem is to determine which stations to choose from lines 1 to n to minimize total time through the factory. Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
11
n-Line: Brute Force Solution
11 12 13 1 m 21 22 23 2 In Out ei x xi sn 3 snm en xn sij si sim t ( , j - ) e Total Computational Time = possible ways to enter in stations at level n x one way Cost Possible ways to enter in stations at level 1 = n1 Possible ways to enter in stations at level 2 = n Possible ways to enter in stations at level m = nm Total Computational Time = (m.mn) Dr. Nazir A. Zafar Advanced Algorithms Analysis and Design
12
Dynamic Solution Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
13
Notations : n-Line Assembly
11 12 13 1 m 21 22 23 2 In Out ei x xi sn 3 snm en xn sij si sim t ( , j - ) e Let fi[j] = fastest time from starting point to station Si, j f1[m] = fastest time from starting point to station S1 m f2[m] = fastest time from starting point to station S2,m fn[m] = fastest time from starting point to station Sn,m li[j] = The line number, 1 to n, whose station j-1 is used in a fastest way through station Si’, j Dr. Nazir A. Zafar Advanced Algorithms Analysis and Design
14
Notations : n-Line Assembly
11 12 13 1 m 21 22 23 2 In Out ei x xi sn 3 snm en xn sij si sim t ( , j - ) e ti[j-1] = transfer time from station Si, j-1 to station Si,, j a[i, j] = time of assembling at station Si, j f* = is minimum time through any way l* = the line no. whose mth station is used in a fastest way Dr. Nazir A. Zafar Advanced Algorithms Analysis and Design
15
Possible Lines to reach Station S(i, j)
11 12 1j-1 1 m 21 22 2j-1 2 In Out ei x xi sn j-1 snm en xn sij si sim t ( , j - ) e Time from Line 1, f[1, j-1] + t[1, j-1] + a[i, j] Time from Line 2, f[2, j-1] + t[2, j-1] + a[i, j] Time from Line 3, f[3, j-1] + t[3, j-1] + a[i, j] . . . Time from Line n, f[n, j-1] + t[n, j-1] + a[i, j] Dr. Nazir A. Zafar Advanced Algorithms Analysis and Design
16
Values of f(i, j) and l* at Station S(i, j)
11 12 13 1 m 21 22 23 2 In Out ei x xi sn 3 snm en xn sij si sim t ( , j - ) e f[i, j] = min{f[1, j-1] + t[1, j-1] + a[i, j], f[2, j-1] + t[2, j-1] + a[i, j], . . , f[n, j-1] + t[n, j-1] + a[i, j]} f[1, 1] = e1 + a[1, 1]; f [2, 1] = e2 + a[2, 1], … ,f [n, 1] = en + a[n, 1] f* = min{f[1, n] +x1, f[2, n] + x2, . . , f[n, m] + xn} l* = line number of mth station used Dr. Nazir A. Zafar Advanced Algorithms Analysis and Design
17
n-Line Assembly: Dynamic Algorithm
FASTEST-WAY(a, t, e, x, n, m) 1 for i 1 to n 2 ƒ[i,1] e[i] + a[i,1] 3 for j 2 to m for i 1 to n 5 ƒ[i, j] f[1, j-1] + t[1, j-1] + a[i, j] 6 L[1, j] = 1 7 for k 2 to n if f[i,j] > f[k, j-1] + t[2, j-1] + a[i, j] then f[i,j] f[k, j-1] + t[2, j-1] + a[i, j] L[i, j] = k end if Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
18
n-Line Assembly: Dynamic Algorithm
11 ƒ* ƒ[1, m] + x[1] 12 l* = 1 13 for k 2 to n if f* > f[k, m] + x[k] then ƒ* ƒ[k, m] + x[k] l* = k Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
19
Constructing the Fastest Way: n-Line
Print-Stations (l*, m) i l* print “line” i “, station” m for j m downto 2 do i li[j] print “line” i “, station” j - 1 Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
20
Generalization: Cyclic Assembly Line Scheduling
Title: Moving policies in cyclic assembly line scheduling Source: Theoretical Computer Science, Volume 351, Issue (February 2006) Summary: Assembly line problem occurs in various kinds of production automation. In this paper, originality lies in the automated manufacturing of PC boards. In this case, the assembly line has to process number of identical work pieces in a cyclic fashion. In contrast to common variant of assembly line scheduling. Each station may process parts of several work-pieces at the same time, and parts of a work-piece may be processed by several stations at the same time. Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
21
Application: Multiprocessor Scheduling
The assembly line problem is well known in the area of multiprocessor scheduling. In this problem, we are given a set of tasks to be executed by a system with n identical processors. Each task, Ti, requires a fixed, known time pi to execute. Tasks are indivisible, so that at most one processor may be executing a given task at any time They are un-interruptible, i.e., once assigned a task, may not leave it until task is complete. The precedence ordering restrictions between tasks may be represented by a tree or forest of trees Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
22
Conclusion Assembly line problem is discussed Generalization is made
Mathematical Model of generalized problem is discribed Algorithm is proposed Applications are observed in various domains Some research issues are identified Dr Nazir A. Zafar Advanced Algorithms Analysis and Design
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.