Presentation is loading. Please wait.

Presentation is loading. Please wait.

On special families of morphisms related to δ- matching and don ’ t care symbols Information Processing Letters (2003) Richard Cole et al.

Similar presentations


Presentation on theme: "On special families of morphisms related to δ- matching and don ’ t care symbols Information Processing Letters (2003) Richard Cole et al."— Presentation transcript:

1 On special families of morphisms related to δ- matching and don ’ t care symbols Information Processing Letters (2003) Richard Cole et al

2 δ-matching problem Σ is an interval of integers Σ is an interval of integers Pattern P, |P| = m Pattern P, |P| = m Text T, |T| = n Text T, |T| = n For a, b Σ, a = δ b if |a-b|≤δ For a, b  Σ, a = δ b if |a-b|≤δ A δ-matching occurs in position j when A δ-matching occurs in position j when |P[i] - T[i+j-1]| ≤δ for 1≤i≤n |P[i] - T[i+j-1]| ≤δ for 1≤i≤n P = δ T[j…j+m-1] P = δ T[j…j+m-1] T P

3 Pattern-matching with don ’ t care symbols Σ* = Σ Σ* = Σ  {*} a≈b if a=b or a=* or b=* a≈b if a=b or a=* or b=* Two strings u, w with |u|=|w|, u≈w iff u[i]≈w[i] for all I Two strings u, w with |u|=|w|, u≈w iff u[i]≈w[i] for all I Find all positions j such that P≈T[i…j+m-1] Find all positions j such that P≈T[i…j+m-1] T * * P *

4 Lemma 1. The problem of pattern- matching with don ’ t cares for a pattern P and a text T of length n over an alphabet Σ can be solved in time O(log|Σ| * IntMult(n)) Lemma 1. The problem of pattern- matching with don ’ t cares for a pattern P and a text T of length n over an alphabet Σ can be solved in time O(log|Σ| * IntMult(n))

5 Relation between δ -matching and pattern matching with don ’ t cares For small alphabet δ-matching is at least as difficult as matching with don’t cares For small alphabet δ-matching is at least as difficult as matching with don’t cares Theorem 2. String matching with don’t cares for binary alphabets {a, b} is reducible to δ-matching for the alphabet Σ={1, 2, 3} Theorem 2. String matching with don’t cares for binary alphabets {a, b} is reducible to δ-matching for the alphabet Σ={1, 2, 3} a b a b * a b c *?? *??

6 Reduction from δ -matching to pattern matching with don ’ t cares Given P, T, δ, find k symbol-to-symbol encodings h 1,…,h k to reduce it Given P, T, δ, find k symbol-to-symbol encodings h 1,…,h k to reduce it T P Σ1234 h111*2 h21*22 T 1 * * 2 1 * 2 * 1 P 1 2 * 1 T * * P *

7 δ- distinguishing families of morphisms H = {h 1, h 2, …, h k }, h i : Σ  Σ i H = {h 1, h 2, …, h k }, h i : Σ  Σ i  {*} H is δ- distingushing iff  a, b  Σ [a = δ b] ≡[  (h  H) h(a)≈h(b) ] M δ (P,T)={j | P= δ T[j…j+m-1]} D(P,T)={j | P≈T[j…j+m-1]} M δ (P,T)=D(h 1 (P),h 1 (T))∩…∩D(h k (P), h k (T))

8 δ-regular family H is a H is a δ- regular family iff it satisfies P1 : each morphism is a form h=**…*11…1**…*22…2**…*33…**.. The internal blocks of *’s are exactly of length δ, the boundary blocks of *’s are of length at most δ P2 : For p, q  Σsuch that q – p > δ there exists h  H such that h(p)=i, h(q)=j > i, and h(r)=* for some p < r

9 Lemma 3. If a family is δ- regular then it is a δ- distinguishing family Lemma 3. If a family is δ- regular then it is a δ- distinguishing family δ- distingushing iff  a, b  Σ[a = δ b] ≡[  (h  H) h(a)≈h(b) ] : consider p, q : consider p, q  Σ and p < q case 1 : if p = δ q case 2 : if p≠ δ q

10 δ=3 Theorem 4. The size of minimal δ-distinguising family of morphisms is at most 2δ+1:α(δ)≤2δ+1 Theorem 4. The size of minimal δ-distinguising family of morphisms is at most 2δ+1:α(δ)≤2δ+1 # * in each column is at most δ # * in each column is at most δ if p-q>δ then for every i there is a symbol between p, q in h i if p-q>δ then for every i there is a symbol between p, q in h i

11 Lemma 5. The size of a minimal 3- distinguishing family of morphisms is at most 6:α(3)≤6 Lemma 5. The size of a minimal 3- distinguishing family of morphisms is at most 6:α(3)≤6 F={{1,2,3},{1,2,4},{1,3,5},{1,4,6},{2,3,4},{2,3,6},{2,4,5},{2,5,6},{3,4,5},{3,4,6}} F={{1,2,3},{1,2,4},{1,3,5},{1,4,6},{2,3,4},{2,3,6},{2,4,5},{2,5,6},{3,4,5},{3,4,6}}

12 Special case Theorem 6. If k is divisible by 3, then α( δ)≤ 2δ Theorem 6. If k is divisible by 3, then α( δ)≤ 2δ α(r *δ)≤ r *α(δ) α(r *δ)≤ r *α(δ) Expand h i to r times Expand h i to r times Cyclically shift by j, 1≤j

13 Lower bound Theorem 7. The size of a minimal δ- distinguishing family of morphisms is at least δ+2:α(δ) ≥δ+ 2 Theorem 7. The size of a minimal δ- distinguishing family of morphisms is at least δ+2:α(δ) ≥δ+ 2

14 Claim. If there is a δ-distinguishing family of size k, then there exists a δ-regular family of k morphisms Claim. If there is a δ-distinguishing family of size k, then there exists a δ-regular family of k morphisms


Download ppt "On special families of morphisms related to δ- matching and don ’ t care symbols Information Processing Letters (2003) Richard Cole et al."

Similar presentations


Ads by Google