> For the complete documentation index, see [llms.txt](https://jenhsuan.gitbook.io/algorithm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jenhsuan.gitbook.io/algorithm/notes-of-algorithms/du-xian-sou-breadthfirst-search.md).

# 廣度優先搜尋 (Breadth-first Search)

## 1.Introduction

* 是一種圖形(graph)搜索演算法
* 從圖的某一節點(vertex, node)開始走訪, 接著走訪此一節點所有相鄰且未拜訪過的節點, 由走訪過的節點繼續進行先廣後深的搜尋
* 以樹(tree)來說即把同一深度(level)的節點走訪完, 再繼續向下一個深度搜尋, 直到找到目的節點或遍尋全部節點
* 廣度優先搜尋法屬於盲目搜索(uninformed search)是利用佇列(Queue)來處理

![](https://901207480-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGKoChvN9am4__HCIRK%2F-LH2RJeZFO8zHbL75DHu%2F-LH2S_iGKco4kTamHAkw%2F4fbe158c-6410-40f1-8628-9c06a4377ee4.png?alt=media\&token=0cb30e45-7fa2-4158-abc3-0df01a19dc00)

##
