I've got a undirected, complete graph and would like to convert it to a directed acyclic graph with a (unidirectional) path between each node. To start off, I want to add random edges and stop once all nodes are connected. What would be an algorithm to look at (using Python, but any language will do).
So for instance this graph, does not to be connected any further:
A ---- B A ---> B
\ / => /
\ / v
C C
, but in this case, all undirected edges turn into a directed edge
A ---- B A ---> B
\ / => ^ ^
\ / \ /
C C
Update
Note that the aim is to convert an undirected graph into a directed graph as per the above constraints. Like for a spanning tree, there are more than 1 solutions to this conversion process (as shown in above example).
networkx. I'll follow up your link - thanks. - orange