Алгоритмы для NP-трудных задач, осень 2009: Точные и FPT-алгоритмы

  • View
    126

  • Download
    0

Embed Size (px)

Transcript

  • NP- 10: FPT-

    .

    Computer Science http://logic.pdmi.ras.ru/infclub/

    . (Computer Science ) 10. FPT- 1 / 28

    http://logic.pdmi.ras.ru/~infclub/

  • 1 -

    2 k- k-

    3 2-

    . (Computer Science ) 10. FPT- 2 / 28

  • 1 -

    2 k- k-

    3 2-

    . (Computer Science ) 10. FPT- 2 / 28

  • 1 -

    2 k- k-

    3 2-

    . (Computer Science ) 10. FPT- 2 / 28

  • -

    1 -

    2 k- k-

    3 2-

    . (Computer Science ) 10. FPT- 3 / 28

  • -

    -

    A , f , g : 2A R, ..f (X ) =

    YX g(Y ).

    g(X ) =YX

    (1)|XY |f (Y ) .

    YX

    (1)|XY |f (Y ) =YX

    ZY

    (1)|XY |g(Z ) =

    =ZX

    g(Z )

    ZYX(1)|XY | = g(X )

    ( 1, Z = X , ).

    . (Computer Science ) 10. FPT- 4 / 28

  • -

    -

    A , f , g : 2A R, ..f (X ) =

    YX g(Y ).

    g(X ) =YX

    (1)|XY |f (Y ) .

    YX

    (1)|XY |f (Y ) =YX

    ZY

    (1)|XY |g(Z ) =

    =ZX

    g(Z )

    ZYX(1)|XY | = g(X )

    ( 1, Z = X , ).. (Computer Science ) 10. FPT- 4 / 28

  • -

    1 -

    2 k- k-

    3 2-

    . (Computer Science ) 10. FPT- 5 / 28

  • -

    : , , , s t. {s, t} X V g(X ) ( ! , ) n 1 s t, X . , g(X ) s t An1, A G [X ].

    . (Computer Science ) 10. FPT- 6 / 28

  • -

    : , , , s t.

    {s, t} X V g(X ) ( ! , ) n 1 s t, X . , g(X ) s t An1, A G [X ].

    . (Computer Science ) 10. FPT- 6 / 28

  • -

    : , , , s t. {s, t} X V g(X ) ( ! , ) n 1 s t, X .

    , g(X ) s t An1, A G [X ].

    . (Computer Science ) 10. FPT- 6 / 28

  • -

    : , , , s t. {s, t} X V g(X ) ( ! , ) n 1 s t, X . , g(X ) s t An1, A G [X ].

    . (Computer Science ) 10. FPT- 6 / 28

  • -

    ()

    f (X ) n 1 s t, X . , f (V ) s t.

    f (V ) =YV

    (1)|VY |g(Y ) .

    , O*(2n) .

    . (Computer Science ) 10. FPT- 7 / 28

  • -

    ()

    f (X ) n 1 s t, X . , f (V ) s t.

    f (V ) =

    YV

    (1)|VY |g(Y ) .

    , O*(2n) .

    . (Computer Science ) 10. FPT- 7 / 28

  • -

    ()

    f (X ) n 1 s t, X . , f (V ) s t.

    f (V ) =YV

    (1)|VY |g(Y ) .

    , O*(2n) .

    . (Computer Science ) 10. FPT- 7 / 28

  • -

    ()

    f (X ) n 1 s t, X . , f (V ) s t.

    f (V ) =YV

    (1)|VY |g(Y ) .

    , O*(2n) .

    . (Computer Science ) 10. FPT- 7 / 28

  • -

    1 -

    2 k- k-

    3 2-

    . (Computer Science ) 10. FPT- 8 / 28

  • -

    (perfect matching) G = (V ,E ) n/2 , . . . O*(2m).

    . (Computer Science ) 10. FPT- 9 / 28

  • -

    (perfect matching) G = (V ,E ) n/2 , .

    . . O*(2m).

    . (Computer Science ) 10. FPT- 9 / 28

  • -

    (perfect matching) G = (V ,E ) n/2 , . .

    . O*(2m).

    . (Computer Science ) 10. FPT- 9 / 28

  • -

    (perfect matching) G = (V ,E ) n/2 , . . . O*(2m).

    . (Computer Science ) 10. FPT- 9 / 28

  • -

    f (Y ) Y , n/2 . f (V ) . g(Y ) n/2 , Y ( Y ). Y g(Y ) , , O*(2n) .

    . (Computer Science ) 10. FPT- 10 / 28

  • -

    f (Y ) Y , n/2 .

    f (V ) . g(Y ) n/2 , Y ( Y ). Y g(Y ) , , O*(2n) .

    . (Computer Science ) 10. FPT- 10 / 28

  • -

    f (Y ) Y , n/2 . f (V ) .

    g(Y ) n/2 , Y ( Y ). Y g(Y ) , , O*(2n) .

    . (Computer Science ) 10. FPT- 10 / 28

  • -

    f (Y ) Y , n/2 . f (V ) . g(Y ) n/2 , Y ( Y ).

    Y g(Y ) , , O*(2n) .

    . (Computer Science ) 10. FPT- 10 / 28

  • -

    f (Y ) Y , n/2 . f (V ) . g(Y ) n/2 , Y ( Y ). Y g(Y ) , , O*(2n) .

    . (Computer Science ) 10. FPT- 10 / 28

  • -

    1 -

    2 k- k-

    3 2-

    . (Computer Science ) 10. FPT- 11 / 28

  • -

    . V = L R |L| = |R| = n/2. Y R ( Y V ) g(Y ) n/2 , L Y . O*(2n/2).

    . (Computer Science ) 10. FPT- 12 / 28

  • -

    .

    V = L R |L| = |R| = n/2. Y R ( Y V ) g(Y ) n/2 , L Y . O*(2n/2).

    . (Computer Science ) 10. FPT- 12 / 28

  • -

    . V = L R |L| = |R| = n/2.

    Y R ( Y V ) g(Y ) n/2 , L Y . O*(2n/2).

    . (Computer Science ) 10. FPT- 12 / 28

  • -

    . V = L R |L| = |R| = n/2. Y R ( Y V ) g(Y ) n/2 , L Y .

    O*(2n/2).

    . (Computer Science ) 10. FPT- 12 / 28

  • -

    . V = L R |L| = |R| = n/2. Y R ( Y V ) g(Y ) n/2 , L Y . O*(2n/2).

    . (Computer Science ) 10. FPT- 12 / 28

  • -

    1 2 3 4 5 6 7 8 9 10 11 12X

    {1}

    {2}

    {3}

    {1, 3}

    +

    +

    . (Computer Science ) 10. FPT- 13 / 28

  • 1 -

    2 k- k-

    3 2-

    . (Computer Science ) 10. FPT- 14 / 28

  • 1 -

    2 k- k-

    3 2-

    . (Computer Science ) 10. FPT- 15 / 28

  • (subset-sum problem) n b1, . . . , bn , B .

    2n.

    . (Computer Science ) 10. FPT- 16 / 28

  • (subset-sum problem) n b1, . . . , bn , B .

    2n.

    . (Computer Science ) 10. FPT- 16 / 28

  • 2n/2 {b1, . . . , bn/2}. . S {bn/2+1, . . . , bn} B S .

    O*(2n/2). . , 2n .

    . (Computer Science ) 10. FPT- 17 / 28

  • 2n/2 {b1, . . . , bn/2}.

    . S {bn/2+1, . . . , bn} B S .

    O*(2n/2). . , 2n .

    . (Computer Science ) 10. FPT- 17 / 28

  • 2n/2 {b1, . . . , bn/2}. .

    S {bn/2+1, . . . , bn} B S .

    O*(2n/2). . , 2n .

    . (Computer Science ) 10. FPT- 17 / 28

  • 2n/2 {b1, . . . , bn/2}. . S {bn/2+1, . . . , bn} B S .

    O*(2n/2). . , 2n .

    . (Computer Science ) 10. FPT- 17 / 28

  • 2n/2 {b1, . . . , bn/2}. . S {bn/2+1, . . . , bn} B S .

    O*(2n/2). . , 2n .

    . (Computer Science ) 10. FPT- 17 / 28

  • 2n/2 {b1, . . . , bn/2}. . S {bn/2+1, . . . , bn} B S .

    O*(2n/2).

    . , 2n .

    . (Computer Science ) 10. FPT- 17 / 28

  • 2n/2 {b1, . . . , bn/2}. . S {bn/2+1, . . . , bn} B S .

    O*(2n/2). .

    , 2n .

    . (Computer Science ) 10. FPT- 17 / 28

  • 2n/2 {b1, . . . , bn/2}. . S {bn/2+1, . . . , bn} B S .

    O*(2n/2). . , 2n .

    . (Computer Science ) 10. FPT- 17 / 28

  • k- k-

    1 -

    2 k- k-

    3 2-

    . (Computer Science ) 10. FPT- 18 / 28

  • k- k-

    k- (table-k sum problem) k m S , , S .

    mk . , 2- O(m logm). k- O(mk/2 logm) O(mk/2).

    . (Computer Science ) 10. FPT- 19 / 28

  • k- k-

    k- (table-k sum problem) k m S , , S .

    mk . , 2- O(m logm). k- O(mk/2 logm) O(mk/2).

    . (Computer Science ) 10. FPT- 19 / 28

  • k- k-

    k- (table-k sum problem) k m S , , S .

    mk .

    , 2- O(m logm). k- O(mk/2 logm) O(mk/2).

    . (Computer Science ) 10. FPT- 19 / 28

  • k- k-

    k- (table-k sum problem) k m S , , S .

    mk . , 2- O(m logm).

    k- O(mk/2 logm) O(mk/2).

    . (Computer Science ) 10. FPT- 19 / 28

  • k- k-

    k- (table-k sum problem) k m S , , S .

    mk . , 2- O(m logm). k- O(mk/2 logm) O(mk/2).

    . (Computer Science ) 10. FPT- 19 / 28

  • k- k-

    3-

    k- (k-sum problem) m S , k , S .

    , 3- O(m2). , , 3-, , .

    . (Computer Science ) 10. FPT- 20 / 28

  • k- k-

    3-

    k- (k-sum problem) m S , k , S .

    , 3- O(m2). , , 3-, , .

    . (Computer Science ) 10. FPT- 20 / 28

  • k- k-

    3-

    k- (k-sum problem) m S , k , S .

    , 3- O(m2).

    , , 3-, , .

    . (Computer Science ) 10. FPT- 20 / 28

  • k- k-

    3-

    k- (k-sum problem) m S , k , S .

    , 3- O(m2). , , 3-, , .

    . (Computer Science ) 10. FPT- 20 / 28

  • k- k-

    m , - . y = ax