Source author record

Yuto Nakashima

Explore this author’s publications, collaborators and research topics. This catalog record has not been claimed by its author.

ResearcherUnclaimed source record

Catalog footprint

Research overview

15works
5topics
4close collaborators

Published work

15 publications

preprint2025arXiv

Subsequence Matching and LCS under Cartesian-Tree Equivalence

Two strings of the same length are said to Cartesian-tree match (CT-match) if their Cartesian-trees are isomorphic [Park et al., TCS 2020]. Cartesian-tree matching is a natural model that allows for capturing similarities of numerical sequences. Oizumi et al. [CPM 2022] showed that subsequence pattern matching under CT-matching model (CT-MSeq) can be solved in O(nmlog⁡log⁡n)O(nm \log \log n) time, where nn and mm are text and pattern lengths, respectively. This current article follows this line of research, and gives the following new results: (1) An O(nm)O(nm)-time CT-MSeq algorithm for binary alphabets; (2) An O((nm)1−ε)O((nm)^{1-ε})-time conditional lower bound for the CT-MSeq problem on alphabets of size 4, for any constant ε>0ε> 0, under the Orthogonal Vector Hypothesis (OVH). Further, we introduce the new problem of longest common subsequence under CT-matching (CT-LCS) for two given strings SS and TT of length nn, and present the following results: (3) An O(n6)O(n^6)-time CT-LCS algorithm for general ordered alphabets; (4) An O(n2/log⁡n)O(n^2 / \log n)-time CT-LCS algorithm for binary alphabets; (5) An O(n2−ε)O(n^{2-ε})-time conditional lower bound for the CT-LCS problem on alphabets of size 5, for any constant ε>0ε> 0, under OVH.

preprint2022arXiv

Combinatorics of minimal absent words for a sliding window

A string ww is called a minimal absent word (MAW) for another string TT if ww does not occur in TT but the proper substrings of ww occur in TT. For example, let Σ={a,b,c}Σ= \{\mathtt{a, b, c}\} be the alphabet. Then, the set of MAWs for string w=abaabw = \mathtt{abaab} is {aaa,aaba,bab,bb,c}\{\mathtt{aaa, aaba, bab, bb, c}\}. In this paper, we study combinatorial properties of MAWs in the sliding window model, namely, how the set of MAWs changes when a sliding window of fixed length dd is shifted over the input string TT of length nn, where 1≤d<n1 \leq d < n. We present \emph{tight} upper and lower bounds on the maximum number of changes in the set of MAWs for a sliding window over TT, both in the cases of general alphabets and binary alphabets. Our bounds improve on the previously known best bounds [Crochemore et al., 2020].

preprint2022arXiv

Minimal Absent Words on Run-Length Encoded Strings

A string ww is called a minimal absent word (MAW) for another string TT if ww does not occur (as a substring) in TT and any proper substring of ww occurs in TT. State-of-the-art data structures for reporting the set MAW(T)\mathsf{MAW}(T) of MAWs from a given string TT of length nn require O(n)O(n) space, can be built in O(n)O(n) time, and can report all MAWs in O(∣MAW(T)∣)O(|\mathsf{MAW}(T)|) time upon a query. This paper initiates the problem of computing MAWs from a compressed representation of a string. In particular, we focus on the most basic compressed representation of a string, run-length encoding (RLE), which represents each maximal run of the same characters aa by apa^p where pp is the length of the run. Let mm be the RLE-size of string TT. After categorizing the MAWs into five disjoint sets M1\mathcal{M}_1, M2\mathcal{M}_2, M3\mathcal{M}_3, M4\mathcal{M}_4, M5\mathcal{M}_5 using RLE, we present matching upper and lower bounds for the number of MAWs in Mi\mathcal{M}_i for i=1,2,4,5i = 1,2,4,5 in terms of RLE-size mm, except for M3\mathcal{M}_3 whose size is unbounded by mm. We then present a compact O(m)O(m)-space data structure that can report all MAWs in optimal O(∣MAW(T)∣)O(|\mathsf{MAW}(T)|) time.

preprint2021arXiv

Computing longest palindromic substring after single-character or block-wise edits

