A new algorithmic setting is proposed for the discrete-time finite-horizon linear quadratic (LQ) optimal control problem with constrained or unconstrained final state, no matter whether the problem is cheap, singular, or regular. The proposed solution, based on matrix pseudoinversion, is completed and made practically implementable by a nesting procedure for welding optimal subarcs that enables...