What is the difference between Greedy-Search and Uniform-Cost-Search?

前端 未结 3 714
盖世英雄少女心
盖世英雄少女心 2021-02-01 16:46

When searching in a tree, my understanding of uniform cost search is that for a given node A, having child nodes B,C,D with associated costs of (10, 5, 7), my algorithm will cho

3条回答
  •  遥遥无期
    2021-02-01 17:13

    Nope. Your understanding isn't quite right.

    The next node to be visited in case of uniform-cost-search would be D, as that has the lowest total cost from the root (7, as opposed to 40+5=45).

    Greedy Search doesn't go back up the tree - it picks the lowest value and commits to that. Uniform-Cost will pick the lowest total cost from the entire tree.

提交回复
热议问题