ParentFull threadmm_aa·Micromouse competition is exactly about this. There are plenty of algorithms published. Some version of flood fill is the most popular I think.View on HN