Skip to content
DeepForgeby svx
All problems
HardOptimizationop-284

Saddle Negative Curvature Direction

Problem

At a saddle point of f(x) = 0.5 x^T A x with symmetric A = [[a, b], [b, d]], the escape direction is the unit eigenvector of the smaller eigenvalue lambda_min = (a + d - sqrt((a - d)^2 + 4 b^2)) / 2.

Given a, b, and d, return the normalized eigenvector [b, lambda_min - a] when b is nonzero, otherwise [1, 0] if a <= d else [0, 1].

Hint

Solve (A - lambda I) v = 0 for the smaller eigenvalue and normalize.

Test cases

case 1
in: [2,0,4]
expected: [1,0]
case 2
in: [1,1,1]
expected: [0.7071067811865475,-0.7071067811865475]
case 3
in: [1,0,1]
expected: [1,0]
Starter codePython
def saddle_negative_curvature_direction(a, b, d):
    # Your code here
    pass

3 test cases · run your code against them in the editor