introduction to graph drawing

28
INTRODUCTION TO GRAPH DRAWING Fall 2010 Battista, G. D., Eades, P., Tamassia, R., and Tollis, I. G. 1998 Graph Drawing: Algorithms for the Visualization of Graphs . 1st. Prentice Hall PTR.

Upload: marvel

Post on 05-Jan-2016

58 views

Category:

Documents


2 download

DESCRIPTION

Introduction to Graph drawing. Fall 2010 Battista, G. D., Eades , P., Tamassia , R., and Tollis , I. G. 1998 Graph Drawing: Algorithms for the Visualization of Graphs . 1st. Prentice Hall PTR. Constraints. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Introduction to  Graph drawing

INTRODUCTION TO GRAPH DRAWING

Fall 2010

Battista, G. D., Eades, P., Tamassia, R., and Tollis, I. G. 1998 Graph Drawing: Algorithms for the Visualization of Graphs. 1st. Prentice Hall PTR.

Page 2: Introduction to  Graph drawing

CONSTRAINTS Henry, T.S, and Hudson, S.E. : Interactive Graph Layout. University of Arizona, Tucson, AZ, USA. UMI Order No. GAX92-25193.,1992.

Dwyer, T. and Robertson, G. Layout with Circular and Other Non-linear Constraints Using Procrustes Projection. Microsoft Research, Redmond, USA. Graph Drawing , Volume 5849/2010.

Page 3: Introduction to  Graph drawing

WHY USING CONSTRAINTS?

Maximize display symmetry

Avoid edge crossings

Avoid edge bending

Keep edge length uniform

Distribute vertices uniformly

Page 4: Introduction to  Graph drawing

CONSTRAINTS THAT ARE USUALLY USED

Center Place a given vertex to the center of the

drawing External

Place a given subset of vertices on the outer boundary of the drawing

Cluster Place a given subset of vertices close together

Left-right (top-bottom) Draw a given path horizontally from left to

right (vertically from top to bottom) Shape

Draw a given subgraph with a predefined shape

Page 5: Introduction to  Graph drawing

CONSTRAINTS THAT CAN BE HANDLED BY FD-METHODS

Position constraints

Fixed-subgraph constraints

Constraints that can be expressed by forces

or energy functions

http://www.ul.ie/gd2005/contest.htm

Page 6: Introduction to  Graph drawing

POSITION CONSTRAINTS

A single point A vertex can be nail down at a specific

location

A horizontal line A group of vertices can be arranged on

a layer

A circle A group of vertices can be restricted to

a specific region

Vertical and horizontal magnetic field

Radial magnetic field

Page 7: Introduction to  Graph drawing

FIXED-SUBGRAPH CONSTRAINTS

Assign prescribed drawing to a subgraph .

May be translated or rotated, but not deformed.

Considering the subgraph as a rigid body.

Page 8: Introduction to  Graph drawing

Constraints expressed by forces Orientation of directed edges: magnetic spring Geometric clustering of special set of vertices Alignment of vertices

Clustering can be achieved For each set C of vertices, add a dummy attractor

vertex vC Add attractive forces between an attractor vC and

each vertex in C. Add repulsive forces between pairs of attractors

and between attractors and vertices not in any cluster.

Page 9: Introduction to  Graph drawing

WHAT TO CONSIDER

The best layout depends on what information

the user currently focused on.

 Overall layout or substructures

 User control the layout process

Large graphs

One possible solution is to build lots of graphs

each of which focuses on a few substructures

that the user thinks are important

Page 10: Introduction to  Graph drawing

CONCEPTS OF BUILDING INTERACTIVE GRAPH LAYOUT

An architecture for building a new simple

graph layout algorithms from existing

algorithms.

Parameterize graph layout algorithms to give

the user control over the layout process

A high interactive mechanism for selecting

portions of the graph that match the user’s

current focus.Henry, T.S, and Hudson, S.E. : Interactive Graph Layout. University of Arizona, Tucson, AZ, USA. UMI Order No. GAX92-25193.,1992.

Page 11: Introduction to  Graph drawing

COMPOSING GRAPH LAYOUT ALGORITHMS HIERARCHICALLY

Allows users to create simple new layout algorithms by plugging together existing layout algorithms.

Following the divide-and-conquer algorithm, subdivide graph into subgraphs.

Each subgraph laid out separately using the same algorithm.

Individual layouts paste together to create total graph layout.

Page 12: Introduction to  Graph drawing

Placing the nodes on the perimeter of a circle

Both should be available to user Freedom to alternate between them Power to create new layouts

Eight nodes connected graph

1

43

2

Page 13: Introduction to  Graph drawing

Emphasizes the two shortest paths between start and destination

Row algorithm Connections between the paths and the rest

of the graph. Concentric rings

Page 14: Introduction to  Graph drawing

