BFS
题单介绍
## BFS 简介
---
### BFS 可解决两类问题:
- 从 A 出发是否存在到达 B 的路径
- 从 A 出发到达 B 的**最短**路径
(~~数据小的话 DFS 也不是不可以~~~)
## 例题
---
### 简单 BFS
- [P1746 离开中山路](https://www.luogu.com.cn/problem/P1746)
- [P1443 马的遍历](https://www.luogu.com.cn/problem/P1443)
- [P1747 好奇怪的游戏](https://www.luogu.com.cn/problem/P1747)
- [P2385 Bronze Lilypad Pond B](https://www.luogu.com.cn/problem/P2385)
### 多源 BFS
- [P1332 血色先锋队](https://www.luogu.com.cn/problem/P1332)
- [acw173 矩阵距离](https://www.acwing.com/problem/content/175/)
### 染色问题
- [P1162 填涂颜色](https://www.luogu.com.cn/problem/P1162)
- [P1506 拯救oibh总部](https://www.luogu.com.cn/problem/P1506)
### 洪水灌溉问题
- [P1596 Lake Counting S](https://www.luogu.com.cn/problem/P1596)
- [P1451 求细胞数量](https://www.luogu.com.cn/problem/P1451)
- [P1331 海战](https://www.luogu.com.cn/problem/P1331)
- [P1767 家族](https://www.luogu.com.cn/problem/P1767)
### 有外界干扰的迷宫问题
- [P2895 Meteor Shower S](https://www.luogu.com.cn/problem/P2895)
- [P3395 路障](https://www.luogu.com.cn/problem/P3395)
### 看起来比较困难的 BFS
- [P2658 汽车拉力比赛](https://www.luogu.com.cn/problem/P2658)
- [P1126 机器人搬重物](https://www.luogu.com.cn/problem/P1126)
- [P3111 Cow Jog S](https://www.luogu.com.cn/problem/P3111)
- [P2730 魔板](https://www.luogu.com.cn/problem/P2730)
### 双端队列广搜
- [P4554 小明的游戏](https://www.luogu.com.cn/problem/P4554)
- [P3596 棋盘](https://www.luogu.com.cn/problem/P3596)
- [P4667 Switch the Lamp On](https://www.luogu.com.cn/problem/P4667)
### 双向广搜
- [P1032 字串变换](https://www.luogu.com.cn/problem/P1032)
- [P1379 八数码难题](https://www.luogu.com.cn/problem/P1379)
- [P1135 奇怪的电梯](https://www.luogu.com.cn/problem/P1135)
- [P1825 Corn Maze S](https://www.luogu.com.cn/problem/P1825)