What is the difference between graph search and tree search?

后端 未结 5 962
予麋鹿
予麋鹿 2020-12-02 03:50

What is the difference between graph search and tree search versions regarding DFS, A* searches in artificial intelligence?

5条回答
  •  悲哀的现实
    2020-12-02 04:25

    In simple words, tree does not contain cycles and where as graph can. So when we do search, we should avoid cycles in graphs so that we don't get into infinite loops.

    Another aspect is tree will typically have some kind of topological sorting or a property like binary search tree which makes search so fast and easy compared to graphs.

提交回复
热议问题