compute path bounds