add (better?) method for computing cost of a 2d patch configuration