A direct algorithm for constrained variational problems in several dimensions. (1st January 2018)