If i exceeds the number of vertices , it means that there is no valid vertex in the given vertices that can be a sink
if ( i > vertices ) return - 1 ; else if ( ! issink ( i ) ) return - 1 ; else return i ; } }