Polyhedral Diameters and Applications to Optimization