Coding Challenge #68: Breadth-First Search Part 2

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=-he67EEM6z0



Duration: 22:25
48,134 views
1,462


In this two part challenge, I implement the Breadth-First Search algorithm in JavaScript. My demo application is "6 Degrees of Kevin Bacon" (finding the closest relationship between Kevin Bacon and another actor). Code: https://thecodingtrain.com/challenges/68-breadth-first-search

🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/0_6EV76Qy

Other Parts of this Challenge:
📺 Breadth-First Search Part 1: https://youtu.be/piBq7VD0ZSo

🎥 Previous video: https://youtu.be/IIrC5Qcb2G4?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🎥 Next video: https://youtu.be/flxOkx0yLrY?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🎥 All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH

References:
📕 The Nature of Code Part 2 (Spring 2017) - Intelligence and Learning: https://github.com/shiffman/NOC-S17-2-Intelligence-Learning
📕 Nature of Code: https://github.com/nature-of-code/noc-book-2
🥓 The Oracle of Bacon: http://oracleofbacon.org/
🗄 Breadth-First Search on Wikipedia: https://en.wikipedia.org/wiki/Breadth-first_search
📘 Grokking Algorithms: https://www.manning.com/books/grokking-algorithms

Videos:
🚂 My Video on Associative Arrays: https://youtu.be/_5jdE6RKxVk
🚂 My Video on Prototypes: https://www.youtube.com/watch?v=hS_WqkyUah8
🔴 Coding Train Live 88: https://youtu.be/YUlJAu1j_UM?t=5553s

Related Coding Challenges:
🚂 #65 Binary Tree: https://youtu.be/ZNH0MuQ51m4
🚂 #98 Quadtree: https://youtu.be/OJxEcs0w_kE

Timestamps:
0:00 Continuation of Breadth First Search
2:31 Add end and start node to graph object
4:35 Queue data structure
6:53 Write the code for the breadth first search algorithm
13:37 Find the path
16:59 Create a dropdown
20:04 Add reset function

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

🚂 Website: http://thecodingtrain.com/
👾 Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
💡 GitHub: https://github.com/CodingTrain
💬 Discord: https://thecodingtrain.com/discord
💖 Membership: http://youtube.com/thecodingtrain/join
🛒 Store: https://standard.tv/codingtrain
🖋️ Twitter: https://twitter.com/thecodingtrain
📸 Instagram: https://www.instagram.com/the.coding.train/

🎥 Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
🎥 Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

🔗 p5.js: https://p5js.org
🔗 p5.js Web Editor: https://editor.p5js.org/
🔗 Processing: https://processing.org

📄 Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new

#breadthfirstsearchalgorithm #sixdegreesofkevinbacon #javascript #p5js







Tags:
JavaScript (Programming Language)
live
programming
daniel shiffman
creative coding
coding challenge
tutorial
coding
challenges
coding train
the coding train
javascript
p5.js
p5.js tutorial
bfs
breadth-first search algorithm
bfs algorithm
breadth-first search javascript
breadth-first search js
bfs kevin bacon
six degrees of kevin bacon
search algorithm
maze solving
maze solving algorithm
shortest path algorithm