If the given vertex is not visited then include it in the set
if ( ! visit [ x [ i ] [ 1 ] [ 0 ] ] [ x [ i ] [ 1 ] [ 1 ] ] ) { document . write ( x [ i ] [ 1 ] [ 0 ] + " " + x [ i ] [ 1 ] [ 1 ] + " " ) ; dfs ( x [ i ] [ 1 ] [ 0 ] , x [ i ] [ 1 ] [ 1 ] , visit , adj , N , M ) ; } } }