Storing the edges in a vector of pairs
Vector < Pair < Integer , Integer > > v = new Vector < > ( Arrays . asList ( new Pair < > ( 1 , 2 ) , new Pair < > ( 1 , 3 ) ) ) ; System . out . println ( minEdges ( v , n ) ) ; } }