Add connect_edge func.