#include "cycle_graph_gen.h"

int main(int argc, char** argv) {
    registerGen(argc, argv, 1);
	int t = opt<int>("t");
	int minn = opt<int>("minn");
    int maxn = opt<int>("maxn");
	int minm = opt<int>("minm");
    int maxm = opt<int>("maxm");
    int mink = opt<int>("mink");
    int maxk = opt<int>("maxk");

    bool to_sort = opt<bool>("sort");
    
	auto ms = rnd.partition(t, maxm, minm);

    cout << t << "\n";

	for (int i = 0; i < t; ++i) {
        int m = ms[i];
        auto [pr, g] = GenRandom(m, 1, m);
        int graph_type = rnd.next(0, 9);
        vector<pair<int, int>> edge;
        vector<double> graph_pr = {0.5, 0.99, 1};
        if (graph_type == 0) {
            edge = build_graph(pr, g);
        } else if (graph_type <= 3) {
            edge = build_graph_dir(pr, g, graph_pr[graph_type - 1]);
        } else if (graph_type <= 6) {
            edge = build_graph_dir(pr, g, graph_pr[graph_type - 4], true, rnd.next(0, 1));
        } else if (graph_type <= 9) {
            edge = build_graph_priority(pr, g, graph_pr[graph_type - 7]);
        }
        int points_type = rnd.next(0, 3);
        vector<int> points;
        int vert = vertices(edge);
		int n = rnd.next(max(2 * vert + 3, minn), maxn);
		int k = rnd.next(mink, maxk);
		if (mink <= 2 && rnd.next() < 0.01) {
			k = 2;
		}
        if (points_type == 0) {
            points = gen_points(n, vert);
        } else if (points_type == 1) {
            points = gen_points_greedy(n, vert);
        } else if (points_type == 2) {
            points = gen_points_part_greedy(n, vert, 0.3);
        } else if (points_type == 3) {
            points = gen_points_part_greedy(n, vert, 0.03);
        }
        map_graph(points, edge);
        print(n, k, edge, true, to_sort);
	}
    return 0;
}