Updated find_edges and added C++ test