Grandalf : A Python module for Graph Drawings https://github.com/bdcht/grandalf

Axel Tillequin Bibliography on Graph Drawings - 2008-2010

June 2011

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

1 / 20

Outline 1

Graphs generalities Motivations Definitions Graph Drawing Principles

2

Sugiyama Hierarchical Layout 1. Layering 2. Ordering 3. x-coordinate assignment 4. y-coordinate assignment

3

Force-driven Hierarchical Layout Energy minimization Hierarchical layer constraints Quadratic Programming with Orthogonal Constraints

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

2 / 20

1

Graphs generalities Motivations Definitions Graph Drawing Principles

2

Sugiyama Hierarchical Layout 1. Layering 2. Ordering 3. x-coordinate assignment 4. y-coordinate assignment

3

Force-driven Hierarchical Layout Energy minimization Hierarchical layer constraints Quadratic Programming with Orthogonal Constraints

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

3 / 20

Motivations

Interactive drawing of an evolutionary hierarchical graph ?

Application: browsing the flow graph of a malware identifying/viewing/folding procedures by semantic analysis visualizing properties at some points in the program

Needs Interactive/adaptative drawings of small 2D directed graphs (|V | ≈ 100): allowing node contraction (folding), and layout updating without entire recomputation ! Grandalf : small Python module for experimental Graph layout testings

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

4 / 20

Existing Tools see [1]

program flow browsers: I

IDA, BinNavi: good interfaces but fails at semantic-driven analysis,

graph drawings: I

general-purpose, 2D: F F

F

I I

graphviz (open source, C), OGDF (GPL, C++), PIGALE (GPL, C++), GUESS, ... GDToolkit (commercial, C++), yFiles (commercial, Java)

Huge graphs, 2D: Tulip (GPL, C++), Huge graphs, 3D: OGDF, Walrus (GPL, Java).

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

5 / 20

Graph theory basics Definition A Graph is a pair G = (V , E ) of sets such that E ⊂ V 2 .

V are vertices (nodes, points), and E are edges (lines, segments) v ∈ V has neighbours (adjacent nodes) a path P is a subgraph of distinct nodes v0 , ..., vk s.t (vi , vi+1 ) ∈ E . G has k-connected components: forall vi , vj ∈ V , ∃k paths.

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

6 / 20

Graph theory basics Properties: A graph G is directed if one can distinguish initial/terminal nodes for an edge. G is hierarchical if it has also a rooted tree T . A graph G is acyclic if no path are closed. Then G is a forest, its components are trees. A graph is planar if it can be drawn on a plane with no edge crossing.

minimize edge-crossing for non-planar graphs !

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

7 / 20

Graph Drawing Principles for all graphs :

Drawing Rules Many static/dynamic, semantic/structural rules: avoiding node overlapping, minimizing edge crossing, minimize total edge length favor straight line placement, avoid edge bends, use hierarchical information, balance width/height, show symmetries, =⇒ link with many NP-complete problems

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

8 / 20

Layouts and Methods Hierarchical vs. undirected layouts: Undirected graphs : 2D or 3D, can be of huge sizes, focusing mainly on connectivity so that force-driven (energy minimization) methods give good drawings. Hierarchical graphs : mostly 2D (or 2.5D) graphs for which edge directions provide a natural global orientation of the graph from a top root node down to leaves.

Methods and Solvers heuristics algorithms =⇒ efficient but not suited to user-defined constraints Constraint based solvers =⇒ inefficient but depend on constraints expressions only

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

9 / 20

1

Graphs generalities Motivations Definitions Graph Drawing Principles

2

Sugiyama Hierarchical Layout 1. Layering 2. Ordering 3. x-coordinate assignment 4. y-coordinate assignment

3

Force-driven Hierarchical Layout Energy minimization Hierarchical layer constraints Quadratic Programming with Orthogonal Constraints

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

10 / 20

1. Layering L = (L1 , ..., Lh ), ordered partition of V into layers Li . directed acyclic graph: =⇒ cycle removal algorithm simple ”natural” layering: put top nodes (no ”in” edges) in queue,

f o r v i n queue : v . r a n k=max ( [ x . r a n k f o r x i n v . N( −1)]+[ −1])+1 f o r e i n v . e o u t ( ) : e . s c a n=True f o r x i n v . N( + 1 ) : i f not ( F a l s e i n [ e . s c a n f o r e i n x . e i n ( ) ] ) : queue . add ( x )

add ”dummy” nodes for edges that span over several layers minimum total edge length =⇒ simplex solver

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

11 / 20

2. Ordering see [3]

Global ordering decomposed into iterated 2-layers ordering:

2-layers ordering optimal edge crossing is NP ! but many heuristics for approx. solutions by fixing Li and ordering Li±1 : position of vj depend on upper/lower neighbours (median, barycenter) count all crossings and exchange accordingly.

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

