THE NECESSARY AND SUFFICIENT CONDITION AND THE EFFICIENT ALGORITHMS FOR GRADUALLY VARIED FILL