merge_directed_graph function

Merge directed edges into equivalent undirected edges.