Example result illustrating this prompt's visual direction. Actual results may vary by model, reference image and settings.
Dijkstra Relaxation Steps from Weighted Graph Notes
Turn weighted-graph notes into a shortest-path walkthrough with tentative distance updates.
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". Verify nonnegative edge weights, preserve edge direction and distinguish tentative from finalized distances. Start at distance zero and use infinity for unknown distances. Repeatedly select the unsettled vertex with smallest tentative distance and relax its outgoing edges. Optional labeled directed example: A->B weight 4, A->C weight 1, C->B weight 2, B->D weight 1, C->D weight 5; settle A,C,B,D and obtain distances A=0,C=1,B=3,D=4. Show D improving from 6 to 4. Reject negative-weight inputs for this method. For adjacency lists and a binary heap state O((V+E) log V) time and O(V+E) overall storage. Layout: Place the weighted graph above a compact distance table; mark each changed table cell and selected vertex consistently across four panels. 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 negative weight is present, flag it and do not claim a valid Dijkstra result.
- If a tentative value is treated as final, finalize only the minimum unsettled vertex.
- If a shorter route is ignored, recompute candidate distance as current distance plus edge weight.