compute optimal lineup