/*Implementation of PStep_ColumnGenerator.h

It contains the member functions of PStep_ColumnGenerator8

*/

#include "PStep_ColumnGenerator.h"

//PStep_ColumnGenerator8:
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

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

//First use a heuristic labeling algorithm, in which Reachability is not considered in the
//dominance check. Only if no negative reduced cost p-step is found, run column generator 1.
void PStep_ColumnGenerator8::GenerateColumns(){


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

	//Apply column generator 8, which calls GenerateColumns1, while not considering reachability in dominance checks.
	GenerateColumns8();

	//Check if p-steps are added
	if (AlgorithmMembers.NumberOfCurrentPSteps == NumberOfCurrentPStepsBefore){

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

	}

}

//Solve pricing problem seperately for every(non - redundant) start and end node combination.
//The pricing problems are solved heuristically using column generator 1 where Reachability 
//is not considered in the Dominance check.
void PStep_ColumnGenerator8::GenerateColumns8(){

	//Store the original setting os DoNotCheckReachability
	bool OriginalDoNotCheckReachability = DoNotCheckReachability;
	//Update the column generator setting to only use a limited number of arcs
	DoNotCheckReachability = true;
	//Use column generator 1
	GenerateColumns1();
	//Restore the original setting of DoNotCheckReachability
	DoNotCheckReachability = OriginalDoNotCheckReachability;

}