ΠΛΗ30 ΜΑΘΗΜΑ 6.5

download ΠΛΗ30 ΜΑΘΗΜΑ 6.5

of 21

  • date post

    18-Aug-2015
  • Category

    Education

  • view

    34
  • download

    0

Embed Size (px)

Transcript of ΠΛΗ30 ΜΑΘΗΜΑ 6.5

  1. 1. 30 6: NP- 6.5:
  2. 2. . . 1. 1. 2. 2. PARTITION NP- 3. KNAPSACK NP- 1. KNAPSACK NP 2. PARTITION KNAPSACK 4. 3PM NP- 5. x3C NP- 1. X3C NP 2. 3PM X3C 6. EXACT-COVER NP- 7. SET-COVER NP- 1. SET-COVER NP 2. EXACT-COVER SET-COVER 2 , 30, 6.5:
  3. 3. . : (-) (-) KNAPSACK NP- X3C NP- SET-COVER NP- 3 , 30, 6.5:
  4. 4. B. 1. 1. 4 , 30, 6.5: NP-, : 1. Turing- . Turing- () . 2. NP- ( ) E : () () NP. 2 , NP- (NP-Hard)
  5. 5. B. 1. 2. 5 , 30, 6.5: : 3SAT 1in3SAT X3C PARTITION EXACT COVER SET COVER 3PM KNAPSACK
  6. 6. B. 1. To PARTITION NP- 6 , 30, 6.5: PARTITION : : ( 1in3SAT ) . PARTITION: : n ={1,2,],n} : , ; 1: ={1,2,2,3,7,8,9}. : 1={2,2,3,9} 2={1,7,8} 2: ={1,3,5,8}. :
  7. 7. B. 2. To KNAPSACK NP- 7 , 30, 6.5: KNAPSACK : : 1. NP 2. PARTITION KNAPSACK / KNAPSACK: : n A={1,2,],n} i wi vi. W, V. : W V.
  8. 8. B. 2. To KNAPSACK NP- 1. To KNAPSACK NP 8 , 30, 6.5: 1. KNAPSACK NP n A, W,V: O(n) W O(n), V (n). . KNAPSACK NP
  9. 9. B. 2. To KNAPSACK NP- 2. To PARTITION KNAPSACK / 9 , 30, 6.5: 2.A) PARTITION KNAPSACK PARTITION KNAPSACK ={1,2,],n} PARTITION , W,V : W V. : = . W,V .
  10. 10. B. 2. To KNAPSACK NP- 2. To PARTITION KNAPSACK 10 , 30, 6.5: : 1, 2 : 1 2 1, 2 (.. 1) ( W) ( V) : : : , -.
  11. 11. B. 2. To KNAPSACK NP- 2. To PARTITION KNAPSACK 11 , 30, 6.5: 2.) . ( O(n) W V (1) )
  12. 12. B. 3. To 3PM NP- 12 , 30, 6.5: TRIPARTITE-MATCHING(3PM) : : ( 3SAT ) 3PM: : , ", # n . $ % " % # : n ; 1: =(a1,a2), =(b1,b2), C=(c1,c2) R={(a1,b2,c1),(a2,b2,c1),(a1,b1,c2),(a2,b2,c2)} : 2 : (a2,b2,c1) (a1,b1,c2) 2: =(a1,a2), =(b1,b2), C=(c1,c2) R={(a1,b1,c2),(a2,b2,c2),(a1,b2,c1),(a1,b2,c2)} :
  13. 13. B. 4. To X3C NP- 13 , 30, 6.5: EXACT-COVER-BY-3SETS (X3C) : : : 1. NP 2. 3PM X3C EXACT-COVER-BY-3SETS (X3C): : & ' , , , )*+, m U: F '- , - , , -.+, - 3 - U : F F F n : -4 5 & 1: U={1,2,3,4,5,6}, F={{2,3,5},{1,2,4},{3,5,6},{1,5,6}}. : F={{1,2,4},{3,5,6}} 2: U={1,2,3,4,5,6}, F={{1,3,5},{1,2,4},{1,2,6},{1,5,6}}. :
  14. 14. B. 4. To 3C NP- 1. To X3C NP 14 , 30, 6.5: 1. X3C NP n U, m F: O(n) F F U (.. F 3n ) O(n) . X3C NP
  15. 15. B. 4. To X3C NP- 2. To 3PM X3C / 15 , 30, 6.5: 2.A) 3PM X3C 3PM X3C ={1,2,],n}, ={b1,b2,],bn}, C={c1,c2,],cn} $ % " % # 3PM U F '- , - , , -.+, ( - 3 - U ) 6 6 6 7 A,B,C 8 8 9 : U : & " C & 3= F R
  16. 16. B. 4. To 3C NP- 2. To 3PM X3C 16 , 30, 6.5: : R $ R n A,B,C F=R F=R & " C F U : F ? ? U /3 U & " C ? A,B,C R=F A,B,C R ,B,C.
  17. 17. B. 4. To 3C NP- 2. To 3PM X3C 17 , 30, 6.5: 2.) . ( U (n) O(m) )
  18. 18. B. 5. To EXACT-COVER NP- 18 , 30, 6.5: EXACT-COVER : : , X3C ( EXACT COVER 3) EXACT-COVER: : & ' , , , *+, m U: F '- , - , , -.+, - U : F F : -4 5 & 1: U={1,2,3,4,5,6}, F={{1,2,3,4},{4,6},{2,5},{1,3,5},{1,2,4},{1,3}}. : F={{4,6},{2,5},{1,3}} 2: U={1,2,3,4,5,6}, F={{1,3,5,6},{1,2,3,4},{1,6},{1,5,6}}. :
  19. 19. B. 6. To SET-COVER NP- 19 , 30, 6.5: SET-COVER : : : 1. NP 2. 3C SET-COVER SET-COVER: : & ' , , , *+, m U: F '- , - , , -.+, - U k. : F F F k : -4 5 & 1: U={1,2,3,4,5,6}, F={{2,3,5},{1,2,4},{3,5,6},{1,5,6}}, k=3. : F={{2,3,5},{1,2,4},{3,5,6}}
  20. 20. B. 6. To SET-COVER NP- 1. To SET-COVER NP 20 , 30, 6.5: 1. SET-COVER NP n U, m F k: O(k) k F U (.. F n ) O(n) . SET-COVER NP
  21. 21. B. 6. To SET-COVER NP- 2. To X3C SET-COVER / 21 , 30, 6.5: 2.A) X3C SET-COVER X3C SET-COVER U F '- , - , , -.+, ( - 3 - U ) U2 , F2 k 8 8 9 B /C U 9D 9D 9D E FD : & &, ? ? k=|U|/3. . 2.) ( k ).