Function to return the minimum number of edges that need to be added to the given graph such that it contains at least one triangle
static int minEdges ( Vector < Pair < Integer , Integer > > v , int n ) {