Algorithm to auto-arrange entity relationship diagram
Asked Answered
R

2

11

I am currently writing a control (in C#) for displaying a set of tables and the relationships that exist between them. I got the basic control done, but would like to implement something similar to the "Auto-Arrange" feature provided by the diagramming component of SQL Express.

What kind of algorithm does it follow to identify the optimal layout of tables? That is, an algorithm that considers all the "relationship paths" and comes up with a layout in which the tables can be arranged without much clutter.

Renae answered 13/8, 2009 at 7:1 Comment(0)
H
4

Look into Graphviz. Even if you can't use it as a dependency, it has plenty of documentation about the algorithms used.

Hamlin answered 13/8, 2009 at 12:45 Comment(0)
T
3

Check out graph layout algorithms, in particular "orthogonal layout". According to Wikipedia this is a "layout with edges running horizontally or vertically, with approaches that reduce the number of edge crossovers and area covered."

Tutty answered 13/8, 2009 at 7:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.