Mark all edges emerging out of this vertex visited
for ( int co = 1 ; co <= V ; co ++ ) { if ( gr [ v ] [ co ] && ! vis [ v ] [ co ] ) { vis [ v ] [ co ] = true ; vis [ co ] [ v ] = true ; cnt ++ ; } } } }