In one embodiment, the routine determines a desired EGR valve opening amount and a desired turbocharger vane position based on engine operating conditions, such as engine speed, load, fuel injection amount, manifold (intake and/or exhaust) pressure, temperature, and/or combinations thereof.