I am working on a chatbot designer interface. The dataset for the conversation flow consists of messages. Each message has a parent message and can have multiple possible next messages. The system displays one of the possible next messages depending on the reply. This makes it a complicated structure of parent-children relations.
On the dialog flow designer interface, the user is able to drag messages around in order to achieve a visual clarity of the designer dialog flow. This is loads of work for the user.
I want to implement an algo that would do this job for the user. So the messages should distribute themselves at even distances and making sure that their children are also around their parent message evenly distributed.
I have not studied algos, so I am not sure what jargon to look for. I don't even know the proper tag to use in this question. What this kind of algorithm is called and how to achieve this?