+ All Categories
Home > Documents > A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen...

A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen...

Date post: 19-Dec-2015
Category:
View: 219 times
Download: 2 times
Share this document with a friend
22
A New Force-Directed Graph A New Force-Directed Graph Drawing Method Based on Drawing Method Based on Edge-Edge Repulsion Edge-Edge Repulsion Chun-Cheng Lin Chun-Cheng Lin and Hsu-Chen Yen and Hsu-Chen Yen Department of Electrical Engineeri Department of Electrical Engineeri ng, National Taiwan University ng, National Taiwan University , , Taiwan, R.O.C. Taiwan, R.O.C.
Transcript
Page 1: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

A New Force-Directed Graph A New Force-Directed Graph Drawing Method Based on Edge-Drawing Method Based on Edge-

Edge RepulsionEdge Repulsion

Chun-Cheng LinChun-Cheng Lin and Hsu-Chen Yen and Hsu-Chen Yen

Department of Electrical Engineering, NationaDepartment of Electrical Engineering, National Taiwan Universityl Taiwan University, Taiwan, R.O.C., Taiwan, R.O.C.

Page 2: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

OutlineOutline

Introduction and motivationsIntroduction and motivations

Model of edge-edge repulsionModel of edge-edge repulsion

Implementation and experimental resultsImplementation and experimental results

ConclusionConclusion

Page 3: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

Force-directed graph drawing methodForce-directed graph drawing method

An An energy modelenergy model is associated with the is associated with the graphgraph

Low energy statesLow energy states correspond to correspond to nicenice layouts layouts

Hence, the drawing algorithm is an Hence, the drawing algorithm is an optimization processoptimization process

Initial (random) layoutFinal (nice) layoutIteration 1:Iteration 2:Iteration 3:Iteration 4:Iteration 5:Iteration 6:Iteration 7:Iteration 8:Iteration 9:Aesthetical propertiesAesthetical properties

Proximity preservation:Proximity preservation: similar similar nodes are drawn closely nodes are drawn closely

Symmetry preservation:Symmetry preservation: isomorphic sub-graphs are drawn isomorphic sub-graphs are drawn identicallyidentically

No external influences:No external influences: “Let the “Let the graph speak for itself”graph speak for itself”

( This slide comes from Yehuda Harel )

Page 4: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

MotivationMotivations (1/2)s (1/2)

The force-directed methods can be categorized The force-directed methods can be categorized according to the types of repulsionaccording to the types of repulsion

vertexvertex edgeedge

vertexvertex

edgeedge

XX ( vertex-vertex repulsion ) ( vertex-vertex repulsion )1.1. Eades, 19841.2. Fruchterman & Reingold, 1991

XX ( vertex-edge repulsion ) ( vertex-edge repulsion )2.1. Davidson & Harel, 19962.2. Bertault, 1999

the same

( edge-vertex repulsion )edge-edge repulsion

Page 5: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

1.1. Vertex-Vertex Repulsion1.1. Vertex-Vertex Repulsion( Eades, 1984 )( Eades, 1984 )

Model of Vertex-Vertex RepulsionModel of Vertex-Vertex Repulsion– Nodes → Nodes → charged ringscharged rings

→ → repulsive forcerepulsive force– Edges → Edges → springssprings

→ → attractive forceattractive force

PropertiesProperties– The drawing has a high degree of The drawing has a high degree of symmetry symmetry andand

uniform edge lengthuniform edge length

let go!

Page 6: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

1.2. Vertex-Vertex Repulsion1.2. Vertex-Vertex Repulsion( ( Fruchterman & Reingold, 1991))Eades’ force formulasEades’ force formulas– Hook’s law for spring forcesHook’s law for spring forces

ffaa( ( xx ) = ) = KK ( ( xx – – dd ) )

Modified formulaModified formula

– Newtonian law for repulsive forcesNewtonian law for repulsive forcesffrr( ( xx ) = ) = KK / / rr22

FR proposed a more efficient versionFR proposed a more efficient version–

– Locally consider vertex-vertex repulsionLocally consider vertex-vertex repulsion

1 2( ) log( / )af d C d C

log ( x )

xC2

2

( ) uva uv

df d

k

2

( )r uvuv

kf d

d

Page 7: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

2.1. Vertex-Edge Repulsion2.1. Vertex-Edge Repulsion( Davidson & Harel, 1996 )( Davidson & Harel, 1996 )

Drawing graphs using Drawing graphs using simulated annealingsimulated annealing appr approachoach– Using the paradigm of simulated annealingUsing the paradigm of simulated annealing

