I drew the graph but it's a complete mess so I assume there is some formula for this.
I confess I am not entirely sure of what I am supposed to do here. I think I am supposed to find subsets of vertices among which there is a path to each of them. So maybe I have to find the vertex or vertices which connect the two components somehow?

If you really want a formula, let's call $A$ your adjacency matrix of size $n$ (here, $n=6$).
$A$ represents all the paths of length 1 between two nodes, $A^2$ represents all paths of length 2 between two nodes, etc. Any path between two nodes in a graph with n nodes is at most of size $n-1$, so you need to compute $S = \sum\limits_{i=1}^{n-1}A^{i}$. $s_{ij}$ will then denote the number of paths of length at most $n-1$ between $i$ and $j$. There is a path between nodes $i$ and $j$ if and only if $s_{ij}$ is nonzero:
$$\begin{bmatrix} 1 && 1 && 1 && 1 && 1 && 1 \\ 0 && 0 && 1 && 0 && 0 && 1 \\ 0 && 0 && 1 && 0 && 0 && 1 \\ 1 && 1 && 1 && 1 && 1 && 1 \\ 1 && 1 && 1 && 1 && 1 && 1 \\ 0 && 0 && 1 && 0 && 0 && 1 \\ \end{bmatrix}$$