Palindromes are important objects in strings which have been extensively studied from combinatorial, algorithmic, and bioinformatics points of views. It is known that the length of the longest palindromic substrings (LPSs) of a given string T of length n can be computed in O(n) time by Manacher's algorithm [J. ACM '75]. In this paper, we consider the problem of finding the LPS after the string is edited. We present an algorithm that uses O(n) time and space for preprocessing, and answers the length of the LPSs in O(\log (\min \{σ, \log n\})) time after a single character substitution, insertion, or deletion, where σdenotes the number of distinct characters appearing in T. We also propose an algorithm that uses O(n) time and space for preprocessing, and answers the length of the LPSs in O(\ell + \log \log n) time, after an existing substring in T is replaced by a string of arbitrary length \ell.

preprint2021arXiv

The Parameterized Suffix Tray

Let ΣΣ and ΠΠ be disjoint alphabets, respectively called the static alphabet and the parameterized alphabet. Two strings xx and yy over Σ∪ΠΣ\cup Π of equal length are said to parameterized match (p-match) if there exists a renaming bijection ff on ΣΣ and ΠΠ which is identity on ΣΣ and maps the characters of xx to those of yy so that the two strings become identical. The indexing version of the problem of finding p-matching occurrences of a given pattern in the text is a well-studied topic in string matching. In this paper, we present a state-of-the-art indexing structure for p-matching called the parameterized suffix tray of an input text TT, denoted by PSTray(T)\mathsf{PSTray}(T). We show that PSTray(T)\mathsf{PSTray}(T) occupies O(n)O(n) space and supports pattern matching queries in O(m+log⁡(σ+π)+occ)O(m + \log (σ+π) + \mathit{occ}) time, where nn is the length of TT, mm is the length of a query pattern PP, ππ is the number of distinct symbols of ∣Π∣|Π| in TT, σσ is the number of distinct symbols of ∣Σ∣|Σ| in TT and occ\mathit{occ} is the number of p-matching occurrences of PP in TT. We also present how to build PSTray(T)\mathsf{PSTray}(T) in O(n)O(n) time from the parameterized suffix tree of TT.

preprint2020arXiv

Detecting kk-(Sub-)Cadences and Equidistant Subsequence Occurrences

The equidistant subsequence pattern matching problem is considered. Given a pattern string PP and a text string TT, we say that PP is an \emph{equidistant subsequence} of TT if PP is a subsequence of the text such that consecutive symbols of PP in the occurrence are equally spaced. We can consider the problem of equidistant subsequences as generalizations of (sub-)cadences. We give bit-parallel algorithms that yield o(n2)o(n^2) time algorithms for finding kk-(sub-)cadences and equidistant subsequences. Furthermore, O(nlog⁡2n)O(n\log^2 n) and O(nlog⁡n)O(n\log n) time algorithms, respectively for equidistant and Abelian equidistant matching for the case ∣P∣=3|P| = 3, are shown. The algorithms make use of a technique that was recently introduced which can efficiently compute convolutions with linear constraints.

preprint2020arXiv

Fast Algorithms for the Shortest Unique Palindromic Substring Problem on Run-Length Encoded Strings

For a string SS, a palindromic substring S[i..j]S[i..j] is said to be a \emph{shortest unique palindromic substring} (SUPS\mathit{SUPS}) for an interval [s,t][s, t] in SS, if S[i..j]S[i..j] occurs exactly once in SS, the interval [i,j][i, j] contains [s,t][s, t], and every palindromic substring containing [s,t][s, t] which is shorter than S[i..j]S[i..j] occurs at least twice in SS. In this paper, we study the problem of answering SUPS\mathit{SUPS} queries on run-length encoded strings. We show how to preprocess a given run-length encoded string RLES\mathit{RLE}_{S} of size mm in O(m)O(m) space and O(mlog⁡σRLES+mlog⁡m/log⁡log⁡m)O(m \log σ_{\mathit{RLE}_{S}} + m \sqrt{\log m / \log\log m}) time so that all SUPSs\mathit{SUPSs} for any subsequent query interval can be answered in O(log⁡m/log⁡log⁡m+α)O(\sqrt{\log m / \log\log m} + α) time, where αα is the number of outputs, and σRLESσ_{\mathit{RLE}_{S}} is the number of distinct runs of RLES\mathit{RLE}_{S}. Additionaly, we consider a variant of the SUPS problem where a query interval is also given in a run-length encoded form. For this variant of the problem, we present two alternative algorithms with faster queries. The first one answers queries in O(log⁡log⁡m/log⁡log⁡log⁡m+α)O(\sqrt{\log\log m /\log\log\log m} + α) time and can be built in O(mlog⁡σRLES+mlog⁡m/log⁡log⁡m)O(m \log σ_{\mathit{RLE}_{S}} + m \sqrt{\log m / \log\log m}) time, and the second one answers queries in O(log⁡log⁡m+α)O(\log \log m + α) time and can be built in O(mlog⁡σRLES)O(m \log σ_{\mathit{RLE}_{S}}) time. Both of these data structures require O(m)O(m) space.

