I wrote a short directed graph viewer that generates random nodes and random directed relationships between nodes and presents them on screen.
The nodes are currently positioned sequentially as a grid, and as one can notice, there's a lot of line intersections happening:
I would like to reduce line intersections to make the graph look more appealing. There is no need to conform to the grid arrangement.
How do I programmatically reposition the nodes to untangle the graph as much as possible?