12 / 20

3. x-coordinate assignment see [3, 1]

ordering 6= horizontal assigment: =⇒ need to guarantee vertical inner segments, fair balance etc.

Horizontal alignment minimize

P

e=(u,v )∈E

w (e)|u.x − v .x| subject to minimum separation

select edges that influence alignment perform 4 vertical alignments with median heuristic: I I

upper/left, upper/right alignement lower/left, lower/right alignement

sort 4 coords and set v .x to barycenter of medians

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

13 / 20

4. y-coordinate assignment

What about Node size ? Previous heuristics assume all nodes have same size, avoiding edge routing problems...

height of layer Li set to max height of its nodes...simple but not optimal ! other heuristics exists[2]...more heuristics on heuristics...

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

14 / 20

1

Graphs generalities Motivations Definitions Graph Drawing Principles

2

Sugiyama Hierarchical Layout 1. Layering 2. Ordering 3. x-coordinate assignment 4. y-coordinate assignment

3

Force-driven Hierarchical Layout Energy minimization Hierarchical layer constraints Quadratic Programming with Orthogonal Constraints

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

15 / 20

Energy minimization see [4, 5]

introduced in 1989 by Kamada&Kawai for undirected graph G = (V , E ). The idea is to minimize: X σ(X ) = wij (kXi − Xj k − dij )2 i
where Xi = (vi .x, vi .y ), dij is the ideal distance between node vi and vj (ie. graph distance), and wij = 1/dij2 is a normalization coefficent. P Note that, i
bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

16 / 20

Hierarchical contrained Energy see [6]

hierarchical energy: take wij = 1 and δij = vi .y −Pvj .y (1 if (vi , vj ) ∈ E ), a partition of V is given by minimizing E (Y ) = 12 i,j wij (yi − yj − δij )2 =⇒ Lw Y = b, with bi =

P

j

(Y · 1 = 0)

wij δij .

(illustration from [6])

Lw is semi-definite positive =⇒ Conjugated gradient O(n) iterations.

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

17 / 20

Quadratic Programming with Orthogonal Constraints see [6, 5]

minimize σ(X ), subject to contraints : ∀vj ∈ level(i) : ∀vj ∈ level(i + 1) :

vj .y ≥ li ,

i = 1, ..., k

vj .y + ∆l ≤ li ,

i = 1, ..., k

