Efficient evaluation of inbreeding queries on pedigree data