Skip to content

Concept module

Frontier and Visited State on Graphs

Keep repeat skips, waiting frontier nodes, and already-expanded nodes visible together so cycle handling feels like honest bookkeeping on one graph bench.

The simulation shows one labeled graph with the current node, the frontier nodes, and the visited nodes colored differently so waiting work and finished work stay separate. A readout card reports the traversal mode, current node, frontier size, visited count, and target, while a cue panel shows the frontier order and the current neighbor list. Breadth-first search is running on the bridge cycle graph from A toward H. The start node is waiting on the frontier. The frontier currently holds 1 node, and 0 nodes have already been visited.

Interactive lab

Graph traversal bench

Keep one live graph, the current frontier, and the visited state visible together so breadth-first and depth-first search read like different process choices on the same structure.

Live graphBreadth-first search on bridge cycleQueue frontierAstartBCDEFGHtargetTraversal readoutLivemodeBreadth-first searchgraphBridge cyclecurrentreadyfrontier1visited0targetHTraversal readyThe queue frontier starts with the start node, then expands outward layer by layer.Queue frontier keeps the next candidates visible while visited state prevents repeat work.Traversal cuesQueue frontierAStart neighborhoodB, C

Controls

Bridge cycle
A
H
BFS

More tools

Secondary controls, alternate presets, and less-used toggles stay nearby without crowding the main bench.

Show

More presets

Presets

Time

0.00 s / 18.7 sLivePause to inspect a specific moment, then step or scrub through it.
0.00 s18.7 s

Predict -> manipulate -> observe

Keep the active prompt next to the controls so each change has an immediate visible consequence.

ObservationPrompt 1 of 2
The frontier is a waiting line of claimed nodes, not a list of finished nodes.

Graphs

Switch graph views without breaking the live stage and time link.

New discoveries versus repeat skips

Compare fresh discoveries with the repeat edges that visited state prevents from reopening.

step: -1.5 to 20.22checks: -0.72 to 9.72
new discoveriesrepeat skips
New discoveries versus repeat skipsCompare fresh discoveries with the repeat edges that visited state prevents from reopening.-1.53.939.3614.7920.22-0.721.894.57.119.72stepchecks
Hover or scrub to link the graph back to the stage.step / checks

Equation map

See each variable before you move it.

Select a symbol to highlight the matching control and the graph or overlay it most directly changes.

Graph layout
1

Switches among the bounded graph scenes on the same traversal bench.

Graph: New discoveries versus repeat skipsGraph: Visited nodes versus frontier sizeOverlay: Visited cueOverlay: Frontier cue

Equations in play

Choose an equation to sync the active symbol, control highlight, and related graph mapping.

More tools

Detailed noticing prompts, guided overlays, and challenge tasks stay available without taking over the main bench.

Hide

What to notice

Keep the graph and one traversal graph visible together.

ObservationPrompt 1 of 2
The frontier is a waiting line of claimed nodes, not a list of finished nodes.
Control: Traversal modeGraph: Visited nodes versus frontier sizeOverlay: Frontier cueEquation

Guided overlays

Focus one overlay at a time to see what it represents and what to notice in the live motion.

3 visible

Overlay focus

Frontier cue

Show which claimed nodes are waiting next.

What to notice

  • Frontier nodes are not finished yet, even though the search has already claimed them.

Why it matters

It keeps waiting work distinct from finished work on graphs with cycles.

Control: Traversal modeControl: Start nodeGraph: Visited nodes versus frontier sizeEquationEquation
Breadth-first search is running on the bridge cycle graph from A toward H. The start node is waiting on the frontier. The frontier currently holds 1 node, and 0 nodes have already been visited.
Equation detailsDeeper interpretation, notes, and worked variable context.

Visited and frontier update

Expanding one node moves it into the visited set while new neighbors join the waiting frontier.

Start node 0 Target node 7 Traversal mode 0

Repeat-skip count

Repeat work appears when checked neighbors are not new discoveries.

Graph layout 1 Traversal mode 0

Progress

Not startedMastery: NewLocal-first

Start exploring and Open Model Lab will keep this concept's progress on this browser first. No finished quick test, solved challenge, or completion mark is saved yet.

