In all of the graphs we ve seen so far, it has been possible to get from any vertex to another by travelling one or more edges. This type of graph is called a connected graph. There are other graphs where it may not be possible to reach every other vertex starting at a given vertex. In this case there may be separate components of the graph which are connected. These components are called subgraphs.
Lets examine an example.
Notice that the graph is composed of two smaller graphs which are not connected to each other. If you draw a vertical line between the 3rd and 4th columns, and a horizontal line between the 3rd and 4th rows, it splits the matrix up into 4 smaller 3 by 3 matrices. Here is another disconnected graph. Lets see if the same thing happens again. However, we can interchange vertices to transform it into a block diagonal matrix.