0

I'm drawing simple directed graphs using Qt's graphics view framework.

My problem is about the initial location of each element : how can I compute the location of the elements to draw a graph without overlapping elements ?

My graphs are pretty simples : about ten elements, and all elements are boxes.

(these are dependency graphs, think about an inheritance graph in doxygen with one base class and about 5-8 sub or sub-sub or sub-sub-sub classes)

I've looked into graphviz, but it seems an over kill for me, and I don't need a library which also draws the graph, since I'm doing it with Qt.

What are the name of the algorithms involved in such a computation ? My use case is simple, so I think I can implement it my self if there is no C/C++ library available, but I don't know where to start my search.

Thanks

Aurelien
  • 1,032
  • 2
  • 10
  • 24
  • 1
    Maybe see http://stackoverflow.com/questions/5028433/graph-auto-layout-algorithm . – hyde Jul 11 '16 at 19:31
  • Also check out the Qt Elastic Nodes example, then just imagine the nodes are boxes in your graph: http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-example.html – hyde Jul 11 '16 at 19:31
  • But in general, there are too many possible solutions, this question is a bit too broad for Stack Overflow, I think... – hyde Jul 11 '16 at 19:32

0 Answers0