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

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:

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

δ-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 2 3 3 4 2 3 4 3 1 P 1 4 3 2

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 * 2 2 2 * 2 2 1 1 P 1 2 2 *

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))

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 *?? *??

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 2 3 3 4 2 3 4 3 1 P 1 4 3 2 Σ1234 h111*2 h21*22 T 1 * * 2 1 * 2 * 1 P 1 2 * 1 T * 2 2 2 * 2 2 1 1 P 1 2 2 *

δ- 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))

δ-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 { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/11/3206745/slides/slide_8.jpg", "name": "δ-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…**..", "description": "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

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

δ=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

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}}

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 { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/11/3206745/slides/slide_12.jpg", "name": "Special case Theorem 6. If k is divisible by 3, then α( δ)≤ 2δ Theorem 6.", "description": "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

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

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