(Kirkpatrick, Gelatt, and Vecchi, 1983)(Kirkpatrick, Gelatt, and Vecchi, 1983)– Their approach tries to find an optimal configuration aTheir approach tries to find an optimal configuration a

ccording to a ccording to a cost functioncost function as follows: as follows:

5

1

( ) ( )i ii

f L f L

2

1 ( , )( ) (1/ ),uvu v Vf L d

2 2 2 2

2 ( ) ((1/ ) (1/ ) (1/ ) (1/ ))u u u uv Vf L r l t b

23 ( , )( ) (1/ ),uvu v Ef L d

4 ( ) The number of edge crossings in .f L L

25 ( ),( )( ) (1/ ( , ) )

u V e Ef L g u e

Penalize the vertex and edge that aretoo close to each other.( vertex-edge repulsion )

Penalize the distance between two vertices.( vertex-vertex repulsion )

Page 8: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

2.2. Vertex-Edge Repulsion2.2. Vertex-Edge Repulsion( Bertault, 1999 )( Bertault, 1999 )

A force-directed approach that preserves A force-directed approach that preserves edge crossing edge crossing propertiesproperties– Theorem. Theorem. Two edges cross in the final drawing iff these edges crTwo edges cross in the final drawing iff these edges cr

ossed on the initial layoutossed on the initial layout

#(crossings) = 5

Page 9: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

MotivationMotivations (2/2)s (2/2)

Def. Def. Angular resolutionAngular resolution– the the smallest anglesmallest angle formed by two formed by two

neighboring edges incident to the common neighboring edges incident to the common vertex in straight line drawingvertex in straight line drawing

– guaranteeing that arbitrarily small angles guaranteeing that arbitrarily small angles cannot be formed by adjacent edgescannot be formed by adjacent edges

The The Zero Angular ResolutionZero Angular Resolution Problem Problem– There exist There exist at least two of the edgesat least two of the edges incident incident

to the common vertex to the common vertex overlappingoverlapping– RResulting in a bad drawing with esulting in a bad drawing with edge-edge edge-edge

and vertex-edge crossingsand vertex-edge crossings simultaneously simultaneously– Classical force-directed method cannot Classical force-directed method cannot

gguarantee the absence of any overlapping of uarantee the absence of any overlapping of edges incident to the common vertexedges incident to the common vertex

Edge-edge overlapping

vertex-edge overlapping

initialfinal

Page 10: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

Model of Edge-Edge RepulsionModel of Edge-Edge Repulsion

1 2( ) log( / )af d C d C

In each iteration:In each iteration:Step1. For each Step1. For each edge (spring)edge (spring),,

compute compute spring forcesspring forces as Eades’, i.e. as Eades’, i.e. Step2. For each pair of Step2. For each pair of neighboring edgesneighboring edges,,

compute compute repulsive forcesrepulsive forces according to our model according to our modelStep3. Step3. Adjust the positionAdjust the position of every vertex according to the force of every vertex according to the force

acting on the vertexacting on the vertex

C

A

BA

C

B

Every edge is replaced bya changed spring.

Page 11: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

IntuitionIntuition

AB ACThe magnitudes of the repulsive force due to the two The magnitudes of the repulsive force due to the two edges and areedges and are– Positively Positively correlated with the edge lengths correlated with the edge lengths – Negatively Negatively correlated with the included anglecorrelated with the included angle

and AB AC

C

A

B

f1

f2 = - f1

f11

f12

Page 12: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

Potential Field MethodPotential Field Method

Motion planning or Path planningMotion planning or Path planning

( Chuang and Ahuja, 1998)( Chuang and Ahuja, 1998)

++

+++++

+++++

+++

+ + ++ ++ +

+

++

++

++

+

++

S

G

C

A

B

General formula of the repulsive forcebetween two charged edges

Page 13: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

Reasons to simplify the repulsive Reasons to simplify the repulsive force formulaforce formula

We We don’t use the general formulasdon’t use the general formulas of edge-edge of edge-edge repulsion because:repulsion because:– The formulas derived from potential fields appears to be a bit The formulas derived from potential fields appears to be a bit

complicated and consequently require complicated and consequently require special care when special care when implementingimplementing such a method. From a practical viewpoint, such a such a method. From a practical viewpoint, such a complication may not be needed for the purpose of drawing complication may not be needed for the purpose of drawing graphs.graphs.

Therefore, by observing some Therefore, by observing some characteristicscharacteristics of edge- of edge-edge repulsion and edge repulsion and experimentalexperimental resultsresults of potential of potential fields method, we are able to fields method, we are able to derive a simplified versionderive a simplified version of repulsive forces.of repulsive forces.

