get_edges is now a pure subroutine, optimized loop in cs_graph get_edges