Graph Layout > Using Advanced Features > Questions and Answers about Using the Layout Algorithms
 
Questions and Answers about Using the Layout Algorithms
Table 5.2 provides some helpful suggestions for using the layout algorithms. You may find some answers to questions that come up when using the Graph Layout package.
Questions and Answers about the Layout Algorithms  
Question
Answer
I perform the layout and nothing happens (no node is moved). Why?
One possible reason may be: the layout algorithms provided in Rogue Wave Views are all designed to do nothing, by default, if no change occurred in the graph since the last time the layout was performed successfully on the same graph. A change means that a node was moved, or a node or link was added, removed, or reshaped.
Another possible reason may be: an error or a special case occurred during the layout. You should call the getCode() method on the instance of layout report returned by the IlvGraphLayout::performLayout method. Check this value with respect to the documentation of the appropriate layout report class.
After performing the layout, the graph is laid out far from its initial position. Why?
Most of the layout algorithms use a layout region parameter to control the size and position of the layout. (For details of this parameter in the IlvGraphLayout class, see Layout Region). Depending on the value of this parameter, the nodes may be moved far from their initial positions.
To know whether a layout algorithm is designed to use a layout region parameter, check the documentation to see if the layout class overrides the supportsLayoutRegion() method of the base class in order to return IlTrue.
When I use certain layout algorithms on certain graphs, there are overlapping nodes. Why and what can I do?
One possible reason may be related to the different ways layout algorithms deal with the size of the nodes.
The Tree, Hierarchical, and Bus algorithms always avoid overlapping nodes. (The Orthogonal Link algorithm does not move the nodes.)
In any case, if the layout algorithm supports the layout region mechanism, you should try to increase the size of the layout region. For example, if your graph contains hundreds of nodes, it is not reasonable to use a small layout region, such as 600x600. There will not be enough space for all the nodes. You should try a larger layout region, for example 5000x5000.
In some networks, there are two subnetworks that are not connected, how will this affect the layout algorithms provided in Rogue Wave Views?
This depends on the layout class you use:
*IlvBusLayout: It will work on the “connected component” of the graph that contains the “bus object”. (You must specify the bus object as a parameter.) The other nodes that are not connected to the bus will not be moved.
*IlvTreeLayout, IlvHierarchicalLayout: No problem, it works well on these graphs. For the Circular and Radial Tree Layout, each connected subgraph will be laid out separately and positioned on a row/column grid.
*IlvOrthogonalLinkLayout: No problem, the algorithm does not differentiate between connected and disconnected graphs.
However, note that you can always deal with a disconnected graph by cutting it into several connected subgraphs (clusters). You can either create a new graph for each connected graph and lay out the new graph separately, or use the filtering feature to lay out each connected graph.
There are some attributes of the network that we know about (for instance, we know what the core switch is and what the center should be). Are such attributes taken into account by the layout algorithm?
It depends on the layout algorithm.
In the Tree Layout algorithm, you can specify the root node.
In the Bus Layout algorithm, you can specify the bus object.
In the Hierarchical Layout algorithm, you can specify node position indices and level indices.
If I useRogue Wave Views on different computers, I sometimes get different layouts for the same graph with the same parameters. Why?
There are two possible reasons:
*Different computers may be slower or faster. If the layout algorithm you use stops the computation when the specified allowed time has elapsed, a slower computer will cause the computation to stop earlier. That may be the cause of different results. This may happen even with the same computer if the load of the computer is increased. You can try to increase the allowed time specification.
*If you use a layout algorithm that uses the random generator and if you use the default option for the seed value (that is, the system clock is used), you get different results even on the same computer.

Version 6.1
Copyright © 2016, Rogue Wave Software, Inc. All Rights Reserved.