/*Implementation of PStep_ColumnGenerator.h

It contains the member functions of PStep_ColumnGenerator16

*/

#include "PStep_ColumnGenerator.h"

//PStep_ColumnGenerator16:
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

//Generate columns
//------------------------------------------------------------------------------------
//First use a heuristic labeling algorithm, in which only a limited number of arcs is used. Only if no
//negative reduced cost p-step is found, run column generator 14.
void PStep_ColumnGenerator16::GenerateColumns(){

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

	//Apply column generator 16, which calls GenerateColumns14, while using only a limited set of arcs.
	GenerateColumns16();

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

		//Use the exact column generation algorithm 14
		GenerateColumns14();

	}

}

//Solve pricing problem seperately for every(non - redundant) start and end node combination.
//The pricing problems are solved heuristically using column generator 14 where only a limited number
//of arcs are considered.
void PStep_ColumnGenerator16::GenerateColumns16(){

	//Store the original setting of UseLimitedArcs
	bool OriginalUseLimitedArcs = UseLimitedArcs;
	//Update the column generator setting to only use a limited number of arcs
	UseLimitedArcs = true;
	//Use column generator 14
	GenerateColumns14();
	//Restore the original setting of UseLimitedArcs
	UseLimitedArcs = OriginalUseLimitedArcs;

}