Coding Challenge #68: Breadth-First Search Part 1

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



Duration: 21:19
108,695 views
1,721


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 2: https://youtu.be/-he67EEM6z0

🎥 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=4054s

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

Timestamps:
0:00 Introducing today's topic: Breadth First Search
2:42 6 Degrees of Bacon
4:45 Node object
6:40 Let's Code!
8:02 Graph Object
9:44 Read the data
12:28 Attach a method to the graph object using prototype
16:52 Add an edges function
17:38 Determine whether actor node already exists

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