I have a graph with directed and undirected edges, now I want to get rid of the undirected edges by replacing them with directed edges (each undirected edge becomes one directed edge). There are two possibilies for each undirected edge (replace it with a directed edge in one direction or the other direction).
How to determine the direction of the undirected edges so that my graph stays acyclic?
My approach:
Create a graph with only the directed edges and add the undirected edges 1 by 1 (as directed edges) later on. Now I have a DAG, my problem is reduced to adding directed edges to the graph while maintaining the DAG properties (only directed edges, no cycles).
How to add an edge to a DAG and be sure that the resulting graph is also a DAG?