finding a forest in a tree
play

Finding a Forest in a Tree The matching problem for wide reactive - PowerPoint PPT Presentation

Finding a Forest in a Tree The matching problem for wide reactive systems Giorgio Bacci, Marino Miculan, Romeo Rizzi Dept. of Computer Science, Aalborg University Breakfast Talk (presented @ TGC 2014) Outline of the talk Introduction


  1. Finding a Forest in a Tree The matching problem for wide reactive systems Giorgio Bacci, Marino Miculan, Romeo Rizzi Dept. of Computer Science, Aalborg University Breakfast Talk (presented @ TGC 2014)

  2. Outline of the talk • Introduction • The problem: forest matching • NP-completeness • Fixed-parameter Algorithm (the core only) • Concluding remaks

  3. Motivations • Reactive systems (aka reduction systems) are common in process calculi • Defined by • a set of reduction rules l ( x ) → r ( x ) • a contextual closure l ( x ) → r ( x ) a =C[ l ( x ) σ ] b =C[ r ( x ) σ ] a → b • However: not always easy to apply, especially in models of global computing

  4. Ex: Message Passing a S 1 S 2 M x ā ⟨ M ⟩ .P | a(x).Q → P | Q[M/x]

  5. Ex: Message Passing S 1 S 2 x M ā ⟨ M ⟩ .P | a(x).Q → P | Q[M/x]

  6. Ex: Remote Message Passing C 1 C 2 a S 1 S 2 M x C 1 [ ā ⟨ M ⟩ .P] | C 2 [a(x).Q] → C 1 [P] | C 2 [Q{M/x}]

  7. Ex: Remote Message Passing C 1 C 2 a S 1 S 2 M x C 1 [ ā ⟨ M ⟩ .P] | C 2 [a(x).Q] → C 1 [P] | C 2 [Q{M/x}] Infinite reduction rules are needed (one for each pair C 1 ,C 2 )

  8. Ex: Remote Message Passing ⟨ C 1 , C 2 ⟩ a S 1 S 2 M x ⟨ ā ⟨ M ⟩ .P , a(x).Q ⟩ → ⟨ P , Q{M/x} ⟩

  9. Ex: Remote Message Passing ⟨ C 1 , C 2 ⟩ a S 1 S 2 M x ⟨ ā ⟨ M ⟩ .P , a(x).Q ⟩ → ⟨ P , Q{M/x} ⟩ Just one wide reduction rule Context has two holes

  10. Wide reactive systems A set of wide reaction rules ⟨ l 1 ( x 1 ),…, l n ( x n ) ⟩ → ⟨ r 1 ( y 1 ),…, r n ( y n ) ⟩ with { y 1 ,…, y n } ⊆ { x 1 ,…, x n } Contextual closure: ⟨ l 1 ( x 1 ),…, l n ( x n ) ⟩ → ⟨ r 1 ( y 1 ),…, r n ( y n ) ⟩ a =C[ l 1 ( x 1 ) σ ,…, l n ( x n ) σ ] b =C[ r 1 ( y 1 ) σ ,…, r n ( y n ) σ ] a → b

  11. Wide vs. Non-wide

  12. Wide vs. Non-wide • WRSs are more expressive than non-WRSs

  13. Wide vs. Non-wide • WRSs are more expressive than non-WRSs • non-wide are a particular case of wide (width = 1)

  14. Wide vs. Non-wide • WRSs are more expressive than non-WRSs • non-wide are a particular case of wide (width = 1) • WRSs need less rules (often, finite instead of infinite)

  15. Wide vs. Non-wide • WRSs are more expressive than non-WRSs • non-wide are a particular case of wide (width = 1) • WRSs need less rules (often, finite instead of infinite) • Pattern matching in WRSs is more complex

  16. Wide vs. Non-wide • WRSs are more expressive than non-WRSs • non-wide are a particular case of wide (width = 1) • WRSs need less rules (often, finite instead of infinite) • Pattern matching in WRSs is more complex • The bad news: NP-complete

  17. Wide vs. Non-wide • WRSs are more expressive than non-WRSs • non-wide are a particular case of wide (width = 1) • WRSs need less rules (often, finite instead of infinite) • Pattern matching in WRSs is more complex • The bad news: NP-complete • The good news: combinatorial explosion depends on redex width only (constant and usually ≤ 3)

  18. Linear Context Trees T(X) :: 0 empty tree = x leaf (x ∈ X) m[ T(X)] labeled tree T(X’) | T(X’’) siblings (X = X’ ⊎ X’’) m n T(Y) T(X) m[ T(X)] | n[T(Y)]

  19. Linear Context Trees T(X) :: 0 empty tree = x leaf (x ∈ X) m[ T(X)] labeled tree T(X’) | T(X’’) siblings (X = X’ ⊎ X’’) m n Unordered (up to structural congruence ≡ ) T(Y) T(X) m[ T(X)] | n[T(Y)]

  20. The matching problem C Context T ≡ Pattern S ... D D Parameters 1 m T ≡ ( C{S/z}){D ,...,D /x ,...,x } 1 m 1 m

  21. The matching problem forest C Context T ≡ Pattern list S S ... 1 h ... ... ... D D Parameters 1 m T ≡ ( C{S ,...,S /z ,..., z }){D ,...,D /x ,...,x } 1 h 1 h 1 m 1 m

  22. Forest matching is NP-complete • Tree matching problem is in P (subtree isomorphim algorithm [Matula’78]) • Forest matching problem is NP-complete! The pattern matchings C must not overlap = S S ... antichain in T 1 h ... ... ... D D 1 m

  23. Forest matching is NP-complete • Tree matching problem is in P (subtree isomorphim algorithm [Matula’78]) • Forest matching problem is NP-complete! ≠ sub-forest isomorphism The pattern matchings C must not overlap = S S ... antichain in T 1 h ... ... ... D D 1 m

  24. Rainbow antichain Instance: a tree T colored on palette P of colors. Problem: to find a P-colorful antichain in T.

  25. Rainbow antichain Instance: a tree T colored on palette P of colors. Problem: to find a P-colorful antichain in T. Proof sketch of NP-hardness

  26. Rainbow antichain Instance: a tree T colored on palette P of colors. Problem: to find a P-colorful antichain in T. Proof sketch of NP-hardness reduction from 3-SAT

  27. Rainbow antichain Instance: a tree T colored on palette P of colors. Problem: to find a P-colorful antichain in T. Proof sketch of NP-hardness reduction from 3-SAT C 1 C 2 _ _ v ( x v y v z ) ( x v y v z )

  28. Rainbow antichain Instance: a tree T colored on palette P of colors. Problem: to find a P-colorful antichain in T. Proof sketch of NP-hardness reduction from 3-SAT C 1 C 2 _ _ v ( x v y v z ) ( x v y v z ) _ _ _ x y x y z z C 1 C 2 C 1 C 2 C 1 C 2

  29. Rainbow antichain Instance: a tree T colored on palette P of colors. Problem: to find a P-colorful antichain in T. Proof sketch of NP-hardness reduction from 3-SAT C 1 C 2 _ _ v ( x v y v z ) ( x v y v z ) _ _ _ x y x y z z every truth assignment satisfying the formula induces a rainbow antichain ...and vice versa C 1 C 2 C 1 C 2 C 1 C 2

  30. Fixed-parameter Tractability How to cope with computational intractability? approximation algorithms, average case analysis, randomized algorithms, heuristics methods, etc...

  31. Fixed-parameter Tractability How to cope with computational intractability? approximation algorithms, average case analysis, randomized algorithms, heuristics methods, etc... FPT’s basic observation: “for many hard problems, the seemingly inherent combinatorial explosion really can be restricted to a ‘small part’ of the input, the parameter” [Downey-Fellows’99]

  32. Parameterized algorithm for Rainbow antichain • Rainbow antichain is the core problem behind the forest matching problem • Rainbow antichain is solved in 2 steps: 1. Reduction to kernel-size of the input tree 2. Exhaustive search of a rainbow antichain

  33. Parameterized algorithm for Rainbow antichain parameter: size of P • Rainbow antichain is the core problem behind the forest matching problem • Rainbow antichain is solved in 2 steps: 1. Reduction to kernel-size of the input tree 2. Exhaustive search of a rainbow antichain

  34. 1. Reduction by decoloring delete u v v u x y x y (*) we will assume the root cannot be deleted Deletion of uncolored nodes does not influence existence of rainbow antichain!

  35. Decoloring (rule 1) decolor u u u Ancestors with the same color can be decolored

  36. Decoloring (rule 2) decolor u u u (*) fout(u) = out-degree of the whole path from u to the root fout(u) = 4 If the tree has all leaves of the same color, then leaves with fan-out ≥ |P| can be decolored

  37. How to apply the rules? (an example of reduction to kernel size) P = { red, yellow, green }

  38. How to apply the rules? (an example of reduction to kernel size) Rule 1: Decoloring of ancestors of the same color

  39. How to apply the rules? (an example of reduction to kernel size) Rule 1: Decoloring of ancestors of the same color

  40. How to apply the rules? (an example of reduction to kernel size) Rule 1: Decoloring of ancestors of the same color

  41. How to apply the rules? (an example of reduction to kernel size) Rule 1: Decoloring of ancestors of the same color

  42. How to apply the rules? (an example of reduction to kernel size) Rule 1: Decoloring of ancestors of the same color

  43. How to apply the rules? (an example of reduction to kernel size) Rule 1: Decoloring of ancestors of the same color

  44. How to apply the rules? (an example of reduction to kernel size) Rule 1: Decoloring of ancestors of the same color

  45. How to apply the rules? (an example of reduction to kernel size) Uncolored nodes can be removed Rule 1: Decoloring of ancestors of the same color

  46. How to apply the rules? (an example of reduction to kernel size) Rule 2: Decoloring of nodes with fan-out ≥ |P|

  47. How to apply the rules? (an example of reduction to kernel size) Only leaves with the same color Rule 2: Decoloring of nodes with fan-out ≥ |P|

  48. How to apply the rules? (an example of reduction to kernel size) Rule 2: Decoloring of nodes with fan-out ≥ |P|

  49. How to apply the rules? (an example of reduction to kernel size) fout(u) = 6 Rule 2: Decoloring of nodes with fan-out ≥ |P|

  50. How to apply the rules? (an example of reduction to kernel size) fout(u) = 6 Rule 2: Decoloring of nodes with fan-out ≥ |P|

Recommend


More recommend