兩臺處理機A 和B處理n個作業。設第i個作業交給機器
A 處理時需要時間ai,若由機器B 來處理,則需要時間bi。由于各作
業的特點和機器的性能關系,很可能對于某些i,有ai >=bi,而對于
某些j,j!=i,有aj<bj。既不能將一個作業分開由兩臺機器處理,也沒
有一臺機器能同時處理2 個作業。設計一個動態規劃算法,使得這兩
臺機器處理完成這n 個作業的時間最短(從任何一臺機器開工到最后
一臺機器停工的總時間)。研究一個實例:(a1,a2,a3,a4,a5,a6)=
(2,5,7,10,5,2);(b1,b2,b3,b4,b5,b6)=(3,8,4,11,3,4)
標簽:
處理機
機器
上傳時間:
2014-01-14
上傳用戶:獨孤求源
Instead of finding the longest common
subsequence, let us try to determine the
length of the LCS.
Then tracking back to find the LCS.
Consider a1a2…am and b1b2…bn.
Case 1: am=bn. The LCS must contain am,
we have to find the LCS of a1a2…am-1 and
b1b2…bn-1.
Case 2: am≠bn. Wehave to find the LCS of
a1a2…am-1 and b1b2…bn, and a1a2…am and
b b b
b1b2…bn-1
Let A = a1 a2 … am and B = b1 b2 … bn
Let Li j denote the length of the longest i,g g
common subsequence of a1 a2 … ai and b1 b2
… bj.
Li,j = Li-1,j-1 + 1 if ai=bj
max{ L L } a≠b i-1,j, i,j-1 if ai≠j
L0,0 = L0,j = Li,0 = 0 for 1≤i≤m, 1≤j≤n.
標簽:
the
subsequence
determine
Instead
上傳時間:
2013-12-17
上傳用戶:evil