Let the live model runChange one real controlOpen What to notice

Try this setup

Jump to a named bench state or copy the one you are looking at now. Shared links reopen the same controls, graph, overlays, and compare context.

This bench opened from a setup link. Any new copy will reflect the state you see now.

Current bench

Bridge cycle BFS preset

This bench still matches one named preset, so the copied link will reopen that same starting point along with the current graph, overlays, and inspect context.

Open default bench

Saved setups

Premium keeps named exact-state study setups in your account while stable concept links stay public below.

Checking saved setup access.

This concept can keep using stable links while the saved-setups capability resolves for this browser.

Copy current setup

Stable concept and section links stay public below while exact-state setup sharing stays behind premium.

Stable links

Starter track

Step 6 of 60 / 6 complete

Algorithms and Search Foundations

Earlier steps still set up Frontier and Visited State on Graphs.

1. Sorting and Algorithmic Trade-offs2. Binary Search / Halving the Search Space3. Graph Representation and Adjacency Intuition4. Breadth-First Search and Layered Frontiers+2 more steps

Previous step: Depth-First Search and Backtracking Paths.

Short explanation

What the system is doing

On a graph with cycles, the frontier and the visited state are not the same thing. The frontier holds nodes that have already been claimed but are still waiting to be expanded. The visited state marks nodes whose neighborhoods have already been used.

That separation is what stops graph traversal from wasting time on the same loop over and over. This bench keeps repeat skips, frontier size, and visited nodes visible together so cycle handling feels like visible bookkeeping rather than hidden magic.

Key ideas

01Frontier nodes are waiting work, not finished work.
02Visited state means a node's neighborhood has already been expanded, so repeat edges can be skipped honestly.
03Cycles become manageable when the search keeps claimed, waiting, and finished nodes distinct.

Worked example

Read the full frozen walkthrough.

Frozen walkthrough
Read the frontier and visited sets directly from the bridge-cycle bench.

Live worked examples are available on Premium. You can still read the full frozen walkthrough on the free tier.

View plans
Frozen valuesUsing frozen parameters

On the bridge-cycle graph, why are frontier and visited state both needed?

Graph layout

Bridge cycle

Frontier role

claimed but waiting

Visited role

already expanded

1. Read the frontier honestly

Nodes on the frontier have already been discovered, but they are still waiting for their neighborhoods to be expanded.

2. Read the visited role honestly

Visited nodes are the ones whose edges have already been used, so repeat edges back into them can be skipped.

3. Read the cycle consequence

That separation keeps the bridge-cycle graph from reopening the same diamond loops every time one edge points backward.

Cycle-control read

Frontier means waiting; visited means already expanded.
Keeping those roles separate is what turns cycles into manageable bookkeeping instead of repeated work.

Common misconception

Frontier and visited state are basically the same set with two different names.

A frontier node has been claimed but not expanded yet. A visited node has already had its neighborhood used.

That difference is exactly what makes repeat skips and clean backtracking possible on looped graphs.

Mini challenge

Build a graph run where repeat skips become visible before the frontier is empty.

Prediction prompt

Decide whether you need a looped graph or a tree-like graph before you change the preset.

Check your reasoning

Use the bridge-cycle graph so backward edges appear while there is still frontier work waiting.
Repeat skips become visible when the graph contains cycles and the traversal has enough time to encounter them.

Quick test

Reasoning

Question 1 of 2

Answer from the visible cycle bookkeeping, not from memorized vocabulary.

What is the clearest difference between the frontier and the visited state?

Choose one answer to reveal feedback, then test the idea in the live system if a guided example is available.

Accessible description

The simulation shows one labeled graph with the current node, the frontier nodes, and the visited nodes colored differently so waiting work and finished work stay separate.

A readout card reports the traversal mode, current node, frontier size, visited count, and target, while a cue panel shows the frontier order and the current neighbor list.

Graph summary

One graph tracks visited nodes against frontier size, a second tracks current depth against the deepest claimed depth, and a third compares new discoveries with repeat skips.

Together they show how cycle-handling depends on keeping frontier and visited state distinct.