Testing the algorithm structure with simplified cost function