TL;DR
Learning algorithms from dead-tree textbooks requires you to run a compiler in your head, manually tracing changing variables across static lines of pseudocode. Augmented Algorithm bridges this gap by letting you draw a box around any textbook pseudocode to instantly generate an interactive, step-by-step animation overlaid right onto the page. By combining computer vision with LLM agents, it turns passive reading into a live, customizable coding playground—without forcing students or professors to abandon their favorite course materials.
What Problem Does This Paper Address?
Data Structures and Algorithms (DSA) are inherently dynamic, yet we primarily teach them using static media like textbooks and PDFs. For decades, researchers have built Algorithm Visualization (AV) tools to animate these processes. Despite proven educational benefits, AV tools collect dust in actual classrooms. Why?
First, instructors don’t have the time to build custom animations from scratch. Second, existing external AV websites rarely match the exact pseudocode notation or implementation quirks of a specific professor’s lecture slides or chosen textbook. Bouncing between a textbook and a slightly different web tool creates cognitive friction and confusion. Prior attempts to augment printed pages directly were rigid—requiring pre-printed AR markers, real Java code instead of flexible pseudocode, and supporting only a single hardcoded algorithm (like Dijkstra’s).
Methods
The authors built Augmented Algorithm, a web-based tool that turns snapshots or PDFs of unmodified textbook pages into live execution environments.
When a user uploads a page, standard computer vision tools (LayoutParser and Google Cloud Vision OCR) detect and extract pseudocode blocks. What’s novel here is how a multi-agent LLM pipeline (orchestrated via LangGraph) translates messy, informal pseudocode into a synchronized animation:
- Semantic Analysis & Code Generation: Instead of mechanically mapping syntax to visuals, lightweight models (GPT-5 nano) infer the algorithm's name, inputs, and Big-O time/space complexities, while heavier models (Claude Sonnet 4) translate the pseudocode into runnable Python or JavaScript. Both code-writing steps use self-reflection loops to catch and debug execution errors automatically.
- "Interesting Event" Injection: Inspired by classic visualization theory, an LLM agent semantically analyzes the code to insert visualization "hooks" at conceptually meaningful moments (e.g., swapping array elements or traversing a tree node).
- Language-Agnostic Rendering: An AWS Lambda sandbox runs the code, intercepting the hooks to emit a standardized JSON stream of visual commands. A D3.js frontend interprets this stream to render interactive arrays, bar charts, linked lists, or trees.
Crucially, the visualization stays anchored to the source text: stepping through the animation highlights the exact line of textbook pseudocode being executed and overlays live variable values inline. Users can even draw a box around sample arrays elsewhere on the page to OCR them directly into the visualizer as test inputs, or open an editor to tweak the generated code.
Datasets
Because no standardized benchmark exists for evaluating pseudocode-to-AV pipelines, the authors curated an evaluation set from 23 different DSA textbooks. They randomly sampled 30 pseudocode snippets—10 each for insertion sort, linked-list traversal, and binary search tree (BST) search—spanning wide syntactic variations. For the user study, they used pages from the classic Introduction to Algorithms (CLRS) textbook.
Key Insights and Ideas
- Semantic hooks beat syntactic mapping: Because pseudocode varies wildly across textbooks (from Python-esque to plain English), traditional parsers break. Using LLMs to grasp the conceptual essence of an algorithm allows the system to place visual triggers where they pedagogically matter, even when OCR text extraction is slightly imperfect.
- Aligning with " home" notation lowers barriers: Interviews revealed that instructors actively warn students against using public AV websites because differing notations cause confusion. Generating visuals directly from the instructor's chosen text solves this alignment problem instantly.
- Visualizing broken code as a learning tool: Because the system provides a live code editor rather than a "black box" animation, students can intentionally break or modify the algorithm and immediately see where the logic derails—turning debugging into visual experimentation.
Key Results
- Technical Pipeline: Across the 30 textbook samples, pseudocode OCR achieved 94.7% character accuracy. Despite minor OCR hiccups, the LLM pipeline hit 100% accuracy in both Big-O complexity inference and generating valid executable code. On a 5-point rubric, generated AVs scored 5.0 for execution fidelity and visualization type, 4.87 for data encoding, and 3.28 for aesthetics.
- Student Usability (N=15): The system earned an exceptional System Usability Scale (SUS) score of 92.17. On a 7-point Likert scale, students rated it vastly higher than traditional textbook reading for both engagement (6.67 vs. 3.80) and usefulness (6.80 vs. 3.73).
- Instructor Interviews (N=6): Veteran CS educators praised the tool's potential to slash prep time and re-engage unmotivated students, noting its unique value for visualizing niche or advanced variations of algorithms missing from standard websites.
Limitations and Future Work
- Aesthetic inconsistency: Aesthetics was the lowest-scoring technical metric (3.28/5). LLMs struggled to consistently apply color-coding conventions—like shading already-sorted elements or showing traversal history—even across examples of the same algorithm.
- Scope of algorithms and languages: Currently, the system only generates Python and JavaScript (leaving out C++ and Java staples) and visualizes basic structures (arrays, linked lists, trees), lacking support for complex graphs or red-black trees.
- Visuals without "Why": Instructors noted that concise pseudocode (like Dijkstra’s) can still feel opaque even when animated, suggesting future versions include LLM-generated text/audio explanations or interactive pop-quizzes to test comprehension rather than just passive viewing.
- Classroom validation: The student study used pre-verified AVs with students who already knew basic DSA to isolate UI usability; future longitudinal classroom studies are needed to measure actual learning gains and handle potential LLM hallucinations in the wild.
Summary updated