Check if we can add an edge in the graph
if ( G . find ( a ) != G . end ( ) and G . find ( b ) == G . end ( ) and a != b ) { G [ a ] . push_back ( b ) ; G [ b ] . push_back ( a ) ; count ++ ; } else if ( G . find ( b ) != G . end ( ) and G . find ( a ) == G . end ( ) and a != b ) { G [ b ] . push_back ( a ) ; G [ a ] . push_back ( b ) ; count ++ ; } else if ( G . find ( a ) == G . end ( ) and G . find ( b ) == G . end ( ) and a != b ) { G [ a ] . push_back ( b ) ; G [ b ] . push_back ( a ) ; count ++ ; } else { if ( ! checkPath ( a , b , G ) and a != b ) { G [ a ] . push_back ( b ) ; G [ b ] . push_back ( a ) ; count ++ ; } } }