Multi-layer optimization algorithm. (March 2022)