//***************************************************************************
//***************************************************************************
// Creates random graphs and keeps doing this until a graph with a non-greedy
// step in the range is found.  Then returns this sub_graph.
//***************************************************************************
//***************************************************************************



#include <LINK/userobj/PostAnalyze.h>


Graph*
ExtractNGInducedGraph(int num_verts, double prob, int percent,
		      int flag, int deviation)
{

	Graph* g;
	Graph* gr=0;
	int done = 0;
	int count = 0;

	while(!done)
	{
	g = GenRandomGraph(num_verts, prob);
        KLFM(g);

	Sequence<Vertex*> vs = PostAnalyze(g);

	//gr = Extract(g, percent, flag, deviation, vs);

	count++;
	cout << "loop# " << count << endl;
	if (gr != NULL) {
		delete g;
		break;
	}
	}
cout << "total times looped: " << count << endl;
//delete g;
return gr;
}

/*
void
main(int argc, char* argv[])
{
 
int n_verts = atoi(argv[1]);
double prob = atof(argv[2]);
int percent = atoi(argv[3]);
int flag = atoi(argv[4]);
int deviation = atoi(argv[5]);
 
Graph* induced_g = ExtractNGInducedGraph(n_verts, prob, percent, flag, deviation);
 
cout << endl << endl << "----------------------------------" << endl;
 
cout << *induced_g << endl;
}

*/
