This section introduces the Breadth-First Search (BFS) algorithm, explaining how it systematically explores trees and graphs by visiting all nodes at a given depth before proceeding to the next level. Readers will learn the detailed steps of implementing BFS, including the critical role of a first-in, first-out (FIFO) queue for managing node processing, and how it is used to find the shortest path in unweighted graphs. Practical applications like solving mazes are illustrated with a step-by-step walkthrough and a Python code sample, demonstrating how to trace paths and prevent revisiting nodes.
This page is free — overview and chapter list only.
The complete book body is sold separately.
Full book: $2.99 USDC via x402 ·
Per chapter: $0.25 USDC
Buy / open complete book (HTML)
· Complete book Markdown (.md)
Agents: start with free /library/discovery.json, sample free teaser chapters,
then pay for individual chapters or the complete book URL above.
Append .md to any content URL for Markdown with YAML front matter.
Chapters
- Bfs Looking Wide Before Looking Deep (Free teaser)
- Dfs Looking Deep Before Looking Wide ($0.25)
- Use Cases For Informed Search Algorithms ($0.25)
- What Is Evolution ($0.25)
- Problems That Evolutionary Algorithms Can Solve ($0.25)
- Life Cycle Of Genetic Algorithms ($0.25)
- Encoding The Solution Spaces ($0.25)
- Exercise What Is A Possible Encoding For The Following Probl ($0.25)
- Measuring Fitness Of Individuals In A Population ($0.25)
- Using Population Models ($0.25)
- Bit String Mutation For Binary Encoding ($0.25)
- Alternative Selection Strategies ($0.25)
- Order Encoding Working With Sequences ($0.25)
- Tree Encoding Working With Hierarchies ($0.25)
- In This Chapter ($0.25)
- Choose The Next Visit For Each Ant ($0.25)
- Update The Pheromone Trails ($0.25)
- Python Code Sample For Expressing A Particle ($0.25)
- Calculate The Fitness Particles ($0.25)
- Python Code Sample For Calculating Fitness ($0.25)
- Updating Velocity ($0.25)
- Updating Position ($0.25)
- Continued ($0.25)
- Summary Of Swarm Intelligence Particles ($0.25)
- Missing Data ($0.25)
- What Are Artificial Neural Networks ($0.25)
- The Perceptron A Representation Of A Neuron ($0.25)
- Exercise Calculate The Output Of The Following Input For The ($0.25)
- Forward Propagation Using A Trained Ann ($0.25)
- Exercise Calculate The Prediction For The Example By Using F ($0.25)
- Exercise Calculate The New Weights For The Highlighted Weigh ($0.25)
- Hidden Layers And Nodes ($0.25)
- The Goldilocks Principle Of Initialization ($0.25)
- The Hidden Layer As Matrix Multiplication ($0.25)
- Expressing Backpropagation Mathematically ($0.25)
- Generative Adversarial Networks ($0.25)
- The Inspiration For Reinforcement Learning ($0.25)
- Problems That Reinforcement Learning Can Solve ($0.25)
- Simulation And Data The Agents Environment ($0.25)
- Training With The Simulation Using Q Learning ($0.25)
- Exercise Calculate The Change In Values For The Q Table ($0.25)
- Use Cases For Reinforcement Learning ($0.25)
- Financial Trading ($0.25)
- What Are Llms ($0.25)
- The Intuition Behind Language Prediction ($0.25)
- Why The Sizes Of Tokens And Parameters Matter ($0.25)
- Prepare The Training Data ($0.25)
- Encoding From Text To Numbers ($0.25)
- Creating A Trainable Embedding Matrix ($0.25)
- Exercise What Is The Final Input Vector For Token 2 ($0.25)
- Calculating Attention Weights ($0.25)
- Making A Prediction ($0.25)
- Exercise What Is The Logit For Token 31 ($0.25)
- Training Epochs ($0.25)
- Few Shot And Zero Shot Learning ($0.25)
- Fine Tuning The Llm With Reinforcement Learning ($0.25)
- Content Generation ($0.25)
- Enhancement Of Digital Products ($0.25)
- Selecting And Collecting Image Data ($0.25)
- Cleaning And Preprocessing Image Data ($0.25)
- Forward Diffusion ($0.25)
- Exercise What Is The Noise For Pixel 1 1 If The Random Numbe ($0.25)
- Timestep Embedding ($0.25)
- Text Label Embedding ($0.25)
- Cnn Input Shape ($0.25)
- Feature Map ($0.25)
- U Net ($0.25)
- Encoder Downsampling Layers ($0.25)
- Python Code Sample For A Convolutional Layer ($0.25)
- Bridge ($0.25)
- Upsampling ($0.25)
- Python Code Sample For Upsampling ($0.25)
- Python Code Sample For The Skip Connection And Final Convolu ($0.25)
- Calculating Loss ($0.25)
- Denoising The Data ($0.25)
- Exercise What Is The Timestep Scale For T 3 ($0.25)
- Training Data Composition And Diversity ($0.25)
- Training Epochs 2 ($0.25)
- Creative Ideation And Concept Art ($0.25)
- A New Online Reading Experience ($0.25)