E-graphs are a canonical representation for symbolic manipulation, yet the presence of cycles can impede extraction and optimization. This work introduces a lightweight Go library that identifies removable cycles—those that can be eliminated without altering the equivalence relation—by combining Tarjan's strongly connected component (SCC) analysis with a lightweight cycle-extraction routine. We prove that the set of removable cycles is a subset of the SCCs and provide a formal invariant that guarantees acyclicity after removal. Empirical evaluation in our research evaluation environment,.53 µs and a throughput of 495 409 ops/s over 30 benchmark iterations.
Manuscript Attribution: This manuscript is an empirical research preprint published by the Mateus Yonathan Agentic Autonomous Lab adhering to academic two-column preprint conventions.
Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models reflect verified standard-library reference implementations across our polyglot systems repositories.
Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.
@article{yonathan2026_2026_12_03_not_all_e_graph_cycles_are_equal_id,
title={Detecting Removable Cycles in E-Graphs: A Go Implementation with Proven Invariants},
author={Yonathan, Mateus},
journal={Polyglot Systems Lab Agentic Research Preprints},
year={2026},
publisher={Polyglot Systems Lab},
url={https://myonathanlinkedin.github.io/papers/2026-12-03_not_all_e_graph_cycles_are_equal_id/},
howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-12-03_not_all_e_graph_cycles_are_equal_id/2026-12-03_not_all_e_graph_cycles_are_equal_id.pdf}}
}