Example result illustrating this prompt's visual direction. Actual results may vary by model, reference image and settings.
Depth-First Search Backtracking from Graph Sketches
Transform a graph photo into a recursive exploration with visible call-stack unwinding.
Prompt
Transform the uploaded photo of handwritten algorithm notes into a clean, readable visual walkthrough. Treat the photo as the source of truth: preserve its algorithm, legible input values and stated conventions; remove glare, skew and paper clutter while retaining a small source-note inset. Do not invent unreadable values or silently repair contradictory logic; ask one focused question if an essential detail cannot be read. Use the optional example below only when the source has no worked example and label it "Illustrative example". Preserve every edge and state the start and neighbor order. Mark a vertex visited on entry, skip visited neighbors and show backtracking only after eligible neighbors finish. Optional labeled undirected graph: edges A-B, A-C, B-D, D-C; start A, alphabetical neighbors; discovery order A, B, D, C; recursive stack grows [A], [A,B], [A,B,D], [A,B,D,C] and then unwinds. Distinguish discovery from completion. State O(V+E) time with adjacency lists and O(V) auxiliary space. Do not present DFS as a shortest-path guarantee. Layout: Use a highlighted graph route alongside stacked call frames, with separate entry and return panels and a persistent visited legend. Use an off-white canvas, dark high-contrast sans-serif labels and spacious cells. Include the algorithm title, input, numbered steps, final result and the stated complexity note. Pair colors with labels or outlines so meaning does not depend on color alone. Keep all values and state changes consistent across panels. If space is tight, simplify decoration rather than omitting essential steps. Output one polished educational image; treat it as a visual explanation, not executable code. Before finalizing, check the trace and all visible labels against the source.
How to use it
- Upload a clear photo of the relevant handwritten algorithm notes.
- Paste this prompt and specify any required input or indexing convention.
- Check the rendered values and labels against your source before publishing.
Common failure fixes
- If a cycle repeats indefinitely, mark each vertex visited before exploring neighbors.
- If the stack resembles a queue, show the newest recursive frame returning first.
- If discovery and completion are confused, give entry and return distinct labels.