Computing the girth of knots