def convert_graph_directed_to_undirected(dg):
udg = UndirectedGraph()<EOL>udg.nodes = copy.deepcopy(dg.nodes)<EOL>udg.edges = copy.deepcopy(dg.edges)<EOL>udg.next_node_id = dg.next_node_id<EOL>udg.next_edge_id = dg.next_edge_id<EOL>for edge_id in udg.get_all_edge_ids():<EOL><INDENT>edge = udg.get_edge(edge_id)<EOL>target_node_id = edge['<STR_LIT>'][<NUM_LIT:1>]<EOL>target_node = udg.get_node(target_node_id)<EOL>target_node['<STR_LIT>'].append(edge_id)<EOL><DEDENT>return udg<EOL>
Converts a directed graph into an undirected graph. Directed edges are made undirected.