This paper surveys recent results in the field of optimal control of hybrid and switched systems. We first summarize results that use different problem formulations and then explore the underlying relations among them. Specifically, based on the type of switching, we focus on two important classes of problems: internally forced switching (IFS) problems and externally forced switching (EFS) problems. For IFS problems, we focus on optimal control techniques for piecewise affine systems. For EFS problems, methodologies of two-stage optimization, embedding transformation and switching LQR design are investigated. Detailed optimization methods found in the literature are discussed.