Lecture14 TreesAndGraphs
Lecture14 TreesAndGraphs
GRAPHS
Petra Isenberg
RECAP
you have learned about
• simple plots
• multi-attribute data visualization
DATA AND ITS
STRUCTURE
STRUCTURED DATA UNSTRUCTURED DATA
STRUCTURED DATA
• there are relationships between the data items
• you can use a graph representation
edge node
http://www.curehunter.com
edge node
DEFINITIONS
a tree is a connected graph with no cycles
DEFINITIONS
an undirected tree is an undirected graph in which any two
vertices are connected by exactly one simple path (= a path
with no repeated vertices)
DEFINITIONS
a directed tree is a digraph
(directed graph) whose
underlying graph is a tree
– a directed tree consists of a
number of nodes and parent-
child relationships
– every node has just one parent
and any number of children
– directed trees are the most
common form in computer
science
The most important nonlinear
TREES data structure in computer
science (Donald Knuth, 1997)
edge
node
DEFINITIONS
• the number of children of a node is called its
degree
• leaf nodes are nodes without children
DEFINITIONS
• a rooted tree is a directed tree with a
distinguished vertex r, called the root, such that
for every other vertex v there is directed path
from r to v. The root node is the only node with
no parent
• any node may act as a root in undirected trees
DEFINITIONS
the connection between parent and child nodes is
called an edge
DEFINITIONS
an ordered tree is a rooted tree in which the
children of each vertex are assigned a fixed
ordering.
EXAMPLES OF TREES
HIERARCHIES
HIERARCHIES
org charts aren’t
always trees, though
http://www.bonkersworld.
net/organizational-charts/
DECISION PROCESS
BRANCHING PROCESSES
7 11
2 6 8 10
1 4 5 9
0 3
2 6 8 10
1 4 5 9
0 3
NODE-LINK ALGORITHM
SIMPLE APPROACH
12
2 6 8 10
1 4 5 9
0 3
NODE-LINK ALGORITHM
SIMPLE APPROACH
12
2 6 8 10
7 11
1 4 5 9
2 6 8 10
1 4 5 9
0 3
0 3
PROS/CONS
• nodes at the same distance from the root are
horizontally aligned
• positive: simple to understand, clear symmetries
• negative: needs large area, often bad aspect
ratio (much wider than tall)
• what can we vary in this representation?
– marks that depict nodes
– visual variables used on marks to depict
metadata
– type of links
– visual variables used on marks that depict
the links
– placement of nodes
vary edges
node placement
marks
THREADVIS
• time-scaling
• coloring people
TREEJUXTAPOSER Rectilinear layout and interaction for
comparison of very large trees
http://www.cs.ubc.ca/~tmm/papers/tj/#video
2D, RADIAL, EXPLICIT EDGES
RADIAL NODE-LINK DRAWING
variation of layered drawing from beginning of
lecture
RADIAL NODE-LINK DRAWING
• nodes drawn on concentric circles
• nodes drawn within wedges of the
circular layout
C4
RADIAL NODE-LINK DRAWING C3
C2
• radius of Ci given by function p(i) C1
• subtree of v drawn within Wv
• to guarantee planarity (no edge v
crossings), wedge has to be convex
• several algorithms exist for figuring out
the correct angles, e.g.
annulus wedge Wv
𝑙(𝑢)𝛽𝑣
𝛽𝑢 = ,𝜏
𝑙(𝑣)
Q1
TREEMAP ALGORITHM
recursive algorithm
– the number of children of the current node define
the number of partitions of the current node
TREEMAP ALGORITHM
the weight of each node determines the
size of each partition
12 8 10 67
TREEMAP ALGORITHM
at each change of level, rotate orientation
of split by 90 degrees
2
2
12 8 2 67
3
1
TREEMAP ALGORITHM
at each change of level, rotate orientation
of split by 90 degrees
2
22
2
5
12 8 2
3 40
1
TREEMAP ALGORITHM
at each change of level, rotate orientation
of split by 90 degrees
2
6 8 11
2
5
12 8 2
3 40
1
TREEMAP
• a 2-D space-filling layout
• for further references and to try out a
treemap in various applications:
http://www.cs.umd.edu/hcil/treemap-
history/
TREEMAP VARIATIONS
• problem with original treemap: lots of long stripes
• for long stripes the areas are difficult to compare
SQUARIFIED TREEMAP
• calculates more squared regions
• problem: order not as easily read, not very stable with
dynamically changing data
ORDERED TREEMAP
several algorithms in comparison
Readability scores: 1.0, 0.625, 0.375, 0.125 (1 = no angular change, 0=every jump
between sequential nodes requires an abrupt angular change
OTHER
VARIATIONS OF
TREEMAPS
steptree: cascaded layout:
original squarified: emphasizes structure with overlap
emphasizes leafs and their attributes emphasizes structure with extrusion
ConeTree CamTree
[Robertson et al., 1991] George Robertson, Jock D. Mackinlay, Stuart Card. Cone Trees: Animated 3D
Visualizations of Hierarchical Information. In Proceedings of the ACM CHI 91
CONE/CAMTREE
• children of a node are
laid out in a cylinder
“below” the parent
• siblings located on the
same 2D circle
• use of animation
• shadows to enhance
structure
BOTANICAL VISUALIZATION
OF HUGE HIERARCHIES
InfoVis 2001
3D LAYOUTS
• advantages
– fit more data into same aspect ratio
– aesthetically pleasing (aka can look very sexy)
• disadvantages
– occlusion
– requires interaction or animation
– no overviews
TREE VISUALIZATION SUMMARY
• there are lots of tree visualizations
– there is also lots of free software, try it out, (see links earlier in the
lecture plus e.g.):
• http://www.informatik.uni-rostock.de/~hs162/optreedemo/TestBed.htm#
• http://w3.win.tue.nl/nl/onderzoek/onderzoek_informatica/visualization/s
equoiaview/
– there are a few overview articles, e.g.:
• A Generative Layout Approach for Rooted Tree Drawings by Hans-Jörg
Schulz, Zabed Akbar, and Frank Maurer - at IEEE PacificVis 2013
• The Design Space of Implicit Hierarchy Visualization: A Survey by Hans-
Jörg Schulz, Steffen Hadlak, and Heidrun Schumann - in IEEE TVCG 17(4)
TREE VISUALIZATIONS
• can be categorized by
– edge representations (implicit, explicit)
– dimensionality of layout
– radial vs. axis-parallel
• can be modified by
– layout parameters
– which marks are used
– visual variables on marks (which meta-data is represented?)
GRAPHS / NETWORKS
DEFINITION GRAPH
• A set of vertices V = {vi}
• A set of edges E = {eij} with eij = {vi ,vj}
• When the order of vertices of an edge is
meaningful, the graph is directed
GRAPH MEASURES
• SIZE = #nodes
• DENSITY = edges/vertices (roughly)
• PATH = sequence of edges connecting
(different) vertices
• VERTEX DEGREE = #edge connections
• DISTANCE = #hops between vertices
TWO CLASSICAL VISUAL
REPRESENTATIONS
Node-Link Diagram
Adjacency Matrix
TASKS
Find # of neighbors of a vertex (e.g. source vs.
sink)
http://mathworld.wolfram.com/DigraphSink.html
http://mathworld.wolfram.com/Source.html
TASKS
See paths (overviews, shortest, cycles)
http://mathworld.wolfram.com/GraphGeodesic.html
TASKS
Identify Sub-graphs
http://mathworld.wolfram.com/Vertex-InducedSubgraph.html
TASKS
HIGHER-LEVEL
• Physical forces
• Proximity based
• Spring Model
• Kamanda&Kawai
• Frucherman&Reingold
• Davidson&Harel
• LinLog
LAYOUT FREE
Aesthetic Criteria
http://gephi.forumatic.com/viewtopic.php?f=26&t=2616
LAYOUT LINEAR
http://mbostock.github.io/protovis/ex/arc-full.html
http://www.bewitched.com/song.html
LAYOUT LINEAR
https://www.openbible.info/labs
/cross-references/
LAYOUT ADJACENCY MATRIX
ADJACENCY MATRIX
LAYOUT ADJACENCY MATRIX
Communicate Explore
PROS/CONS
Matrix Node-Link
• No vertex/edge overlap or • Familiar
crossings • Compact
• Readable for dense graph • Path following easier
• Effective for small and sparse
• Fast navigation graphs