Given: a directed graph dataset Node(node_id,x_position,y_position) Edge(start_node,end_node)
node_id, and edge are certain, only one node set as start node, position of this node is certain, let it be (0,0), others' x and y position will be created randomly.
what I need is to sorting every node by row and Columns(reassign the x and y position) so that the whole graph looks reasonable, I mean, the edges will not cross too much.(since the edges must be straight line, crosses can not be avoid but can be minimize )
I have done the first step to divide the graph to many rows by BFS and the edges can only direct to bottom. Now I need help to sorting the nodes on every row. Or if you have any idea to sorting the whole graph, welcome.