Connecting Roads?

Like SimCity BuildIt with only straight roads, trying to figure a way that all roads can stay connected. What I mean is that if a road is deleted it can’t be if it creates islands.

Hope that makes sense.