Optimization and majorization of invariant measures