Shortest arc on a sphere

Given a circle (blue) on a sphere, given a point A inside the circle, and a great circle AE (red), AB is a circle, lying on the sphere, tangent to great circle AE at A. Find the position of B giving the shortest arc AB. Points A, E, B can be moved at will. Point C is the center of the blue circle and can also be moved. The angle shown in green is the dihedral angle between the planes of circle AB and circle BE.