## Abstract

We present problems in the following three application areas: identifying similar codes in which global register reallocation and spill code minimization were done (programming languages); protein threading (computational biology); and searching for color icons under different color maps (image processing). We introduce a new search model called function matching that enables us to solve the above problems. The function matching problem has as its input a text T of length n over alphabet E_{T} and a pattern P = P[1]P[2] ⋯ P[m] of length m over alphabet Σ_{P}. We seek all text locations i, where the m-length substring that starts at i is equal to f(P[1])/(P[2]) ⋯ f(P[m]), for some function f : Σ_{P} → Σ_{T}. We give a randomized algorithm that solves the function matching problem in time O(n log n) with probability 1/n of declaring a false positive. We give a deterministic algorithm whose time is O(n|Σ_{P}| log m) and show that it is optimal in the convolutions model. We use function matching to efficiently solve the problem of two-dimensional parameterized matching.

Original language | English |
---|---|

Pages (from-to) | 1007-1022 |

Number of pages | 16 |

Journal | SIAM Journal on Computing |

Volume | 35 |

Issue number | 5 |

DOIs | |

State | Published - 2006 |

## Keywords

- Color maps
- Function matching
- Parameterized matching
- Pattern matching