Diagram > Layouts > Graph Layouts > Orthogonal Layout 
The orthogonal graph layout is represented by the NOrthogonalGraphLayout class. An orthogonal drawing of a graph is an embedding in the plane such that all edges are drawn as sequences of horizontal and vertical segments. In particular for nonplanar and nonbiconnected planar graphs, this is a big improvement. The algorithm is complex and very hard to implement, but it is fast and handles both planar and nonplanar graphs at the same time.
The algorithm takes as input a simple graph and produces an orthogonal grid drawing. Note that if the input graph is planar, the resulting drawing is also planar (i.e. without edge crossings). In the case of nonplanar graphs the edge crossings are inevitable but the algorithm tries to keep their number as low as possible. For both planar and nonplanar graphs the layout offers a great improvement in the readability of the graph by maintaining the following aesthetic criteria (given by their priority in descending order):
 minimal number of edge crossings (0 for planar graphs)
 minimal number of bends
 minimal area of the final drawing
Following is a brief description of the algorithm.
The result of the layout and the aesthetic criteria for the final drawing can be controlled through the following properties:
UseCompaction – if set to true, a compaction algorithm will be applied to the embedded graph. This will decrease the total area of the drawing with 20 to 50 % (in the average case) at the cost of some additional time needed for the calculations. The following images illustrate the effect of this property in the case of a tree with 13 vertices and 12 edges:
Orthogonal Graph Layout  No Compaction,

Orthogonal Graph Layout – With Compaction,

GridCellSizeMode – this property is an enumeration with 2 possible values: GridCellSizeMode.GridBased and GridCellSizeMode.CellBased. If set to the first the maximal size of a node in the graph is determined and all cells are scaled to that size. More area efficient is the second value  it causes the dimensions of each column and row dimensions to be determined according to the size of the cells they contain. See the pictures below for an example of the aforementioned cell sizing scenarios.
Grid based cell size 
Cell based cell size 
CellSpacing – determines the distance between 2 grid cells. For example if a grid cell is calculated to have a size of 100 x 100 and the CellSpacing property is set to 10, then the cell size will be 120 x 120. Note that the node is always placed in the middle of the cell.
The Orthogonal Graph Layout also handles selfloops and duplicate edges in graphs. It integrates them into the orthogonal grid drawing trying not to increase the total area if possible.
When arranging very large graphs (i.e. graphs with hundreds or thousands of vertices and edges) the orthogonal graph layout may need more time to execute the complex computations that take part in the layout process. If you want the layout to complete faster, you can turn off the compaction, but you should be aware of the fact that this will produce a drawing that occupies larger area.