Directed graphs and direction of edges

How can i turn a directed graph into an undirected graph, being able to choose the direction of the edges? to_directed gives an arbitrary direction to each edge, right?

Do you mean turn an undirected graph into a directed one? Based on what do you want to choose the edge directions?

For example, we can choose edge directions from low-index vertices to high-index vertices and thus obtain a directed acyclic graph:

dg=Graph([sorted(e) for e in g.get_edgelist()], directed=True)
plot(dg, layout=dg.layout_sugiyama())