12 Relations

Jacobs University Visualization and Computer Graphics Lab Recall

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 470 Recall

• Data samples may have – unilateral relations, –bilateral relations, or – hierarchical relations.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 471 12.1 Representing Relations

Jacobs University Visualization and Computer Graphics Lab Representing relations

• Hierarchical relation: • Unilateral relation: Directed graph • Bilateral relation: Undirected graph

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 473 Representing trees

• Traversing a (rooted) tree requires us to know about the hierarchical relationships of their nodes. • Relationships can be stored by using pointers.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 474 Binary trees

• Binary trees T have an attribute T.root. •They consist of nodes x with attributes x.parent (short x.p), x.left, and x.right (in addition to x.key).

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 475 d-ary trees

• d-ary trees are rooted trees with at most d children per node. • They can be handled analogously to binary trees.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 476 Rooted trees with arbitrary branching • Rooted trees T with arbitrary branching consist of nodes x with attributes x.p, x.leftmost-child, and x.right-sibling (in addition to x.key).

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 477 Directed Graph

Definition: • A directed graph (digraph) G=(V,E) is an ordered pair consisting of – a set V of vertices and –a set E c VxV of edges. • In an undirected graph G=(V,E), the edge set E consists of unordered pairs of vertices.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 478 Number of edges

• In a graph, the number of edges is bound by |E| = O(|V|2). • If G is connected, then |E| ≥ |V| - 1. • Hence, for a connected graph we get lg |E| = Θ (lg |V|).

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 479 Definition: • The adjacency matrix of a graph G=(V,E) with V={1,…,n} is the nxn matrix A given by

Dense representation: Storage requirements are Θ(|V|2). Example:

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 480 Adjacency list

Definition: • An adjacency list of a vertex v є V is the list Adj[v] of vertices adjacent to v. Example:

Sparse representation: • Storage requirements for Adj[v] is Θ(|outgoing edges from v|). • Storage requirement for Adj[v] for all v є V is Θ(|E|). • Overall storage requirement is Θ(|V|+|E|).

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 481 Examples for undirected & directed graph

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 482 Application example: Neighboring states

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 483 12.2 Graph Analysis

Jacobs University Visualization and Computer Graphics Lab Graph topology

• Graphs may exhibit different topological structures. • Based on their topological properties, one can distinguish different types of graphs (or networks).

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 485 Fully connected graph

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 486 Random network Number of nodes

Degree

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 487 Small-world network

A small-world network is defined to be a network where the typical distance between two randomly chosen nodes grows proportionally to the logarithm of the number of nodes in the network.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 488 Scale-free network

A scale-free network is a network whose follows (asymptotically) a power law.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 489 Hierarchical network

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 490 Modular network

A modular network is one that consists of highly connected subgraphs that are connected with a few edges.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 491 Real-world networks

• We can observe that real-world networks also exhibit similar structures.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 492 Real-world examples

Neural Network (C. Elegans) Jacobs University Visualization and Computer Graphics Lab

Data Analytics 493 Real-world examples

Food Web Jacobs University Visualization and Computer Graphics Lab

Data Analytics 494 Real-world examples

Metabolic Network Jacobs University Visualization and Computer Graphics Lab

Data Analytics 495 Real-world examples

Genetic Regulatory Network Jacobs University Visualization and Computer Graphics Lab

Data Analytics 496 Real-world examples

Bank Network Jacobs University Visualization and Computer Graphics Lab

Data Analytics 497 Real-world examples

Airline Routes Jacobs University Visualization and Computer Graphics Lab

Data Analytics 498 Real-world examples

US Power Grid Jacobs University Visualization and Computer Graphics Lab

Data Analytics 499 Real-world examples

Internet Jacobs University Visualization and Computer Graphics Lab

Data Analytics 500 Real-world examples

Social Network

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 501 Real-world examples

World Wide Web (small part) Jacobs University Visualization and Computer Graphics Lab

Data Analytics 502 Real-world examples

part of WWW Number of nodes Number of nodes

Degree Degree Jacobs University Visualization and Computer Graphics Lab

Data Analytics 503 Topological features

• We observe that the different topological properties lead to certain topological features.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 504 Hubs

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 505 Modules

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 506 Motifs

Motifs are local network properties, which are defined as recurrent and statistically significant sub- graphs or patterns.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 507 Network metrics

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 508 12.4 Graph Visualization

