merged edge simplification code with strongly connected components code