PARAMETERIZED LAYOUT ALGORITHM Changing the root node can change the graph and

focus of the layout to reflect the user's interest Different views of the same graph with different

parameterization of the same algorithm

Page 15: Introduction to  Graph drawing

Which set of nodes will produce the best subgraph? It should be easy and fast to iteratively try different

parameterization sets. Users can discover new aspects while exploring

different parameterizations. What if user can combine the last two mechanisms?

User can customize portions of the graph by changing the parameters to the algorithm for that portion.

Page 16: Introduction to  Graph drawing

SUBGRAPH SELECTION

Selecting pieces that are small enough to look and focus

Apply a layout algorithm to each subgraph Creating different views of graph until it

meets the users needs The process should be easy or it will interfere

with the exploration

Page 17: Introduction to  Graph drawing

TYPES OF SELECTION

Manual selection Select nodes in the graph by pointing at them

with mouse, or group them with drawing rectangle around them.

For few number of nodes, or nodes that are positioned close to each other.

Algorithmic selection Traverse the graph marking nodes as being

selected For nodes that may not be visible, or are spread

through the graph.

Page 18: Introduction to  Graph drawing

Nodes root and destination manually selected . Applying shortest path selection algorithm, which

is parameterized with two nodes, selects all the nodes on the shortest path between them.

The selected nodes have been laid out by the row layout algorithm highlighting the shortest path.

Page 19: Introduction to  Graph drawing

DOWNWARD-POINTING EDGE CONSTRAINTS

Dwyer, T., Koren, Y., Marriott, K.: IPSep-CoLa: an incremental procedure for separation constraint layout of graphs. IEEE Transactions on Visualization and Computer Graphics 12(5), 821–828 (2006)

Page 20: Introduction to  Graph drawing

PAGE-BOUNDARY CONSTRAINTS

Dwyer, T., Koren, Y., Marriott, K.: IPSep-CoLa: an incremental procedure for separation constraint layout of graphs. IEEE Transactions on Visualization and Computer Graphics 12(5), 821–828 (2006)

Page 21: Introduction to  Graph drawing

NON-OVERLAP CONSTRAINTS

Dwyer, T., Koren, Y., Marriott, K.: IPSep-CoLa: an incremental procedure for separation constraint layout of graphs. IEEE Transactions on Visualization and Computer Graphics 12(5), 821–828 (2006)

Page 22: Introduction to  Graph drawing

ALIGNMENT CONSTRAINTS

Dwyer, T., Koren, Y., Marriott, K.: IPSep-CoLa: an incremental procedure for separation constraint layout of graphs. IEEE Transactions on Visualization and Computer Graphics 12(5), 821–828 (2006)

Page 23: Introduction to  Graph drawing

CONSTRAINT PROJECTION TECHNIQUES

Projecting the variables: x=(x1,…,xn) with starting

positions d=(d1,…,dn) against a set of constraints that

define a feasible region S means finding the point x in

S closest to d:

n

iii

Sx

dx1

2)(minarg

Page 24: Introduction to  Graph drawing

(x1,y1) (x2,y2)

(x3,y3)

w1

w2

h2

h3

SEPARATION CONSTRAINT PROJECTION

Separation constraints: x1+d ≤ x2 , y1+d ≤ y2

can be used with force-directed layoutto impose certain spacing requirements

x1+ ≤ x2(w1+w2)

2

y3+ ≤ y2(h2+h3)

2

Dwyer, T. and Robertson, G. Layout with Circular and Other Non-linear Constraints Using Procrustes Projection. Microsoft Research, Redmond, USA. Graph Drawing , Volume 5849/2010.

Page 25: Introduction to  Graph drawing

PROCRUSTES PROJECTION

X be set of 2D points, and Y is a set of projections of X

Y has a rigid shape but can be scaled by the factor s, translated be a factor t or rotated by an orthogonal matrix T

Such that

2

1

( ( ))n

i ii

X sYT t

(1)

Page 26: Introduction to  Graph drawing

By differentiating with respect to t:

Substituting (2) for t in (1),

Substituting (2) and (3) in (1): T is invariant to s or t.

1

1( )

n

i ii

t X sYTn

(2)

YtrY

YTtrXs

'

' (3)

What is tr Y’Y?

Page 27: Introduction to  Graph drawing

WHAT IS T?

It can be shown that: T=QP’, where svd(X’Y)=PΦQ’ is the optimal

rotation

32

21A

Lets say we have

The singular value decomposition of A, or:

5257.08507.0

8507.05257.0,

2361.00

02361.4,

5257.08507.0

8507.05257.0

')(

QP

QPAsvd

Page 28: Introduction to  Graph drawing

PROJECT X ON Y

Input: matrix X of n pints, a matrix Y of n points the target configuration (centered on the origin),

Output: the projection of X on the optimally transformed Y