Jacobs University Visualization and Computer Graphics Lab Graphs

•Goal: – Visualize unilateral or bilateral relations. • Approach: – Use a graph layout consisting of nodes and links. • Spatial constraints: –None. • Design optimizations: – Penalize node cluttering. – Penalize edge crossing. – Penalize long edges. – Optimize screen space usage.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 510 Example • visualization:

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 511 Force-directed layouts • The most commonly used layout algorithm for graph layouts are force-directed layouts. • They iteratively try to minimize a given energy function. • Any design goal can be embedded into the energy function. • Typically, connected nodes attract each other up to a certain distance and too close nodes repel each other. • The approach is easy to implement. • However, special care needs to be taken for the algorithm to converge. • The solution highly depends on the start configuration. • The solution typically represents a local minimum of the energy function Jacobs University Visualization and Computer Graphics Lab

Data Analytics 512 Force-directed layouts

•Example: Eades – Use Hooke‘s law:

F = D(x – x0)

where is x0 the equilibrium. – Compute attracting forces for connected nodes (edge-based) – Compute repelling forces for all nodes (node-based) – Accumulate forces for each node, then apply accumulated forces to all nodes to compute new positions. – Iterate

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 513 Force-directed layouts

•Result:

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 514 Adjacency matrices

• For many relations, a graph visualization may get cluttered (even when using a suitable layout algorithm). • An alternative is to visualize unilateral or bilateral relationships using adjacency matrices.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 515 Adjacency matrices

• Adjacency matrices draw all nodes in a given order on a horizontal and a vertical axes. • This describes a 2D matrix. • The respective pixel in the 2D matrix is filled, if there is a link between the respective nodes.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 516 Graph vs. adjacency matrices

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 517 Graph vs. adjacency matrices

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 518 Order of utmost importance

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 519 Hybrid visualization

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 520 12.5 Visual Encoding of Hierarchies

Jacobs University Visualization and Computer Graphics Lab Hierarchical data

• Hierarchical data refers to any data that can be stored in the data structure of a tree. • No further assumptions are made. • Frequently, a number of attributes are associated with each data sample. • Hence, we have a set of data samples given in form of – an n-tuple (typically order is arbitrary), where each entry is associated with an attribute, and – a hierarchical structure of the samples. •Examples: – file system – biological systems: phylogenetic tree – this lecture’s structure

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 522 Phylogenetic tree

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 523 Phylogenetic tree

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 524 Phylogenetic tree

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 525 File system explorer

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 526 Nodelinks

• The most commonly used visualization of trees is based on – a set of nodes representing the entities of the trees and – a set of links that connect the nodes to represent parent- child relationships. • No further constraints exist. • For displaying the nodes and links, one typically draws balls and sticks, respectively. • This is why it is also referred to as a ball-stick visualization.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 527 Visual encoding

• The visual encoding is done by a tree layout algorithm with the goal to intuitively display the hierarchical relationships. • Intuitiveness, of course, includes that – crossings of links are to be avoided, – nodes do not clutter, and – links do not get too large. • Another layout goal is that the available screen space should be used most efficiently.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 528 Top-down layout • The top-down layout uses a number d of (typically equally spaced) horizontal layers, where d is the depth of the tree. • Each node is placed on the horizontal layer that corresponds to its depth. root

inner node top-down

levels

leaf node Jacobs University Visualization and Computer Graphics Lab

Data Analytics 529 Top-down layout

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 530 Top-down layout

• Trees tend to grow big towards their deeper levels. • Used screen space:

screen space

used space

empty space

• About half of the screen space is empty for larger trees.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 531 Radial layout

• A radial layout trees to use the available screen space more efficiently by – placing the root node at the center of the screen space and – placing all other nodes at concentric circles around the root node, where the distance represents the depth of the node. • Again, one uses different layers, but they are laid out – radially instead of horizontally and – with an inside-out instead of a top-down order.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 532 Radial layout

inner node

root inside-out leaf node

levels

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 533 Radial layout

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 534 Top-down vs. radial layout

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 535 Hyperbolic tree •Assumption: – Nodes with lower depth are more important than nodes with higher depth. •Idea: – Assign more space to nodes with lower depth. • Approach: –Use a hyperbolic curve to map the distance to the root to the assigned screen space: assigned screen space

distance to root

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 536 Hyperbolic tree

