Can PCG be used to stitch together level instances?

I do plan on having hallways for rooms, but my concern is it causing some kind of loop. Something like the below happening.

So far what I can think of is just line tracing to see if there’s already a room. I suppose that should work. Haven’t used PCG yet so not sure if it can solve issues like properly spawning a linear dungeon of prebuilt rooms.