Depth and Regularity of Monomial Ideals via Polarization and Combinatorial Optimization