On my specialized course in school I worked on a pcg level maker.
Red arrows indicate unconeccted points, white arrows indicate
connected points.
The system tries with every unconnected point to connect a random module, and if it collides with another module it will retry a specified number of times, until it close the path with a wall.