What is a Graph? · Connected Components
Lesson 4
It turns out that such reachability questions arise frequently. The nodes of any graph can be partitioned into connected components with the following natural property: any two nodes from the same connected component are reachable from each other, whereas any two nodes from different components are not. In the next section, we will study the notion of connected components, the basic facts about them, and the way one works with them in Python.
Problem. Consider the following maze in the form of a grid of square cells with walls between some pairs of neighboring cells.

5 points