Finished Hopcroft algorithm