/*Implementation of PStep_ColumnGenerator.h

It contains the member functions of PStep_ColumnGenerator4

*/

#include "PStep_ColumnGenerator.h"

//PStep_ColumnGenerator4:
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

//Generate columns
//------------------------------------------------------------------------------------

//Apply the local search heuristic of ColumnGenerator2, if it fails apply ColumnGenerator1 with a limited
//number of arcs like in ColumnGenerator3, if that fails as well apply ColumnGenerator1
void PStep_ColumnGenerator4::GenerateColumns(){

	//Obtain the number of p-steps currently added
	int NumberOfCurrentPStepsBefore = AlgorithmMembers.NumberOfCurrentPSteps;

	//Apply column generator 2
	GenerateColumns2();

	//Check if p-steps are added
	if (AlgorithmMembers.NumberOfCurrentPSteps == NumberOfCurrentPStepsBefore){
		//The heuristic did not identify negative reduced cost p-steps.

		//Generate columns with a limited number of arcs
		GenerateColumns3();

		//Check if p-steps are added
		if (AlgorithmMembers.NumberOfCurrentPSteps == NumberOfCurrentPStepsBefore){
			//The heuristic did not identify negative reduced cost p-steps.

			//Use the exact column generation algorithm 1
			GenerateColumns1();

		}

	}

}