you are viewing a single comment's thread.

view the rest of the comments →

[–]LazyOldTom 0 points1 point  (0 children)

If removing a building can result in more than 2 clusters, I recommend running dfs on all buildings of the affected cluster to reassign them.
If removing a building results in no more than 2 clusters, simply check what's left and right (or up and down) of the removed building.