610 likes | 771 Views
Graph Visualisation. Kai Xu Middlesex University, UK. Outline. Introduction Trees and Hierarchies General Graphs Beyond this talk. Outline. Introduction Trees and Hierarchies General Graphs Beyond this talk. Graphs. Graph Visualisation. Applied. Vision, Perception, and Psychology.
E N D
Graph Visualisation Kai Xu Middlesex University, UK
Outline • Introduction • Trees and Hierarchies • General Graphs • Beyond this talk
Outline • Introduction • Trees and Hierarchies • General Graphs • Beyond this talk
Graph Visualisation Applied Vision, Perception, and Psychology • Many related fields. • Not possible to include everything. • Try to cover the basics. • Assume you know nothing about graph visualisation. • What's touched: • Visual Representation (trees). • Layout algorithms (general graphs). • Evaluation • Applications and libraries. • What's not covered: a lot Human Computer Interaction Sociology Information Visualisation Theoretical Graph Drawing Algorithms
Visualisation and Cognition • Information visualisation: all about external cognition. • Working memory capacity: 7 +/- 2. • Can’t really “think” without cognitive tools: writing, math symbols, diagrams, interactive visualisation, etc. • Brain and cognitive tools have to work together. • Computer is good at addition, very good at it, but that's about it. • Human brain is a very good pattern recogniser. • Visualisation matters only if user cares. • All visualisation methods should be evaluated with users.
Outline • Introduction • Trees and Hierarchies • General Graphs • Beyond this talk
Terminology • What's a “tree”? • A (connected) undirected graph without cycles. • What's a “hierarchy”? • A (connected) directed graph without cycles. • Very important in Information Visualisation • Very common in the real world. • Simpler (less edges) than general graphs.
Indented Layout Places all items along vertically spaced rows Uses indentation to show parent child relationships Example: Windows explorer Problems: Only showing part of the tree Bad aspect ratio (not space efficient) Most Famous Tree Visualisation Is?
Layered Layout Radial drawing
Essentially a layered drawing Orthogonal edges Layering are done according to the leaves: All the leaves are on the same layer Commonly used in bioinformatics to represent The result of hierarchical clustering Phylogenetic trees Dendrogram
A variation of radial layout Children are drawn in a circle centered at their parents. Effective on showing the tree structure At the cost of node details Balloon Trees
Simulate the distortion effect of fisheye lens. Enlarge the focus and shrink the rest. Focus+context. Can be combined with different layout. 3D hyperbolic tree: Similar to project a graph onto a sphere. This example uses balloon tree drawing. Hyperbolic Tree
Cone trees are a 3D extension of the 2D layered tree drawing method. Parent at the tip of a cone, and its children spaced equally on the bottom circle of the cone Either horizontal or vertical The extension to 3D does not necessarily means more information can be displayed Occlusion problem Couple with interaction is essential 3D Tree Visualization - Cone Tree
3D poly-plane tree visualization Put subtrees on planes. Arrange these planes in 3D to reduce occlusion. In this example, layered drawing is used within each plane. 3D layered tree Only one cone. Layers are the parallel circles on the surface. Example: color indicate the layer. Other 3D Tree Visualizations
Treemap uses containment to show the hierarchy. It partitions the space recursively according to the size of subtrees It is space-efficient compare to node-link diagram It is effective in showing the leaf nodes; But difficult to see the non-leave nodes Space-Filling Methods - Treemap
Cushion treemap Use shading to help identify the levels in a treemap Voronoitreemap Similar idea but uses voronoi diagram as partition The space does not have to be rectangle. Variations of Treemap
A variation of treemap in 3D. Using overlap instead of nesting to show the hierarchy 3D version: representing each node as a beam A bigger example Beamtree
Try to use as much screen space as possible. Layout a tree according to the recursive partition of the screen space. The area allocated to a subtree is proportional to its size. A bigger example: 55000 nodes. Use all the screen space. Not the most effective on showing tree structure. Space-Filling Tree Layout
Edges implied by adjacency and spatial relationship. A bigger example (from infovis toolkit) Icicle Trees
Information slice Also a space-filling method. Radial version of icicle trees. Node size is proportional to the angle swept by a node. Sunburst Information Slice combines with focus+context. Details are shown outside or inside the ring. Information Slice and Sunburst Diagrams
Hybrid of node-link diagrams and Treemaps. Example: Treemap nested within a node-link diagram. Not the other way around. Node-link diagram inside a treemap Lots of crossings Elastic Hierarchies
Visualizes trees in a form that closely resembles botanical trees The root is the tree stem Non-leave nodes are branches Leave nodes are “bulbs” at the end of branches Example: Unix home directory. TreeViewer
Telescope metaphor A set of nested cylinders All cylinders of level 1 nodes are shown in a horizontal fashion, Like being put on a stick. A cylinder is constructed for the children of a node, and has a smaller radius. This cylinder is nested and hidden within the cylinder contain the parent It can be pulled out or collapsed as necessary. Collapsible Cylindrical Trees
Tree Representation Evaluation • “User Experiments with Tree Visualization Systems”, InfoVis 2004 • Compared 6 tree visualisation systems: • TreeMap • Cushion TreeMap • BeamTrees • Hyperbolic tree • TreeViewer • Windows Explorer (base-line) • Data: eBay taxonomy • 5 levels and 5799 nodes. • Shallow and wide. • 15 tasks: • About tree structure and node attributes • Measurements: • Accuracy • Completion time • User satisfaction • Result: • Windows Explorer scores best • Only TreeMap achieves the similar level as Explorer, others perform worse. • Possible causes: • No tight integration with other tools. • Missing functionality.
Tree Representation Evaluation “Qualities of Perceived Aesthetic in Data Visualization”, CHI 2007
Outline • Introduction • Trees and Hierarchies • General Graphs • Beyond this talk
Aesthetics are the graphic properties layout algorithms try to optimise. Crossings Aspect ratio Edge length (several variations) Angular resolution Symmetry Graph Drawing Aesthetics
Which Aesthetic is the most important? • The relative importance among aesthetics • Including 5 aesthetics: • minimizing edge crossings, • minimizing bends, • symmetry. • minimum angle • orthogonality • Purchase, H.C (1997) • Dataset • Planar graphs with 16 nodes and 28 edges • 5 aesthetics and 10 drawings • 2 drawings for each aesthetics: representing a strong or weak presence. • b: bends, c: crossings, m: minimal angle, o: orthogonality, s: symmetry
Which Aesthetic is the most important? • Tasks • Shortest path: between two nodes; • Connections between nodes: number of nodes to disconnect two nodes; • Connections between subgraphs: number of nodes to disconnect two subgraphs. • Results • Most important: reducing the number of crossing; • Less effective: minimizing the number of bends and maximizing symmetry; • Not obvious: maximizing the minimum angle and orthogonality.
Sugiyama method Cycle removal: if there is directed cycles, temporarily reverses the direction of some to make the graph acyclic; Layer assignment: nodes are assigned to horizontal layers, and thus determines their y-coordinate; Crossing reduction: within each layer the nodes are ordered to reduce the number of crossings; Horizontal coordinate assignment: the x-coordinates of each vertex is determined. Directed Graph – Layered Layout
Undirected Graphs – Force Directed Methods • Use a physical analogy to draw graphs • A graph as a system of objects with forces acting between them. • Vertex • Object of the system; • Interacting with each other based on “some” force(s). • Edge • A different type of object; • Not interacting with each other; • Add new force(s) to vertex object. • Assumption: • A balanced system gives a good layout • Equilibrium state: • A system configuration with minimal energy level: • Locally, the sum of the forces on each object is zero. • Globally, the system has a minimal total energy. • Many force-directed methods. • Model: a force system defined by vertices and edges • Algorithm: technique for finding an equilibrium state
Spring Embedder • Vertex: • Electrically charged particles; repel each other. • Ensure vertices not too close to each other • Edge: • Spring that connects particles; • Attraction force when longer than the natural length; repulsion force otherwise. • Ensure connected vertex distance is about the natural spring length. 2. 1.
Springs and Electrical Forces • The force on a vertex v : • fu,v : force on v by the spring between u an v • gu,v: Electrical repulsion exerted on v by vertex u • xcomponent of the force on v • d(p,q) : Euclidean distance between points p and q • (xv, yv): position of vertex v • l0: natural length (zero energy) of the spring between u and v. • k1: stiffness of the spring between u and v • k2 : the strength of the electrical repulsion between u and v
Finding an Equilibrium State • Initially place nodes at random location. • At each iteration: • Force F(v) on each vertex is computed • Each vertex v is moved in the direction of F(v) by a small amount proportional to the magnitude of F(v) • Stops when equilibrium is achieved or some conditions are met. • Not the fastest, but allow smooth animation. • Calculating attractive forces only between neighbors: O(|E|) • Calculating repulsive forces between all pair of vertices: O(|V|2) • Bottleneck of the algorithm in general.
Clustered Graph Graph Faster Force Directed method - FADE • It is feasible to use • a spring method, then • a geometric clustering method • To obtain a good graph clustering.
Quadtree • A tree data structure: • Each internal node has exactly four children. • Often used to partition a two dimensional space. • By recursively subdividing into four quadrants.
c BR TL a b d BL e f Barnes-Hutt Method • Computing forces between stars. • Use Quadtree to cluster the stars. • Use forces between clusters to approximate forces between individual stars. root a b d c e f
s c BR TL a b d BL s e f Barnes-Hutt method • The contents of a subtree of can be approximated by a mass at the centroid. root a b d c e f
c s BR TL a b d BL s e f Barnes-Hutt method • The force that the subtree s exerts on the star x can approximate the sum of the forces that the nodes in s exert on x. root a b d c e f
Layout vs. Graph Readability • Comparing different layout methods. • A planar graph of 17 nodes and 29 edges . • maximum node degree is 4: • For orthogonal drawing ; • A quite strong constraint. • 3 layout algorithms: • Force-directed: 3 variations; • Planar orthogonal grid drawing: 2 variation; • Planar grid drawing: 3 variations. • Purchase, H.C. (1998)
Layout vs. Graph Readability • Tasks: • Shortest path between two nodes; • Disconnect two nodes; • Disconnect two subgraphs. • Results: • One planar grid drawing method (SEIS) produced significantly more errors than the rest; • For the rest, the average response times were not significantly different. • So there is not much difference between layout algorithms!
Comparing various visualisations in 2D and 3D 2D: orthographic (parallel) projection Static Perspective: perspective projection Stereo: shutter glasses Passive rotation: automatic Hand coupled rotation: mouse-controlled; Head coupled perspective: head-controlled; “Stereo, head coupled perspective” setup Does 3D Help? • Stereo, head coupled perspective.
Task: whether two nodes are connected by a path of length 2. Dataset: randomly laid out graph. Ware, C., Franck, G. (1996) Test Setup
Results: • A static perspective is only slightly better than a 2D diagram; • 3D motion and stereo viewing both help but not particularly important; • Both are more significant than stereo cues. • Stereo viewing alone increases the understandable graph size by a factor of 1.6; • Head coupling alone increases by a factor of 2.2; • Combine the two (head-coupled stereo viewing) increases by a factor of 3;
Matrix Representation A graph can be represented by a connectivity matrix. Advantage: No edge crossing. Disadvantage: Large empty space for sparse graph. Ghoniem, M. et al. (2004) Beyond Node-Link Diagram
Node-Link Diagram vs. Matrix • Tasks: • estimating the number of nodes; • estimating the number of links; • finding the most connected node; • finding a node with a given label; • finding a link between two specified nodes; • finding a common neighbor between two specified nodes; • finding a path between two nodes. • Dataset • Random graph of size: 20, 50, and 100 nodes; • For each size, different link density: 0.2, 0.4 and 0.6.
Results • When graphs are bigger than 20 vertices, matrix outperforms node-link diagrams on most tasks. • Only path finding is consistently in favor of node-link diagrams. • For small graphs: • Node-link diagrams are always more readable than matrices; • For larger graphs: • Matrices are 30% more accurate; • Matrices have comparable or better answer time. • For more complex tasks such as “path finding”, interaction is needed: • For example, displaying all the possible paths after selecting two nodes; • For matrix, path can be displayed by connecting cells using curves (mix matrix with node-link diagram).