Detect when a graph has been broken into two or more connected components

Link/cut tree may help you. Daniel Sleator, on of the authors of that structure shared his solution to the similar problem. Look his comments on codeforces.ru you may find them useful.

I would write here my idea. Let's create one vertex under the bottom level. This vertex is the basement of your building. Connect basement_vertex with all vertices at the bottom level. Run depth first search (DFS) from basement vertex. This dfs will produce rooted tree. This tree should be base (initial stage) of some link-cut tree.

UPDATE

Link-Cut Trees works only when given graph is a tree. For any graph we have to solve dynamic connectivity problem. Here more info about dynamic connectivity problem.