A New Technique in Graph-to-State-Machine Reduction Proofs

LALR(1) parsers are obtained by merging every pair of LR(1) states with identical cores, but such merging can introduce reduce–reduce conflicts. A natural alternative is to merge as many similar states as possible while keeping the parser conflict-free. We prove that this minimization problem is NP-hard, by a polynomial-time reduction from graph coloring. Given a graph F with n nodes, we construct a conflict-free LR(1) grammar whose canonical LR(1) machine has O(n3) states. Exactly n of these states can be merged, one for each node of F, and two of them conflict if and only if the corresponding nodes in F are adjacent. Hence F is k-colorable if and only if the machine can be reduced to at most C+k states, where C depends only on n. The construction relies on three devices. Every pair of nodes is encoded in the grammar, adjacent or not. A lookahead terminal is shared exactly when two nodes are adjacent. Filler rules make all mergeable states have identical cores. These devices may be useful in other reductions from graph problems to parser state machines.

Authors

Institutions

Publication Details

Journal
Algorithms
Published
2026-11-25
DOI
https://doi.org/10.3390/a19121035
Primary Topic
semigroups and automata theory
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

A New Technique in Graph-to-State-Machine Reduction Proofs

Yi‐Ping You, Wuu Yang, Arthur Ning-Chih Yang
Algorithms
semigroups and automata theory
article

A New Technique in Graph-to-State-Machine Reduction Proofs

Yi‐Ping You, Wuu Yang, Arthur Ning-Chih Yang
article en

Abstract

LALR(1) parsers are obtained by merging every pair of LR(1) states with identical cores, but such merging can introduce reduce–reduce conflicts. A natural alternative is to merge as many similar states as possible while keeping the parser conflict-free. We prove that this minimization problem is NP-hard, by a polynomial-time reduction from graph coloring. Given a graph F with n nodes, we construct a conflict-free LR(1) grammar whose canonical LR(1) machine has O(n3) states. Exactly n of these states can be merged, one for each node of F, and two of them conflict if and only if the corresponding nodes in F are adjacent. Hence F is k-colorable if and only if the machine can be reduced to at most C+k states, where C depends only on n. The construction relies on three devices. Every pair of nodes is encoded in the grammar, adjacent or not. A lookahead terminal is shared exactly when two nodes are adjacent. Filler rules make all mergeable states have identical cores. These devices may be useful in other reductions from graph problems to parser state machines.

AlgorithmsVol. 19(12)
National Yang Ming Chiao Tung University (TW)
semigroups and automata theory
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon