Compare different search algorithms

How are DFS and first-order search similar? How similar are BFS and Best-first?

For me, to better describe how DFS and BestFS are similar, it might be easier to point out the difference, which is that in BestFS we chose the following to expand the one that seems closest to the target using the heuristi function. In almost all other cases, both of the best and DFS are similar.

However, it’s hard for me to find the similarities between BFS and BestFS

+3
source share
2 answers

Well, imagine you have a tree. You know that he has one sheet with the data you want. Suppose you want to find this leaf by traveling through the various branches of a tree until you find it.

With Depth First search , if you come across a branch, you should take this branch and then take another branch, another and another, until you get to the leaf.

With a quick first search (note, I didn’t say 'better first' here), when you come across a new branch, you add it to the queue to return to it later until you find all the branches at the current level. Usually, when people say β€œBFS,” they mean Width First Search , not Best First.

Best , ? , , , . DFS , , .

, , , . , - type Depth.

, .

+7

Best First Search - , , . , , , node . , Best First Search , , .

- , , . ( ) ( ). Wiki.

, , . , , , ( , , ) ( , ).

- ( )

- ( )

-

, .

, .

+2

Source: https://habr.com/ru/post/1732310/


All Articles