User Tools

Site Tools


breadth-first_search_and_depth-first_search

This is an old revision of the document!


Introduction

This tutorial serves as an introduction to path-planning and search algorithms. However, these topics do require prior knowledge of the methods used to program these algorithms. In order to understand these tutorials, you will need to be comfortable with C++, and especially the concepts associated with linked lists, stacks, and queues. An understanding of graph trees and how they are searched is also helpful for these tutorials.

If you want to learn C++ before reading these tutorials, there are a wealth of tutorials on the internet, and many will have different learning impact depending on personal preference. Here is one that I found helpful when learning the basics of C++: http://www.cplusplus.com/doc/tutorial/.

To learn or refresh your knowledge of linked lists, here is a great tutorial for these concepts: http://www.cprogramming.com/tutorial/lesson15.html.

For stacks, I prefer to reference this video: https://www.youtube.com/watch?v=UTgOWWmOVXY.

For queues, I prefer to reference this video: https://www.youtube.com/watch?v=JmQWuEnual4.

To learn about graph trees, here is a great tutorial for these concepts: http://www.tutorialspoint.com/graph_theory/index.htm.

Breadth-First Search (BFS) is a searching algorithm that utilizes the concepts involved with the queue data structure. BFS works by expanding all successors to a node before moving onto analyzing any of those successors. This is known as a first-in, first-out (FIFO) approach. As the search goes through the nodes, it analyzes which nodes are successors, and adds those nodes to the queue as they are found. Then, the search goes back to the queue, and starts to dequeue the nodes in the order that they were added, analyzing those successors and adding them to the queue as well. This method of searching through a graph expands all nodes as it searches, and therefore it casn be fairly inefficient if the goal is very far from the root node. However, tracing the path from root to goal is much easier using this search method.

For a more visual overview of this searching method, reference this tutorial: http://www.pdf-archive.com/2016/05/24/bfsdfstutorial/.

breadth-first_search_and_depth-first_search.1464053307.txt.gz · Last modified: 2016/05/23 18:28 by dwallace