=⇒ ˜k+1 = minX F Xk (X )) gradient descent (X ˜k+1 ) = X ˆk+1 projection to levels Π(X ˆk+1 − Xk ) set Xk+1 = Xk + α(X

bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

18 / 20

References (1/2) [1] Graphviz: http://www.graphviz.org/

[2] Ellson et al. Graphviz and Dynagraph - Static and Dynamic Graph Drawing Tools. [3] Brandes, Kopf Fast and Simple Horizontal Coordinate Assigment GD 2001, LNCS 2265, pp. 31-44, 2002. [4] Gansner, North Improved force-directed layouts AT&T Labs, 1998. [5] Gansner, Koren, North Graph Drawing by Stress Majorization AT&T Labs, 2004. [6] Dwyer, Koren DIG-COLA: Directed Graph Layout through Constrained Energy Minimization, 2005. bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

19 / 20

References (2/2) [7] M. Forster A Fast and Simple Heuristic for Constrained Two-Level Crossing Reduction

[8] North, Woodhull On-line Hierarchical Graph Drawing AT&T Labs [9] Eiglsperger et al. An Efficient Implementation of Sugiyama’s Algorithm for Layered Graph Drawing Journal of Graph Algorithms and Applications, http://jgaa.info/, vol. 9 no.3, 2005. [10] Gajer, Kobourov GRIP: Graph Drawing with Intelligent Placement Journal of Graph Algorithms and Applications, vol. 6 no.3, 2002. [11] Dwyer, Koren, Marriott Stress Majorization with Orthogonal Ordering Constraints GD 2005. bdcht (Axel Tillequin)

https://github.com/bdcht/grandalf

June 2011

20 / 20

Grandalf : A Python module for Graph Drawings - GitHub

Existing Tools see [1] program flow browsers: ▷ IDA, BinNavi: good interfaces but fails at semantic-driven analysis, graph drawings: ▷ general-purpose, 2D:.

393KB Sizes 69 Downloads 275 Views

Recommend Documents

Sonar Array Module - GitHub
TITLE. DATE $Date: 2004/08/14 $. $Revision: 1.4 $. Dafydd Walters sonar_array_module.sch. Sonar Array Module. 3. 2. 4. 1. CONN1. Sonar 1. +5V echo trigger.

Knowledge graph construction for research literatures - GitHub
Nov 20, 2016 - School of Computer Science and Engineering. The University of ... in different formats, mostly PDF (Portable Document Format), and con- tain a very ... 1. 2 Information Extraction. 5. 2.1 Natural Language Processing . .... such as: tec

A textual graph-based modeling framework for education ... - GitHub
Item 1 - 6 - Proc-2013-1-3-15.pdf (A visual DPF tool implemented by our students) ... Elements (in the signature) having the same name are considered ... {LOCAL PATH ON YOUR COMPUTER}/no.hib.dpf.text.updatesite/target/site. 8. Open the ...

Design module user manual - GitHub
In the design module objects like buildings can be selected. For each case, measures ... Figure 3, parts of the web application for control and visualizing data. 1.

Python Cryptography Toolkit - GitHub
Jun 30, 2008 - 1 Introduction. 1.1 Design Goals. The Python cryptography toolkit is intended to provide a reliable and stable base for writing Python programs that require cryptographic functions. ... If you're implementing an important system, don't

Community-Based Weighted Graph Model for Valence ... - GitHub
similar words (i.e., those connected to it) including both pos- itive (+) and negative (−) words, ... Chinese words for manual rating. A linear regression ...... Future re- search can benefit from such useful lexical resources to extend current VA

Covers Python 3 and Python 2 - GitHub
Setting a custom figure size. You can make your plot as big or small as you want. Before plotting your data, add the following code. The dpi argument is optional ...

Covers Python 3 and Python 2 - GitHub
You can add as much data as you want when making a ... chart.add('Squares', squares) .... Some built-in styles accept a custom color, then generate a theme.

Ultra High Sensitivity GPS Engine Module - GitHub
Innovative design and technology suppresses jamming sources and mitigates multipath effects ... Supply of aiding information like ephemeris, almanac, rough last position and time ... Table 5: Antenna Specifications for all E-1612-UB modules.

About the GSO-module in fplll - GitHub
Jul 6, 2017 - The GSO-module. Possible improvements. Summary. Questions. Givens rotations. Givens rotations. A Givens rotation G = G(i,j,θ) has rows: Gk =.. ek if k = i,j cei − sej if k = i sei + cej if k = j where c2 + s2 = 1. Note that b ↦→

HM-13 Bluetooth Module Datasheet - GitHub
Under iOS, you can use CBAdvertisementDataManufactureDataKey property to get it, string format like follow: 0x48, 0x4D, 0x00, 0x0E, 0x0B, 0xXX, 0xXX, 0xXX ...

Scientific python + IPython intro - GitHub
2. Tutorial course on wavefront propagation simulations, 28/11/2013, XFEL, ... written for Python 2, and it is still the most wide- ... Generate html and pdf reports.

Annotated Algorithms in Python - GitHub
Jun 6, 2017 - 2.1.1 Python versus Java and C++ syntax . . . . . . . . 24. 2.1.2 help, dir ..... 10 years at the School of Computing of DePaul University. The lectures.

Module I Module II Module III Module IV Module V
THANKS FOR YOUR SUPPORT.MORE FILES DOWNLOAD ... Module VII. Marketing-Importance ,Scope-Creating and Delivering customer value-The marketing.

Optimizations which made Python 3.6 faster than Python 3.5 - GitHub
Benchmarks rewritten using perf: new project performance ... in debug hooks. Only numy misused the API (fixed) ... The Python test suite is now used, rather than ...

Dan Dietz Greenville Django + Python Meetup - GitHub
Awaken your home: Python and the. Internet of Things. PyCon 2016. • Architecture. • Switch programming. • Automation component. Paulus Schoutsen's talk: ...

QuTiP: Quantum Toolbox in Python - GitHub
Good support for object-oriented and modular programming, packaging and reuse of code, ... integration with operating systems and other software packages.

Factor Graph Based Incremental Smoothing in Inertial ... - GitHub Pages
the effect of linearization errors. In [20], a ..... illustration of the interaction between the stereo-vision binary .... scattered on the ground with 소50 meters elevation.

Introduction to Scientific Computing in Python - GitHub
Apr 16, 2016 - 1 Introduction to scientific computing with Python ...... Support for multiple parallel back-end processes, that can run on computing clusters or cloud services .... system, file I/O, string management, network communication, and ...

Beyond Hive – Pig and Python - GitHub
Pig performs a series of transformations to data relations based on Pig Latin statements. • Relations are loaded using schema on read semantics to project table structure at runtime. • You can run Pig Latin statements interactively in the Grunt s

A Neural Representation of Sketch Drawings - arXiv
Apr 11, 2017 - outputs a latent vector of size Nz. Specifically, we feed the sketch sequence, S, and also the same ..... hybrids on pixel images, and has recently been tested on text generation [12]. Combining .... 2015/11/13/gan.html, 2015.