By using chromatic partitioning ,we can divide the graph into 3 independent sets with x vertices each (like tripartionining similar to bipartition graph).For maximum number of edges a vertex in a set is connected to all the vertices in the other 2 sets but not with vertex in its own set(i.e independent).
If we consider the sets coloured as Red,Blue,Green, each with x vertices each.
Step1.
1.Connect each vertex of Red to every vertex of Blue and green,total possible edges = Number of vertices in Red * (number of vertices in blue +number of vertices in green) = 2x^2
2.Connect each vertex of blue to every vertex of green,total possible edges = number of vertices in blue*number of vertices in green = x^2
Total edges = 2x^2+x^2 =3x^2 =n*x