This is a small program in C that takes a input file with a given labyrinth and checks if the labyrinth has entry and exit connected using a custom implementation of the disjoint set reducing asymptotic complexity of the search algorithm. This is a proof of concept but the code should be well commented and runs well.
The program also generates random valid labyrinths and outputs the generated labyrinth to a file. The generation is done quickly without the use of the previous checking function but rather through an algorithm that intrinsically guaranteeds resolution.