space for labels levels with hyperbolic instead of equal spacing

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 537 Hyperbolic tree

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 538 Cone tree •Idea: – Use a 3D layout that combines top-down and radial layout. – The 3D shape is that of a cone.

• Problems: – Occlusion – Interaction (i.e., viewing transformations) necessary to understand full structure

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 539 Cone tree

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 540 Bubble tree

• Another layout that uses circular node placement is the bubble tree. • The root is still placed in the center. • However, all other nodes are not placed on a circle around the root, but on a circle around the parent node. • The nodes form rings around the parent nodes. • This is a useful layout when nodes have many children.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 541 Radial layout vs. bubble tree

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 542 Cone tree with bubble layout

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 543 Additional attributes

• Additional attributes of data samples can be mapped to draw balls in the form described in the previous section. •Caveat: – Don’t overload the visualization.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 544 Additional attributes

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 545 Sunburst

• Nodelinks use the entire screen space to draw the hierarchical relationships. • The space for showing the attributes of the nodes is, therefore, very limited. • Now, we would like to use the available screen space to depict the values of the attributes. • The hierarchy should be implicitly given by the position.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 546 Sunburst

• Assign screen space according to the value of a specific numerical attribute. •Example: – hierarchy: file system – attribute: file size – bottom-up layout

root inner node leaf node

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 547 Sunburst • To better use the available screen space, the sunburst approach uses a radial layout. • Each level is represented by a ring. • Within each ring, the available 360° are subdivided according to the attribute’s value.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 548 Sunburst

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 549 Treemaps

• Treemaps have the same goal as the sunburst approach. • However, treemaps want to further reduce the amount of space used for the hierarchy relationships. • Observation: – Only the leaf nodes in the sunburst visualization actually contained attribute values. – The attribute values of the root and the inner nodes were implicitly given by the sum of the values of their children nodes.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 550 Treemap idea

• Represent hierarchical information by containment.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 551 Containment

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 552 Nodelink vs. treemap

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 553 Treemap layout

• There are different approaches on how to build the treemap layout. • The size of the cells are always proportional to the value of the main attribute of the nodes. • Most of the layout algorithms generate rectangles. • The organization of the cells use the containment approach to represent the hierarchy. • The order and shape of the cells represent degrees of freedom that are used in different layout algorithms.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 554 Slice & dice

• Traverse tree structure top-down. • At each level, split available screen space according to size of subtree represented by the nodes of that level. • Subtree size is defined by the sum of the sizes of all leaf nodes. • Splitting is done by horizontal and vertical lines. • Alternate between horizontal and vertical lines at each level. • This treemap layout approach is called slice & dice.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 555 Slice & dice

•Example:

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 556 Slice & dice

•Result:

• Color may indicate another attribute (not the one used in the slice & dice layout).

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 557 Treemap results • Treemaps are great at representing sizes and using screen space, but hierarchical structure is less obvious. •Examples: – Treemaps of file system & organizational structure.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 558 Border width

• The borders’ widths may indicate the hierarchy level:

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 559 Frames • Frames may be used to make the hierarchy more explicit:

• Frames take away screen space (especially for many levels).

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 560 Cushion treemaps

•Idea: – Use shading of triangles to perceive the hierarchical structure. •Advantages: – It does not require additional screen space. – The shading only affects the brightness, one can still assign different hues to the cells.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 561 Cushion treemaps

• When subdividing the screen space in one of the two dimensions, add bumps to the subinterals. • This bump mapping step is performed iteratively while the bumps added at each level accumulate. • From one level to the subsequent, the size of the bump is halved. • The bumps are represented by parabolae. • The result of accumulated bumps form a sequence of ridges.

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 562 Cushion treemaps

• 1D example of bump accumulation using 3 levels:

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 563 Cushion treemaps

•Result:

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 564 Cushion treemaps

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 565 Cushion treemaps

• Cushions with different hues:

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 566 Cushion treemaps & frames

• Cushion treemaps and frames can be combined by assigning an own profile to the frames:

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 567 Other shapes: Voronoi treemaps • Varying boundary widths (brightness indicates level):

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 568 Voronoi treemaps

• Voronoi treemaps can be generated over any screen space:

Jacobs University Visualization and Computer Graphics Lab

Data Analytics 569 12.6 Assignment

Jacobs University Visualization and Computer Graphics Lab