Circular Drawing of Graphs
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 11 Circular Drawing of Graphs 11.1 Introduction Graphs are used to represent many kinds of information structures: computer, telecom- munication, social networks, entity-relationship diagrams, data flow charts, resource alloca- tion maps, and much more. Graph Visualization is the study of techniques which produce drawings of graphs. These visualizations provide a snapshot of each graph and allow experts to be free from the work of organizing the nodes and edges and thereby allowing more time to interpret the composition of these structures. A circular graph drawing (see Figure 11.1 for an example) is a visualization of a graph with the following characteristics: ² The graph is partitioned into clusters, ² The nodes of each cluster are placed onto the circumference of an embedding circle, and ² Each edge is drawn as a straight line. There are many applications which would be strengthened by an accompanying circular graph drawing. For example, circular drawing techniques could be added to tools which h j g d f i c a i d g b a e i f e c b h Figure 11.1: A graph with arbitrary coordinates for the nodes and a circular drawing of the same graph as produced by an implementation of our algorithm. 1 manipulate telecommunication, computer, and social networks to show clustered views of those information structures. The partitioning of the graph into clusters can show structural information such as biconnectivity, or the clusters can highlight semantic qualities of the network such as sub-nets. Emphasizing natural group structures within the topology of the network is vital to pin-point strengths and weaknesses within that design. It is essential that the number of edge crossings within each cluster remain low in order to reduce the visual complexity of the resulting drawings. The remainder of this chapter is organized as follows: In section 2 we will discuss how to draw a graph on a single embedding circle with a low number of crossings. In section 3 and 4 algorithms for drawing graphs on multiple embedding circles will be discussed. In section 3 the circles will be determined by properties of the graph, while in section 4 we will consider user-de¯ned groups of graphs. 11.2 Circular Drawing on a single embedding circle In this chapter we will present algorithms that compute a permutation of vertices such that their placement on the periphery of a circle in this order will result in a low number of crossings. In general, the problem of minimizing the number of crossings is NP-complete. The algorithms we will describe guarantee that they produce a cross-free visualization if this is possible. In any other case, experimental results have shown a low number of crossings. We will divide the graphs into three categories each of which will be examined separately. The ¯rst class is trees, the second is biconnected graphs, and the third all other kinds of graphs. 11.2.1 Circular drawing of trees When the graph G(V; E) to visualize is a tree, there is always a way to place the vertices on the periphery of a circle in such a way that no two edges cross. The order of each vertex can simply be the discovery time of the vertex during a depth-¯rst search traversal of the tree. The procedure takes O(jV j+jEj) = (jV j) time since for every tree we have jEj = jV j¡1. Figure 11.2 illustrates an example. Figure 11.2: Circular drawing of a tree without crossings 11.2.2 Circular drawing of biconnected graphs In this section, we are interested in biconnected graphs. The reason for this is that if a biconnected graph admits a visualization with no crossings, there exists an algorithm for 2 ¯nding this embedding. Slight modi¯cation of this algorithm leads in a general algorithm which gives a small number of crossings in the general case. First we shall introduce the aspect of an outerplanar graph De¯nition 11.1 A graph is outerplanar i® it can be drawn on the plane such that all its vertices lie on the boundary of a single phase and no two edges cross. The requirement of placing all nodes on the periphery of some embedding circle is equivalent to placing all nodes on a single face (the external face) of some embedding. Thus, we would at least like to be able to recognize outerplanar graphs and draw them in a way that no crossings appear. The reason for concentrating on biconnected graphs, is that there is exactly one way to place the vertices of an outerplanar biconnected graph on the periphery of a circle without creating crossings. Theorem 11.1 There exists only one clockwise ordering of the nodes in a biconnected outerplanar graph G such that the drawing of G with the nodes in that order around the embedding circle is plane. P roof. It is obvious that any Hamilton circle, can be drawn on the periphery of an embedding circle in exactly one way. The ordering of the vertices has to be the same as in the hamilton circuit. In ¯gure 11.3 we can see an example of a non-planar drawing of a hamilton circle. Figure 11.3: A non-planar drawing of a simple cycle. So in order to prove the theorem it su±ces to show that every outerplanar biconnected graph is hamiltonian. We will prove this by contradiction. So let us say that an outerplanar biconnected graph is not hamiltonian. Let us consider the cross-free embedding E of the graph on a circle. Then there exists at least one pair of vertices that are placed succes- sively and are not neighbors,say u,v (¯gure 11.4). If we visit all vertices adjacent to u in a clockwise order starting from u, let w be the vertex we visit last. If we repeat the same procedure for vertex v but in counterclockwise order this time, the vertex we visit last has to be a vertex z appearing not later than w. If we meet z after w, it would mean that we would have at least one crossing, as the red line in ¯gure ilustrates.But the drawing is outerplanar so this is impossible. This means that either w=z, or z appears before w, in a counterclockwise traverse of the periphery starting from v. Furthermore no edge with an endpoint in arc u;d v can have its other endpoint inu; · v otherwise we would have crossings. This means that if z 6= w the graph is not connected, since no path connects u and v. On the other hand, if z = w the removal of this vertex would result in a disconnected graph for the same reason. This means the the graph is not biconnected. Both of these cases 3 contradict the fact that we have a biconnected outerplanar graph. So every outerplanar biconnected graph is hamiltonian. We know that it admits an out- erplanar drawing by de¯nition of an outerplanar graph, and this is unique because of the existence of a hamilton circuit. In addition, there is exactly one Hamilton circuit, other- wise, one of the Hamilton circuits would not be on the periphery, which according to the previous, would result in crossings. 2 Figure 11.4: Any biconnected outerplanar graph is hamiltonian. From the above we can see that in case of a biconnected outerplanar graph, the hamilton path has to appear on the periphery of the circle. The edges that are on the outer face are called External/Internal since one of the faces they belong to is the external face and the other internal. All other edges are Internal/Internal. This means that in order to ¯nd an outerplanar drawing it su±ces to ¯nd all the External/Internal edges, since they build the hamilton circuit. Equivalently, we can ¯nd all Internal/Internal edges. Biconnected outerplanar graphs have a series of properties that can help towards this direction. Theorem 11.2 [12] A graph G with n nodes is outerplanar if and only if either G is a triangle or 1. G has at most 2n ¡ 3 edges, 2. G has at least two degree two nodes, 3. No edge of G lies on more than two triangles, and 4. For any degree two node u which is adjacent to nodes v and w, the graph G minus node u plus the edge (v,w) (if not already in G) is also outerplanar. P roof We will only prove one direction of the theorem, that for every outerplanar graph the pre- vious criteria hold. 1. For every outerplanar graph G, jEj 5 2jV j ¡ 3 Consider a n-polygon. This is a hamilton circle of n vertices so it has n edges. If we select an arbitrary vertex u and draw edges towards all other vertices we will add n-3 more edges, edges towards all vertices except u and its two adjacent vertices in the hamilton circuit (¯gure 11.5). So we have an obviously outerplanar graph with 2jV j ¡ 3 edges. Now 4 it su±ces to show that no outerplanar graph can have more than 2jV j ¡ 3 edges. So let such a graph G(V; E), jEj > 2jV j ¡ 3 exist. If we add a vertex on the outer face and draw edges towards all other vertices we obtain a planar graph G'. This appears in ¯gure 11.6 Then for the new graph G0 we have: jV 0j = jV j + 1 jE0j = Ej + jV j > 3jV j ¡ 3 = 3jV 0j ¡ 6 But G' is planar, so Euler formula holds.