Contents
8 EmbeddedGraphs page 2 8.1 Drawings 3 8.2 Bidirected Graphs and Maps 5 8.3 Embeddings 10 8.4 Order-PreservingEmbeddingsofMapsandPlaneMaps 15 8.5 TheFaceCyclesandtheGenusofaMap 16 8.6 Faces,FaceCycles,andtheGenusofPlaneMaps 19 8.7 Planarity Testing, Planar Embeddings, and Kuratowski Subgraphs 23 8.8 ManipulatingMapsandConstructingTriangulatedMaps 68 8.9 Generating Plane Maps and Graphs 73 8.10 Faces as Objects 75 8.11 Embedded Graphs as Undirected Graphs 78 8.12 Order from Geometry 79 8.13 MiscellaneousFunctionsonPlanarGraphs 81
Bibliography 85
Index 87
1 8 Embedded Graphs
Drawings of graphs are ubiquitous. In this chapter we introduce important mathemati- cal concepts related to embedded graphs and we discuss algorithms that draw and embed graphs and that deal with embedded graphs. We provide only a minimum of the required mathematics and refer the reader to [Whi73] for a detailed treatment. We start with the definition of what it means to draw a graph and an example of a drawing algorithm. We discuss bidirected graphs and maps, our technical vehicle for dealing with embedded graphs, in Section 8.2 and the concepts of embedding and planar embedding in Section 8.3. In this section we also introduce functions that test the planarity of a graph, that construct a plane embedding of a planar graph, and that exhibit a Kuratowski subgraph in a non-planar graph. Their implementation is discussed in Section 8.7. Sections 8.4 and 8.5 introduce order-preserving embeddings, plane maps, face cycles, and the genus of maps. In Section 8.6 and 8.12 we relate combinatorics and geometry. In particular, we prove that a map is plane if and only if its genus is zero and we derive an upper bound on the number of edges of any planar graph and we show how to construct the map induced by geometric positions assigned to the nodes of a graph. In Section 8.8 we show how to modify maps, in Section 8.9 we discuss the generation of random plane maps, and in Section 8.13 we introduce functions that five-color a planar graph and choose a large independent set in a planar graph. Section 8.10 introduces face items as a means of dealing with faces in the same way as with nodes and edges. In Section 8.11 we discuss our design choice of representing maps by directed graphs instead of undirected graphs.
2 8.1 Drawings 3
6
2
4 1
0
3 5
Figure 8.1 A drawing produced by one of the graph drawing algorithms in AGD [JMN].
8.1 Drawings We have already seen many drawings of graphs in this book. We have never defined what we mean by a drawing, embedding, and planar embedding. Let G be a graph and let S be a surface, e.g., the plane or the sphere or the torus. We will be almost exclusively concerned with the plane in this book. However, the concepts also apply to more complex surfaces. A drawing I of G in S assigns a point I (v) S to every node v of G and a Jordan curve1 ∈ I (e) to every edge e (v, w) such that: = (1) distinct points are assigned to distinct nodes, i.e., I (v) I (w) for v w, 6= 6= (2) the curve assigned to any edge connects the endpoints of the edge, i.e., if e (v, w) = then I (e)(0) I (v) and I (e)(1) I (w). = = A drawing in the plane is called a straight line drawing if every edge is drawn as a straight line segment. Figure 8.2 shows some drawings. An algorithm, that takes a graph and produces a drawing for it, is called a graph drawing algorithm2. LEDA provides some graph drawing algorithms; see the section on graph draw- ing in the manual and try the button layout in a GraphWin for a demonstration. Many more graph drawing algorithms are available in the systems AGD [JMN] and GDToolkit [Bat].
1 A Jordan curve c is a curve without self-intersections, i.e., a continuous mapping c : [0, 1] S with c(x) c(y) for 0 x < y < 1. −→ 2 Graph6= drawing is an≤ active area of research, see [BETT94, EM98, DETT98] for surveys. 4 Embedded Graphs
v4 v3 v2 v3 v2
v4
v1 v1
v3 v2 v3 v2
v4 v1
v1 v4
Figure 8.2 Some drawings of the same graph. All drawings except for the right upper drawing are embeddings.
Both systems are based on LEDA. Figure 8.1 shows a drawing produced by an algorithm in AGD.
The functions