This article discussed an algorithm for the Micromouse Competition, which is an international event in the field of artificial intelligence and is held by the International Institute of Electrical and Electronics Engineering (IEEE) every year. The discussion proposed “dead-end exclusion algorithm” to exclude one-line dead-end and “osmosis algorithm” to exclude dead-zone of any shape. The two improved algorithms were demonstrated in practical testing and competition. The key idea of the improved algorithms was to exclude dead-zone which did not contain the shortest path basing the obtained information. In this article, “osmosis idea” was used in maze algorithm for the first time, which realized the judgment and exclusion of the dead-zone effectively. Compared with classical algorithms, these improved algorithms had better temporal and spatial optimization result.