Hard-coding a layout at run time

If the choice of the layout algorithm is hard-coded, but the layout must be performed at run time because the graphs are not known at programming time, one possible step-by-step procedure for the choice of the appropriate layout algorithm can be:
  1. Look at sample graphs for your domain.
  2. Try to determine some generalities about the properties of the structure and the size of the graph (Is the graph cyclic? Is the graph a tree? Is the graph a combination of the two? What is the number of nodes and links in the graph?)
  3. Pick an appropriate layout algorithm.
  4. Try out the algorithm on one or more samples.