Globally optimal classification and pairing of human chromosomes