preprint2020arXiv

Faster STR-EC-LCS Computation

The longest common subsequence (LCS) problem is a central problem in stringology that finds the longest common subsequence of given two strings AA and BB. More recently, a set of four constrained LCS problems (called generalized constrained LCS problem) were proposed by Chen and Chao [J. Comb. Optim, 2011]. In this paper, we consider the substring-excluding constrained LCS (STR-EC-LCS) problem. A string ZZ is said to be an STR-EC-LCS of two given strings AA and BB excluding PP if, ZZ is one of the longest common subsequences of AA and BB that does not contain PP as a substring. Wang et al. proposed a dynamic programming solution which computes an STR-EC-LCS in O(mnr)O(mnr) time and space where m=∣A∣,n=∣B∣,r=∣P∣m = |A|, n = |B|, r = |P| [Inf. Process. Lett., 2013]. In this paper, we show a new solution for the STR-EC-LCS problem. Our algorithm computes an STR-EC-LCS in O(n∣Σ∣+(L+1)(m−L+1)r)O(n|Σ| + (L+1)(m-L+1)r) time where ∣Σ∣≤min⁡{m,n}|Σ| \leq \min\{m, n\} denotes the set of distinct characters occurring in both AA and BB, and LL is the length of the STR-EC-LCS. This algorithm is faster than the O(mnr)O(mnr)-time algorithm for short/long STR-EC-LCS (namely, L∈O(1)L \in O(1) or m−L∈O(1)m-L \in O(1)), and is at least as efficient as the O(mnr)O(mnr)-time algorithm for all cases.

preprint2020arXiv

Grammar-compressed Self-index with Lyndon Words

We introduce a new class of straight-line programs (SLPs), named the Lyndon SLP, inspired by the Lyndon trees (Barcelo, 1990). Based on this SLP, we propose a self-index data structure of O(g)O(g) words of space that can be built from a string TT in O(nlg⁡n)O(n \lg n) expected time, retrieving the starting positions of all occurrences of a pattern PP of length mm in O(m+lg⁡mlg⁡n+occlg⁡g)O(m + \lg m \lg n + occ \lg g) time, where nn is the length of TT, gg is the size of the Lyndon SLP for TT, and occocc is the number of occurrences of PP in TT.

preprint2020arXiv

Lyndon Words, the Three Squares Lemma, and Primitive Squares

We revisit the so-called "Three Squares Lemma" by Crochemore and Rytter [Algorithmica 1995] and, using arguments based on Lyndon words, derive a more general variant which considers three overlapping squares which do not necessarily share a common prefix. We also give an improved upper bound of nlog⁡2nn\log_2 n on the maximum number of (occurrences of) primitively rooted squares in a string of length nn, also using arguments based on Lyndon words. To the best of our knowledge, the only known upper bound was nlog⁡ϕn≈1.441nlog⁡2nn \log_ϕn \approx 1.441n\log_2 n, where ϕϕ is the golden ratio, reported by Fraenkel and Simpson [TCS 1999] obtained via the Three Squares Lemma.

preprint2020arXiv

On repetitiveness measures of Thue-Morse words

We show that the size γ(tn)γ(t_n) of the smallest string attractor of the nnth Thue-Morse word tnt_n is 4 for any n≥4n\geq 4, disproving the conjecture by Mantaci et al. [ICTCS 2019] that it is nn. We also show that δ(tn)=103+24−nδ(t_n) = \frac{10}{3+2^{4-n}} for n≥3n \geq 3, where δ(w)δ(w) is the maximum over all k=1,…,∣w∣k = 1,\ldots,|w|, the number of distinct substrings of length kk in ww divided by kk, which is a measure of repetitiveness recently studied by Kociumaka et al. [LATIN 2020]. Furthermore, we show that the number z(tn)z(t_n) of factors in the self-referencing Lempel-Ziv factorization of tnt_n is exactly 2n2n.

