if there is a reverse edge from u to i , then only update
if ( g . get ( u ) . get ( i ) . second != 0 ) { disRev [ v ] . second = disRev [ u ] . second + 1 ; totalRev ++ ; } totalRev += dfs ( g , disRev , visit , v ) ; } }