فصل ششم

Click here to load reader

download فصل ششم

of 58

description

درس طراحی الگوریتم ها. فصل ششم. راهبرد شاخه و حد Branch & Bound approach. مدرس: سید محمد بیدکی. بهار 1392. مقدمه. الگوریتم شاخه و حد، شکل بهبود یافته ای از الگوریتم عقبگرد است. راهبرد طراحی در شاخه و حد از آن جهت به عقبگرد شباهت دارد که در آن برای حل مسئله از درخت فضای حالت استفاده می شود. - PowerPoint PPT Presentation

Transcript of فصل ششم

Branch & Bound approach : 1392

- : - 2 . . : . . () ./58 ... - : - 3 . . . . .

/58 ( ) - : - 4 .

/58 - : - 5 : /58 - : - 6 . . . . . ./58 - : - 7

/58 - : - 8 . . . ( ) . . . ./58 - : - 9

/58 - : - 10 W . . ./58 - : - 11 weight i : weight W . : pi/wi . (bound). profit . bound totweight profit weight . bound totweight W . bound .

/58 ... - : - 12 i k W :

maxprofit . bound maxprofit i .

/58 ( ) - : - 13

/58 - : - 14

1234567891011121314151617/58 - : - 15 :

/58 - : - 16

/58 - : - 17

/58 ( ) - : - 18

./58 - : - 191) (0,0)Profit = 0$Weight = 0Maxprofit = 0$totweight = 0+2+5 = 7Bound = 0 + 40 + 30 + (16-7)*5 = 115$ : (weight maxprofit)/58 - : - 20

/58 - : - 212) (1,1)Profit = 40$Weight = 2Maxprofit = 0$ 40$Bound = 115$ : (weight maxprofit)

(1,2)Profit = 0$Weight = 0Maxprofit = 40$Bound = 0 + 30 + 50 + (16-15)*2 = 82$ : (weight maxprofit)

/58 - : - 22

/58 - : - 233) (2,1)Profit = 70$Weight = 7Maxprofit = 40$ 70$Bound = 115$ : (weight maxprofit)

(2,2)Profit = 40$Weight = 2Maxprofit = 70$Bound = 40 + 50 + (16-12)*2 = 98$ : (weight maxprofit)

/58 - : - 24

/58 - : - 254) (3,1)Profit = 120$Weight = 17Maxprofit = 70$Bound = 0$ : (weight 16)

(3,2)Profit = 70$Weight = 7Maxprofit = 70$Bound = 70 + 10 = 80$ : (weight maxprofit)

/58 - : - 26

/58 - : - 275) (3,3)Profit = 90$Weight = 12Maxprofit = 70$ 90$Bound = 90 + (16-12)*2 = 98$ : (weight maxprofit) (3,2) (1,2) .

(3,4)Profit = 40$Weight = 2Maxprofit = 90$Bound = 40 + 10 = 50$ : (bound maxprofit)

/58 - : - 28

/58 - : - 296) (4,1)Profit = 100$Weight = 17Maxprofit = 90$Bound = 0$ : (weight 16)

(4,2)Profit = 90$Weight = 12Maxprofit = 90$Bound = 90$ : (bound maxprofit)

/58 - : - 30

/58 - : - 31 :

/58 - : - 32

/58 - : - 33

/58 - : - 34 . . . . . ./58 - : - 35 5 . .

/58 - : - 36

. . ./58 - : - 37 . . ( ) . .

/58 ( ) - : - 38 . v1 .

[1] .

4+7+4+2+4 = 21

/58 ( )... - : - 39 [1,2] .

14+7+4+2+4 = 31

/58 ( )... - : - 40 [1,2,3] .

14+7+7+2+4 = 34

/58 - : - 41 . ( ) . 1 . . () . .

/58 ( ) - : - 42

/58 - : - 431) [1]minlenght = Bound = 4+7+4+2+4 = 21 : (bound < minlenght)/58 - : - 44

/58 - : - 452) [1,2]minlenght = Bound = 14+7+4+2+4 = 31 : (bound < minlenght) [1,3]minlenght = Bound = 4+7+5+2+4 = 22 : (bound < minlenght) [1,4]minlenght = Bound = 10+7+4+2+7 = 30 : (bound < minlenght) [1,5]minlenght = Bound = 20+7+4+7+4 = 42 : (bound < minlenght)

/58 - : - 46

/58 - : - 473) [1,3,2]minlenght = Bound = 4+7+5+2+4 = 22 : (bound < minlenght) [1,3,4]minlenght = Bound = 4+7+7+2+7 = 27 : (bound < minlenght) [1,3,5]minlenght = Bound = 4+8+16+7+4 = 39 : (bound < minlenght)

/58 - : - 48

/58 - : - 494) [1,3,2,4] ==> [1,3,2,4,5,1]Bound = 4+8+5+2+18 = 37 (minlenght > bound) => minlenght = 37 [1,5] [1,3,5] .

[1,3,2,5] ==> [1,3,2,5,4,1]Bound = 4+7+5+4+11 = 31 (minlenght > bound) => minlenght = 37 31 [1,2] ./58 - : - 50

/58 - : - 515) [1,3,4,2] ==> [1,3,4,2,5,1]Bound = 4+7+7+7+18 = 43 (minlenght < bound) => minlenght = 31

[1,3,4,5] ==> [1,3,4,5,2,1]Bound = 4+14+7+2+7 = 34 (minlenght < bound) => minlenght = 31/58 - : - 52

/58 - : - 536) [1,4,2]minlenght = 31Bound = 10+7+4+7+17 = 45 : (bound minlenght) [1,4,3]minlenght = 31Bound = 10+7+5+9+7 = 38 : (bound minlenght) [1,4,5]minlenght = 31Bound = 10+7+4+2+7 = 30 : (bound < minlenght)

/58 - : - 54

/58 - : - 557) [1,4,5,2] ==> [1,4,5,2,3,1]Bound = 10+7+4+2+7 = 30 (minlenght < bound) => minlenght = 31 30

[1,4,5,3] ==> [1,4,5,3,2,1]Bound = 10+14+5+2+17 = 48 (minlenght > bound) => minlenght = 30/58 - : - 56

/58 - : - 57 :

/58 - : - 58

/58