Spring embedders do not take into account edge directions. In directed graphs, all edges should point into the same direction when possible. Recently, Misue and Sugiyama [SuMi94, SuMi95] proposed an extension that enforces this effect: Edges are considered as springs, but also as magnetic needles which are oriented according to a magnetic field. Spring forces depend on the length of the edges and are parallel to the edges. A magnetic force additionally depends of the angle between edge and magnetic field, and is directed orthogonally to the edge. Thus, it rotates the edge. The magnetic force becomes zero when the edge points exactly in the direction of the field (Fig. 5). In the formula of magnetic forces, denotes the unit vector orthogonal to and the parameters and c allow to tune the force:
Different magnetic fields have been used (Fig. 6). A parallel field can be used to give most edges a top down orientation (Fig. 7). The number of edges pointing against the field direction depends on the strength of the field; it is small but seldom minimal.
Figure 7: Ternary Tree with Magnetic Field
A concentric field can be used to illustrate cycles in the graph (Fig. 8). Binary trees are often drawn in orthogonal layouts. A similar effect can be produced by a compound magnetic field where different sets of edges are influenced by different components of the field (Fig. 9). However, larger trees often produce edge crossings in the orthogonal field, such that this method is not perfectly suited for orthogonal drawings.
Figure 8: Layout of Cube with Magnetic Field
Figure 9: Layout of Binary Trees with Magnetic Fields