I'm exploring the idea of using machine learning to draw a topology of elements. For example, imagine a tree representing geological hierarchy (country -> province -> city). All countries are at the top-most level, then the provinces for each country, followed by the provinces splitting into cities at the 3rd vertical level.

The vertical positions of the elements are trivial to compute:

  • Country -> 0 %
  • Province -> 33%
  • City -> 66%

in a canvas going vertically down as the % increases.

However, I'm having trouble thinking of how to format the data to determine the horizontal position. I'm aware that there are non-ml algorithms to draw topologies, but I'm exploring this as a proof of concept.

My plan right now is to assign each element id,parentId,rank properties where

  • id is a unique id
  • parentId is the id of the parent element
  • rank is 1/2/3

However, I feel like this isn't the best way to represent the data to feed into the ml model. I'm welcome to any guidance/recommendations on how to better represent the problem.

My terrible mspaint description of the problem:

  • 1
    $\begingroup$ I think your post a sub-optimal fit for a Q&A-site: Real Questions Have Answers. $\endgroup$
    – greybeard
    Sep 4, 2020 at 16:07
  • $\begingroup$ If you have a real problem you're trying to solve, then the requirement to restrict yourself to ML seems artificial and unhelpful. ML isn't magic and isn't appropriate for all problems. I don't see a specific question in your post. We're looking for narrowly focused, technical questions. $\endgroup$
    – D.W.
    Sep 5, 2020 at 18:16


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy