This presentation first reviews existing methods for adapting and optimizing computational meshes in an output-based setting. The target discretization is the high-order discontinuous Galerkin finite element method, on unstructured meshes with variable-order elements. While high-order discretizations have the potential for high accuracy, they may not show a clear benefit in efficiency over low-order methods when applied to problems with discon inuities in the solution or derivatives. In such cases, the performance of high-order methods can be improved through adaptive mesh optimization. We focus on adaptive methods in which the mesh size and order distribution are modified in an a posteriori manner based on the solution. To drive the optimization, we use an output-based technique that requires the solution of an adjoint problem for a chosen output and calculations of residuals on finer approximation spaces. The mesh size is encoded in a node-based metric, and the approximation order, when adapted, is stored as a scalar field. An optimal distribution of both quantities is found by deriving cost and error models for h and p refinement, and by iteratively equidistributing the marginal error to cost ratios of refinement. The result is an optimal anisotropic mesh and order field for a particular flow problem. We demonstrate this h-p optimization technique for several representative flow problems in aerospace engineering, and we compare the results to other refinement techniques, including h-only and p-only refinement.