A branch and bound approach to permutation codes