It's amazing how the term "searching" can be applied to many difference problems we have on our hand. Searching, is one of the most important activity that comes under different names. Query, find, detect, check ...etc. All these words can be taken under the term searching.
Often times running a search is an easier task. But implementing a search is not. Think about a relational database table. Searching for a record is an easier task when you use SQL. "select * from products where productId = '1'" is a statement which is not difficult to produce. But on the hand the implementation of this search in a DBMS might not be easy to digest as this SQL statement.
Another example is searching for an item in an array. It's a something we all do. Most of the times, our language or the base library implements that for us.
So all these are "searches". But searching can be more general and complicated. Detecting the next best move in a particular time in a chess game is a something that calls for this type of a searching problem.
Here we talk about three important broadly applicable searching algorithms. They fall under uninformed search in AI. They are,
- Breadth First Search
- Depth First Search
- Uniform Cost Search
Breadth First Search
Before getting into the algorithm, for a moment let's think about the general approach for a search.
In a search, we first we need to have a source to search. It can be a table, graph or set of files. Then you need an starting point for a search. And, finally, you need a target to search. To make sure there is a posibillity for your search to succeed, the target should be a part of your source. Otherwise, your search will fail and you wont find the target in your source.
With that, breadth first search means an expanding search that covers the entire source.
Top comments (1)
your post is interesting
I would like to get to know you better. Would you please contact me? t_g_@kanelim1997