Graph Drawing: Introduction2
Contents
• Applications of graph drawing
• Planar graphs: some theory
• Different types of drawings
Graph Drawing: Introduction3
Applications
• Earliest graph drawings: family trees • VLSI / circuit design
– First major application of automated graph drawing
– Floor planning
• Aesthetically pleasing graph drawings– Visualizing molecules, organisation diagrams, UML-
schemes, database designs (ER-diagrams), questionnaires,
Graph Drawing: Introduction4
Planar graphs
• Can be drawn on the plane without crossings
• Most road networks
• From models of geometric problems– E.g. Delauney triangulations of point sets
Graph Drawing: Introduction5
Plane graph
• Plane graph = planar graph given with fixed embedding in the plane
• A planar graph has several embeddings– Some are topologically equivalent, some not.
Graph Drawing: Introduction6
Some notions
• Faces• Exterior face• Interior faces• Each edge is incident to 2 faces• Boundary of a face• Outer boundary• Outer vertex, outer edge• Inner vertex, inner edge
Graph Drawing: Introduction7
Equivalent embeddings
• For each face in one embedding, there is a face in the other embedding with the same boundary.
• 3-connected planar graphs have a unique embedding– A graph is 3-connected, if and only if removing any 2
vertices still gives a connected graph
• We can get equivalent embeddings with any face chosen as exterior face
Graph Drawing: Introduction9
Kuratowski / Wagner
• A graph is planar if and only if it does not contain the K5 and the K3,3 as a homeomorphic subgraph / as a minor.
• Minor: H is a minor of G, if H can be obtained from G by a series of 0 or more deletions of vertices, deletions of edges, and contraction of edges.
• Does not yield fast recognition algorithm!
Graph Drawing: Introduction10
Euler’s theorem
• Let G be a connected plane graph with n vertices, m edges, and f faces. Then n + f – m = 2.
• Proof. By induction. – True if m=0.– If G has a circuit, then delete an edge that is part of a
circuit: this decreases f by one and m by one. n stays the same. IH.
– If G has a vertex v of degree 1, then delete v: this decreases n by one, m by one, while f stays the same. IH.
Graph Drawing: Introduction11
Euler’s theoremCorollaries
• If G is a connected plane graph with no parallel edges and no self-loops, with n > 1, then m 3n-6.– Every face `has’ at least three edges; each edge
`is on’ two faces, or twice on the same face.
• Every plane graph with no parallel edges and no self-loops has a vertex of degree at most 5.
Graph Drawing: Introduction12
Maximal planar graph
• G=(V,E) (without parallel edges and self-loops) is a maximal planar graph, if – G is planar– For each two vertices v, w, v w, {v,w} E:
• G + {v,w} is not a planar graph
• Often also called: triangulated– Each face is a triangle
• |E| = 3|V| - 6, for maximal planar graphs
Graph Drawing: Introduction13
Duality
• The dual G* of a plane graph G– A vertex in G* for each face of G– An edge in G* when faces share an edge in G
(G*)* = G(G*)* = G
Graph Drawing: Introduction14
Testing planarity
• Detailed algorithms can test in O(n) time if a graph G=(V,E) is planar– And find for each vertex a clockwise ordering
of the outgoing edges as they can appear in an embedding in the plane
Graph Drawing: Introduction15
Types of drawings
• Vertices can be represented as– Points– Circles or rectangles
• Edges can be represented as– Straight lines– Curves– Lines with bends– Sequences of horizontal and vertical line segments– Implicitly, by adjacency of rectangles representing
vertices
Graph Drawing: Introduction16
Planar drawing
• Vertices are points in de plane
• Edges are curves between endpoints
• No edges cross– Many different types…
Graph Drawing: Introduction17
Polyline drawings
• Each edge is a polygonal chain
• Each edge is a chain of horizontal and vertical line segments (orthogonal drawing)
Graph Drawing: Introduction18
Straight line drawing
• Each edge is a straight line.
• Theorem: a planar graph has a plane embedding where each edge is a straight line. (Wagner (1936); Fáry (1948); Stein (1951))
Not astraight
linedrawing
A straightline
drawing
Graph Drawing: Introduction19
Box orthogonal drawings
• A graph with a vertex of degree more than 4 does not have an orthogonal drawing
• In a box orthogonal drawing a vertex is represented by a rectangle (box)
Graph Drawing: Introduction20
Rectangular drawing
• Vertices are points• Edges are a vertical or
horizontal line• No crossings• Each face is a
rectangle• Generalization: box
rectangular drawing
Graph Drawing: Introduction21
Grid drawing
• Each vertex and each bend is on a grid point– Prevents drawings to
have many points in a very small area
– When drawing on raster device (e.g., screen)
– Area minimization
Graph Drawing: Introduction22
Visibility drawing
• Each vertex is horizontal line segment
• Each edge is vertical line segment between segments of its vertices
Graph Drawing: Introduction23
Properties of drawings
• Area (e.g. for grid drawings)
• Number of bends– In total; maximum per edge
• Number of crossings (if graph is not planar)
• Aspect ratio (length of longest edge / length of shortest edge)
• Shape of faces (e.g., rectangles, convexity)
• Symmetry (drawing isomorphic parts in the same or mirrored ways)
• Angular resolution (angles between adjacent edges)
• Beauty?
Graph Drawing: Introduction24
A data structure for a plane graph
• Adjacency lists give edges in clockwise order
• For easily moving around in the graph:– Adjacency lists are doubly linked– The two entries for an edge are linked to each
other• Enables listing all vertices or edges on a fast in a
fast way