Application of dynamic programming to the general inverse problem | Synapse