Deakstadieđáhus: Iterative algorithms for multilayer optimizing control