Coding Challenge #68: Breadth-First Search Part 1
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