We propose three kinds of formulations for this joint optimization problem and present a gradient-based method to effectively solve this problem via a mixture of locally optimal search and global search heuristic where a near global optimum may be found.