Please turn JavaScript on to use this site.
Worlds
Minds
Users
Uploads
JS code
Search
Worlds
Minds
Users
Uploads
JS code
Intro
Introduction
Features
Definitions
Principles
The AI model
Teaching
Register a class
Learn
Getting started
P5 tutorial
Three.js tutorial
Coding course
Coding course II
Coding for kids
WebGL course
AI exercises
Browse
Starter Worlds
Editor's Choice
Showcase Worlds
Multi-user Worlds
Random Worlds
Advanced search
Docs
Docs
API docs
Register
Register
Forgot password
Login
Step 3. Breadth-first search (graphical)
This program does a graphical version of
Breadth-first search
. The graphic display uses a
Force-directed graph
.
Video
World
Breadth-first se...
Breadth-first search with a Force-directed graph.
Clone and Edit
Notes
Each run has a random graph and a random start node and goal node. (Reload for another one.)
The program uses Breadth-first search to find a path to the goal.
View console to see what is happening.
Credits
This is a modified port of
02_bfs_oop_fdg
from
AI course
by Daniel Shiffman.
Apparently no video.
This is an implementation of an algorithm in
Grokking Algorithms
by Aditya Bhargava.
Code modified here to generate random graphs with random labels.
Exercise
Clone and Edit the World. Fix these bugs:
It can add the node we are searching to the queue.
It does not immediately stop when finds goal.
Previous
Next: Step 4 of 9
Post this step to X: