convert_edges function

Convert edges