Computing Girth and Cogirth in Perturbed Graphic Matroids