All problems
Augmented Lagrangian One Step 1D
Problem
Minimize x^2 subject to x = 1 with the augmented Lagrangian. With multiplier lambda and penalty rho, the primal update is x_new = (lambda + rho) / (2 + rho) and the multiplier update is lambda_new = lambda + rho * (x_new - 1).
Given lambda and rho, return [x_new, lambda_new].
Hint
Minimize x^2 + lambda (x - 1) + (rho / 2) (x - 1)^2 over x.
Test cases
case 1
in: [0,1]
expected: [0.3333333333333333,-0.6666666666666667]
case 2
in: [2,4]
expected: [1,2]
case 3
in: [-1,10]
expected: [0.75,-3.5]
Starter codePython
def augmented_lagrangian_one_step_1d(multiplier, rho):
# Your code here
pass3 test cases · run your code against them in the editor