import fi.uef.cs.tra.AbstractGraph;
import fi.uef.cs.tra.Graph;
import fi.uef.cs.tra.Vertex;


public class TRAII_25_t20_skeleton {

    public static void main(String[] args) {

        // defaults
        int vertices = 4;
        int edges = 12;
        int print = 3;

        if (args.length > 0)
            vertices = Integer.parseInt(args[0]);

        if (args.length > 1)
            edges = Integer.parseInt(args[1]);

        int seed = vertices + edges;

        if (args.length > 2)
            seed = Integer.parseInt(args[2]);

        if (args.length > 3)
            print = Integer.parseInt(args[3]);


        Graph graph;

        int[] cliqueSizes = {3};

        // test 10 pairs
        for (int i = 0; i < 10; i++) {
            System.out.println("\nCreate bipartite graph: ");
            graph = GraphMaker.createBiPartie(vertices + i, vertices + i, edges + i, seed + i);
            if (print > 2 && i < 2)
                System.out.println(GraphMaker.toString(graph, 0));

            boolean result = isBiPartite(graph);
            System.out.println("isBiPartite (should be true): " + result);

            System.out.println("\nAdd a clique of size 3 (which makes graph non-bipartite): ");
            GraphMaker.addCliques(graph, false, cliqueSizes);
            if (print > 2 && i < 2)
                System.out.println(GraphMaker.toString(graph, 0));

            boolean result2 = isBiPartite(graph);
            System.out.println("isBiPartite (should be false): " + result2);


        }

    } // main()


    /**
     * Is graph a bipartite or not?
     *
     * @param g input graph
     * @return true if graph is bipartite, false otherwise
     */
    static boolean isBiPartite(Graph g) {

        // TODO

        return true;
    }


}
