All problems
Augmented Lagrangian Multiplier Update
Problem
The augmented Lagrangian method updates the multiplier as lambda + rho * g(x), where g(x) is the equality constraint violation and rho the penalty parameter.
Given the multiplier, the violation, and rho, return the updated multiplier.
Hint
The dual variable accumulates the scaled violation.
Test cases
case 1
in: [0,1,10]
expected: 10
case 2
in: [2,-0.5,4]
expected: 0
case 3
in: [-1,0.25,8]
expected: 1
Starter codePython
def augmented_lagrangian_multiplier_update(multiplier, violation, rho):
# Your code here
pass3 test cases · run your code against them in the editor