English

Efficiently Testing Simon's Congruence

Formal Languages and Automata Theory 2021-03-16 v2 Data Structures and Algorithms

Abstract

Simon's congruence k\sim_k is defined as follows: two words are k\sim_k-equivalent if they have the same set of subsequences of length at most kk. We propose an algorithm which computes, given two words ss and tt, the largest kk for which skts\sim_k t. Our algorithm runs in linear time O(s+t)O(|s|+|t|) when the input words are over the integer alphabet {1,,s+t}\{1,\ldots,|s|+|t|\} (or other alphabets which can be sorted in linear time). This approach leads to an optimal algorithm in the case of general alphabets as well. Our results are based on a novel combinatorial approach and a series of efficient data structures.

Keywords

Cite

@article{arxiv.2005.01112,
  title  = {Efficiently Testing Simon's Congruence},
  author = {Pawel Gawrychowski and Maria Kosche and Tore Koss and Florin Manea and Stefan Siemer},
  journal= {arXiv preprint arXiv:2005.01112},
  year   = {2021}
}
R2 v1 2026-06-23T15:16:31.056Z