[Paper Review] One-variable word equations in linear time
This paper presents a linear-time algorithm for solving one-variable word equations using the recompression technique, which deterministically compresses substrings and variables to efficiently verify satisfiability. The key contribution is an O(n) running time in the RAM model, improving upon prior bounds and matching the best-known complexity for this problem.
In this paper we consider word equations with one variable (and arbitrary many appearances of it). A recent technique of recompression, which is applicable to general word equations, is shown to be suitable also in this case. While in general case it is non-deterministic, it determinises in case of one variable and the obtained running time is O(n + #_X log n), where #_X is the number of appearances of the variable in the equation. This matches the previously-best algorithm due to Dąbrowski and Plandowski. Then, using a couple of heuristics as well as more detailed time analysis the running time is lowered to O(n) in RAM model. Unfortunately no new properties of solutions are shown.
Motivation & Objective
- Develop an efficient algorithm for solving word equations with a single variable, which is known to be in P but previously had suboptimal running times.
- Address the gap in existing algorithms by removing reliance on non-uniform models and improving time complexity to linear time in the RAM model.
- Leverage the recompression technique—previously used for grammar-compressed strings—for word equations, adapting it to the one-variable case with deterministic behavior.
- Optimize the algorithm using heuristics and refined analysis to achieve linear-time performance, matching the best-known complexity for this problem.
Proposed method
- Apply the recompression technique to one-variable word equations, using pair compression (replacing substrings ab with a new letter) and block compression (replacing a^ℓ with a new letter).
- Use local variable updates: when compressing a^ℓ from the substitution of X, update X to X' such that the new substitution is shorter, maintaining correctness.
- Introduce a periodicity-based testing strategy to verify whether two expressions with variable X have the same string value, using gcd-based period detection.
- Use range minimum queries (RMQ) and suffix array-like structures to efficiently compare substrings during the recompression process.
- Optimize the comparison of X with itself by skipping identical a^k prefixes in O(1) time, associating the cost to previous tests to maintain linear total time.
- Apply accounting arguments to bound the total time spent on periodic tests, showing they contribute only O(n) time overall.
Experimental results
Research questions
- RQ1Can the recompression technique be adapted to solve one-variable word equations deterministically and in linear time?
- RQ2Is it possible to achieve O(n) running time for one-variable word equations in the RAM model, improving upon the O(n + #_X log n) bound?
- RQ3Can the use of range minimum queries be eliminated without increasing the running time?
- RQ4Can the recompression approach be extended to improve bounds on the number of solutions for one-variable word equations?
- RQ5Can the recompression method be applied to speed up algorithms for two-variable word equations?
Key findings
- The algorithm achieves O(n) running time in the RAM model by combining recompression with heuristic optimizations and detailed time analysis.
- The recompression technique, which is non-deterministic in general word equations, becomes deterministic in the one-variable case, enabling efficient linear-time processing.
- The number of candidate solutions is bounded by O(log n), and the algorithm efficiently tests them using periodicity and gcd-based checks.
- The cost of comparing X with itself is amortized over previous operations, contributing only a constant factor to the total time.
- The algorithm matches the best-known complexity of Dąbrowski and Plandowski (O(n + #_X log n)) but improves it to O(n) under the RAM model.
- The method does not establish new structural properties of solutions, but provides a simpler, unified approach to solving one-variable word equations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.