IntroductionThe layered graph layout algorithm aims to highlight the main direction or flow within a directed graph. Cyclic dependencies of nodes are automatically detected and resolved and nodes are placed in hierarchically arranged layers. Additionally, the ordering of the nodes within each layer is chosen in such a way that the number of edge crossings is small. This layout algorithm is very appropriate for hierarchically organized diagrams, organization charts, etc. Nevron is pleased to present you the NLayeredGraphLayout class which implements the layered graph drawing algorithm within Nevron Diagram.
Nevron Diagram algorithm takes as input a simple graph and produces a hierarchically organized drawing of it. The algorithm maintains the following aesthetic criteria (given by their priority in descending order): - minimal number of levels - minimal number of edge crossings (a level by level sweep optimization is used) - minimal number of bends |
ImplementationThe input of the Layered Graph Layout algorithm must be a directed acyclic graph (DAG), so if the graph contains cycles a preliminary step that removes them is performed. When we ensure that the input graph is a DAG we may perform the first phase of the algorithm - the Layer Distribution. It distributes the vertices of the graph to layers by using the Longest Path Layering algorithm. All vertices without predecessors are put at level 1 and the other vertices are distributed to the next level / levels in such a way that the following statements are true:
- The final graph must occupy as small area as possible - The layers must be regular. This can be achieved easily by adding dummy vertices for each edge (u, v) with length more than 1 layer - The number of added dummy vertices must be minimal When the vertices are distributed to layers we perform a crossing reduction step which rearranges the vertices on each layer in such way that the number of edge crossings is minimized. Finally we calculate the coordinates of the vertices and edges of the drawing and render them using the Nevron Diagram Rendering Engine. |
Users ManualThe NLayeredGraphLayout class is the class that implements the Nevron Layered Graph Layout algorithm. It layouts the vertices in the graph on hierarchically organized levels. The algorithm is very appropriate to use on all types of graphs (and especially on hierarchically organized ones), except for dense graphs (i.e. graphs with a large number of edges compared to their number of vertices). The result of the layout and the aesthetic criteria for the final drawing can be controlled through the following properties:
Fig. 1
Fig. 2
Fig. 3
Fig. 4
|
Conclusion
Layerd Graph Layout Gallery
Nevron Layered Graph Layout is a powerful layout algorithm that produces very nice drawings of hierarchically organized diagrams. The layout is integrated in Nevron Diagram for .NET thus giving you the power to layout any diagram in a hierarchical manner using only a few lines of code.
Besides the robust and highly optimized implementation of the Layered Graph Layout, Nevron Diagram for .NET provides a dozen of other well implemented and carefully tested layout algorithms. If we take in mind all these layouts, the high number of examples and the detailed programmers’ documentation provided by Nevron, we may conclude that the professional visualization of complex graphs and diagrams has never been easier. More information on Layered Graph Layout is available in the Users Guide shipped with the fully-functional evaluation of the Diagram for .NET. |
About Nevron SoftwareFounded in 1998, Nevron Software is a component vendor specialized in the development of premium presentation layer solutions for .NET based technologies.
Today Nevron has established itself as the trusted partner worldwide for use in .NET LOB applications, SharePoint portals and Reporting solutions.
Nevron technology is used by many Fortune 500 companies, large financial institutions, global IT consultancies, academic institutions, governments and non-profits.
For more information, visit: www.nevron.com. |
We use cookies to allow us to automate the access and the data entry functions of our website and to correlate online ordering information for purchases you may make while at the website (if any), tailor our website to your preferences or interests, or customize promotions or marketing. For full details read our cookie policy.