STUDY ON THE OPTIMAL CONTROL OF TREELENGTH FLOW