preprint2020arXiv

Space-Efficient Algorithms for Computing Minimal/Shortest Unique Substrings

Given a string TT of length nn, a substring u=T[i..j]u = T[i..j] of TT is called a shortest unique substring (SUS) for an interval [s,t][s,t] if (a) uu occurs exactly once in TT, (b) uu contains the interval [s,t][s,t] (i.e. i≤s≤t≤ji \leq s \leq t \leq j), and (c) every substring vv of TT with ∣v∣<∣u∣|v| < |u| containing [s,t][s,t] occurs at least twice in TT. Given a query interval [s,t]⊂[1,n][s, t] \subset [1, n], the interval SUS problem is to output all the SUSs for the interval [s,t][s,t]. In this article, we propose a 4n+o(n)4n + o(n) bits data structure answering an interval SUS query in output-sensitive O(occ)O(\mathit{occ}) time, where occ\mathit{occ} is the number of returned SUSs. Additionally, we focus on the point SUS problem, which is the interval SUS problem for s=ts = t. Here, we propose a ⌈(log⁡23+1)n⌉+o(n)\lceil (\log_2{3} + 1)n \rceil + o(n) bits data structure answering a point SUS query in the same output-sensitive time. We also propose space-efficient algorithms for computing the minimal unique substrings of TT.

preprint2020arXiv

Towards Efficient Interactive Computation of Dynamic Time Warping Distance

The dynamic time warping (DTW) is a widely-used method that allows us to efficiently compare two time series that can vary in speed. Given two strings AA and BB of respective lengths mm and nn, there is a fundamental dynamic programming algorithm that computes the DTW distance for AA and BB together with an optimal alignment in Θ(mn)Θ(mn) time and space. In this paper, we tackle the problem of interactive computation of the DTW distance for dynamic strings, denoted D2TW\mathrm{D^2TW}, where character-wise edit operation (insertion, deletion, substitution) can be performed at an arbitrary position of the strings. Let MM and NN be the sizes of the run-length encoding (RLE) of AA and BB, respectively. We present an algorithm for D2TW\mathrm{D^2TW} that occupies Θ(mN+nM)Θ(mN+nM) space and uses O(m+n+#chg)⊆O(mN+nM)O(m+n+\#_{\mathrm{chg}}) \subseteq O(mN + nM) time to update a compact differential representation DS\mathit{DS} of the DP table per edit operation, where #chg\#_{\mathrm{chg}} denotes the number of cells in DS\mathit{DS} whose values change after the edit operation. Our method is at least as efficient as the algorithm recently proposed by Froese et al. running in Θ(mN+nM)Θ(mN + nM) time, and is faster when #chg\#_{\mathrm{chg}} is smaller than O(mN+nM)O(mN + nM) which, as our preliminary experiments suggest, is likely to be the case in the majority of instances.

preprint2015arXiv

Constructing LZ78 Tries and Position Heaps in Linear Time for Large Alphabets

We present the first worst-case linear-time algorithm to compute the Lempel-Ziv 78 factorization of a given string over an integer alphabet. Our algorithm is based on nearest marked ancestor queries on the suffix tree of the given string. We also show that the same technique can be used to construct the position heap of a set of strings in worst-case linear time, when the set of strings is given as a trie.

preprint2013arXiv

Efficient Lyndon factorization of grammar compressed text

We present an algorithm for computing the Lyndon factorization of a string that is given in grammar compressed form, namely, a Straight Line Program (SLP). The algorithm runs in O(n4+mn3h)O(n^4 + mn^3h) time and O(n2)O(n^2) space, where mm is the size of the Lyndon factorization, nn is the size of the SLP, and hh is the height of the derivation tree of the SLP. Since the length of the decompressed string can be exponentially large w.r.t. n,mn, m and hh, our result is the first polynomial time solution when the string is given as SLP.

Research graph

See the researcher in context

Open full explorer

Inspect adjacent papers, topics, institutions and collaborators without losing the researcher page.

Building this map preview

BZPEER is loading the nearby papers, people, topics and institutions for this page.