Page 14: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

Simulation on Simulation on magnitudemagnitude of force of force

1 13

4 4

The magnitude due to edge length equals to

| | | || | tan ( ) tan ( )e

AB ACf C

C C

5

The magnitude due to the included angle equals to

| | cot( )2

f C

The magnitude of total force equals to

| | | | | |ef f f

Force magnitude vs. edge length Force magnitude vs. the included angle

Page 15: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

Simulation on Simulation on orientationorientation of force of force

2 2

1

10 1

( )1 0| | 2

M Mf

fu R u u

f

2 1f f11 | | ff f u

2

the

incl

uded

ang

le

the included angle

Page 16: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

Simplified force formulaSimplified force formula

The force can be calculated as:The force can be calculated as:

Note that Note that ff11 has the advantage that has the advantage that ff11 is determined only is determined only

by three parameters , facilitating a by three parameters , facilitating a simple implementation of our drawing algorithm based simple implementation of our drawing algorithm based upon edge-edge repulsionupon edge-edge repulsion

1 11 3 5

4 4

0 1| | | |tan ( ) tan ( ) cot( )

1 02MAB AC

f C C uC C

, , and AB AC

Page 17: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

Experimental ResultsExperimental Results (i) (i)

Larger angular resolutionLarger angular resolution

Preserve Preserve a high degree of symmetry and uniform edge a high degree of symmetry and uniform edge lengthlength as the classical method as the classical method

Page 18: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

Experimental ResultsExperimental Results (ii) Hypercub (ii) Hypercubeses

Because the model of edge-edge repulsion allows at least two vertices coinciding (although such drawings are improper), our approach may produce drawings with more symmetries.

Page 19: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

StatisticsStatisticsThe following is the statistics of the above experimental results with compariThe following is the statistics of the above experimental results with comparison of the classical method and our approach. Observing the column StdDeson of the classical method and our approach. Observing the column StdDev / AvgLen, i.e. the v / AvgLen, i.e. the normalized standard deviation of edge lengthsnormalized standard deviation of edge lengths, our appr, our approach without costing more running time seems to have equal or more uniforoach without costing more running time seems to have equal or more uniform edge length than the classical method.m edge length than the classical method.

Observing the column `Observing the column `Angular resolutionAngular resolution’, the classical method may have t’, the classical method may have the problem of zero or few angular resolution, while our approach normally hhe problem of zero or few angular resolution, while our approach normally has larger angular resolution than the classical.as larger angular resolution than the classical.

Page 20: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

Local minimal problemLocal minimal problem

Force-directed method suffers from the local minimal proForce-directed method suffers from the local minimal problem, in which the blem, in which the spring force may be too weak to spreaspring force may be too weak to spread the graphd the graph

Both the classical method and our approach may not haBoth the classical method and our approach may not handle local minimal problem in some cases, so the followindle local minimal problem in some cases, so the following strategies can be applied:ng strategies can be applied:– Two-phase methodTwo-phase method

First using the classical method and then using our methodFirst using the classical method and then using our method

– Hybrid Hybrid strategystrategySimultaneously using the classical method and our methodSimultaneously using the classical method and our method

– Adjusting parametersAdjusting parametersParameters play important roles Parameters play important roles

( The figures shown in this slide comes from Yehuda Harel )

Page 21: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

ConclusionConclusion

A new force-directed method A new force-directed method based on edge-edge based on edge-edge repulsionrepulsion for generating a straight-line drawing not only for generating a straight-line drawing not only preserving the original properties ofpreserving the original properties of a high degree of a high degree of symmetry and uniform edge lengthsymmetry and uniform edge length but also but also without zero without zero angular resolutionangular resolution has been proposed and implemented has been proposed and implemented

Future workFuture work– To handle the To handle the local minimallocal minimal problem problem

Try to use multilevel techniques or optimal heuristics, such Try to use multilevel techniques or optimal heuristics, such as simulated annealing, genetic algorithm, etc.as simulated annealing, genetic algorithm, etc.

– More More experimental resultsexperimental results on graphs of huge size and on graphs of huge size and theoretical resultstheoretical results on the power of the model of edge-edge on the power of the model of edge-edge repulsionrepulsion

Page 22: A New Force-Directed Graph Drawing Method Based on Edge- Edge Repulsion Chun-Cheng Lin and Hsu-Chen Yen Department of Electrical Engineering, National.

The EndThe End

ThankThank you you for you for yourr attention. attention.


Recommended