Drag the background!

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.

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:
  1. It can add the node we are searching to the queue.
  2. It does not immediately stop when finds goal.
The background is a program, showing the JavaScript graphics used on this site.
The globes light up when you log in.
 
Font:

Users retain ownership of user content.

Platforms      Stats      The name      Terms and conditions

Call for partners      Contact

Call for partners!
Ancient Brain is looking for a partner to co-write a JavaScript or Python coding book for schools, to be used worldwide. This would be a course for students in learning to code from scratch. The book and course will be integrated into the Ancient Brain site. This is an opportunity for someone looking to develop a course and textbook to partner with a site to promote it. Read more.