/*Implementation of PStep_ColumnGenerator.h

It contains the member functions of PStep_ColumnGenerator9

*/

#include "PStep_ColumnGenerator.h"

//PStep_ColumnGenerator9:
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

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

//First use a heuristic labeling algorithm, in which Reachability is not considered in the
//dominance check and only limited arcs are used. Only if no negative reduced cost p-step
//is found, apply exact labeling column generator 1.
void PStep_ColumnGenerator9::GenerateColumns(){

	//Obtain the number of p-steps currently added
	int NumberOfCurrentPStepsBefore = AlgorithmMembers.NumberOfCurrentPSteps;
	
	//Store the original setting of DoNotCheckReachability
	bool OriginalDoNotCheckReachability = DoNotCheckReachability;
	//Update the column generator setting to not considering reachability in dominance checks.
	DoNotCheckReachability = true;
	//Apply column generator 3, using a limited set of arcs
	GenerateColumns3();
	//Restore the original setting of DoNotCheckReachability
	DoNotCheckReachability = OriginalDoNotCheckReachability;

	//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();

	}

}