literature review of force-based graphing algorithms

Upload: james

Post on 30-May-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    1/35

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    2/35

    Outline

    Goal of Force Graphing Algorithms

    Review of Hookes Law

    Three Main Algorithms

    Spring Model

    Simulated Annealing

    The Sugiyama Algorithm

    8 Variations

    Review

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    3/35

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    4/35

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    5/35

    Goals

    Aesthetics

    Minimize edge crossings

    Verities evenly distributed

    Minimize drawing area

    Maximize symmetries

    Maximize angular resolution

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    6/35

    Goals

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    7/35

    3 Algorithms.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    8/35

    Sugiyama Algorithm

    Sugiyama, Tagawa, and Toda (1981)

    The graph is assumed to be in layers.

    Edges can only connect nodes in differentlayers.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    9/35

    Sugiyama Algorithm

    The algorithm is in four stages:

    Stage 1: Refit the graph into layers (if not done soalready)

    Stage 2: Reshape the vertices at each level toreduce edge crossings

    Stage 3: Reshape the vertices at each level toreduce edge lengths

    Stage 4: Display the graph

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    10/35

    Sugiyama Algorithm

    If an edge stretches across multiple layers,placeholder nodes are added to in betweenlayers.

    Barycenter for a node: the minimum distancefrom a level to every other node.

    Computing the barycenter of each nodeautomatically reduces edge crossings.

    Nodes are moved based on their barycenters.

    Nodes with smaller barycenters are given ahigher priority.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    11/35

    Spring Model

    Peter Eades, 1984

    Vertices are replaced with rings.

    Edges are replaced with springs.

    Each spring applies a force on the rings,moving the rings slightly.

    After several iterations of slight movements, the

    springs reach an equilibrium point

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    12/35

    Spring Model

    Vertices that are connected by an edge attract.

    C1 * log(D * C2)

    D: length of the spring

    C1, C2: Constants

    Vertices that are not connected repel.

    C3 / sqrt(D)

    C3: Constant

    All forced are multiplied by C4 and repeated100 times.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    13/35

    Simulated Annealing

    Davidson and Harel (1989)

    Each node uses an cost function, which consistof:

    Potential Energy for each node: aij= C1 / (d

    ij)2

    Borderline Energy C2 ( 1/r2 + 1/l2 + 1/t2 1/b2)

    Energy of each edge: C3 * (dk)2

    Distance from node to an edge: C4 / (gkl)2

    d_ij: distance between two nodes. C1, C2, C3, C4 are constants. r, l, t, b: distance from right, left, top, bottom g_kl: distance from node k to edge l

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    14/35

    Simulated Annealing

    In addition to the cost function, there is apenalty for each edge crossings: C5 (aconstant)

    The cost function is multiplied by a temperature High temperature = greater movement

    Low temperature = lesser movement

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    15/35

    Simulated Annealing

    Cooling Function. Over time, the temperature ofthe area "cools".

    Initial temperature is arbitrarily high # in degrees

    Trials per degree: 30 * # of nodes

    Cooling function = Tp+1

    = C6 * Tp

    Termination condition: little or no movement for

    three iterations. Algorithm runs in O(V2 * E)

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    16/35

    8 Variations.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    17/35

    Kamada and Kawai (1989)

    Variation of Eades spring model approach.

    Each edge has a starting length of lij

    Each edge desires to have a length equal to L L: Usually a function of the size of the

    graphing area.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    18/35

    Kamada and Kawai (1989)

    dij: the shortest path of edge lengths between

    nodes i and j.

    kij

    : strength of the spring equal to K / dij

    K: Constant

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    19/35

    Fruchterman & Reingold (1990)

    Includes ideas of Eades and Kamada using aSpring Force graph

    Includes ideas of Davidson and Harel using

    Simulated Annealing Cost function is based on Hooke's Law

    Optimal distance between vertices: C *

    sqrt(area / number of verticies) Proposes an idea for a grid-variant partitioning

    scheme.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    20/35

    Tunkelang (1994)

    Step 1: Compute a minimal height spanningtree of the graph.

    The graph nodes are placed so that the root

    node is in the center and subsequent nodessurround it in rings.

    Edges strive for a target edge length that is aparameter set by the user.

    Larger length: better graph.

    Smaller length: faster graph.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    21/35

    Tunkelang (1994)

    Attraction forces are edges; repulsion forcesare other nodes.

    Attraction force: wa

    * d2

    Repulsion force: wr/ d2

    d: distance between two nodes

    wa: weight given to attractive force.

    wr: weight given to repulsive force.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    22/35

    Tunkelang (1994)

    Target edge length is suggested to be:

    (wr/w

    a)1/4

    Using the uniform grid approach to countingedge crossings, nodes are pushed until aminimal arrangement is reached.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    23/35

    Frick, Ludwig, Mehldau (1995)

    Builds on the work of Davidson and Harel(1989).

    Instead of having a global temperature for

    simulated annealing, each node has a localtemperature.

    Each node starts with the same temperature.

    After each node moves, the temperaturedecreases based on the movement. If the nodeappears to be oscillating, the temperaturedecreases quickly. If not, the temperature

    decreases slowly.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    24/35

    Gansner and North (1998)

    Purpose of this algorithm is to improve theresults of the Kamada and Kawai algorithm.

    Phase 1: Perform the original Kamada and

    Kawai algorithm. Phase 2: Magnify the placement of all vertices,

    giving them sufficient space.

    For each vertex, compute a Voronoi diagram. Move the vertex to the nearest center. Vertices

    gradually move away from each other in anorderly fashion.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    25/35

    Bertault (1999)

    Initial placement of nodes is made by thegraph's owner.

    Edge Crossings should be preserved, not

    minimized. Cost functions is split between attractive forces

    (edges), repulsive forces (nodes), and repulsingforces (nodes versus edges).

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    26/35

    Bertault (1999)

    For each node, 8 "nodearcs" are computed.These are arcs equal to1/8th of a circle of

    equal proportions. Foreach arch, a calculationis made regarding themaximum movement

    that can be madewithout changing nodecrossings.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    27/35

    Walshaw (2000)

    Implements Frucherman and Reingold's grid-variant algorithm.

    Cost function between a vertex and another

    vertex (global cost): -Cwk2

    /x C: Constant

    k: natural length of the spring

    w: Number of vertices x: current length of the spring

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    28/35

    Walshaw (2000)

    Vertices in the same grid region are consideredlocal and use a different cost function: ((x - k) /d) - global cost

    d: distance between the two vertices. k (natural edge length) is set to the average edge

    length

    The cooling function at each iteration is 0.95

    times the previous temperature.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    29/35

    Walshaw (2000)

    If x (current length of spring) is sufficientlylarge, the authors say that the spring isstretched so far that it has no impact. This isused as excuse to speed up the algorithm by asmall factor.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    30/35

    Gajer, Goodrich, and Kobourov(2004)

    Differs from most algorithms in that they use analgorithm for initial placement.

    Similar to Tunkelang in that distinction is made

    between local and global points. Local is determined by a limited breadth-first

    search algorithm.

    Cost function is based on the Kamada andKawai cost function (1989)

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    31/35

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    32/35

    Review

    Eades (1984)Davidson &Harel (1989)

    Sugiyama, Tagawa,& Toda (1981)

    Kamada &Kawai (1989)

    Fruchterman &Reingold (1990)

    Tunkelang (1994)Frick, Ludwig, &

    Mehldau (1995)

    Gansner &

    North (1998)

    Bertault (1999)Walshaw (2000)Gajer, Goodrich, &Kobourov (2004)

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    33/35

    References

    F. Bertault. A force-directed algorithm that preserves edge crossing properties. InGraph Drawing, pages 351358. Springer, 1999.

    R. Davidson and D. Harel. Drawing graphs nicely using simulated annealing. ACMTransactions on Graphics (TOG), 15(4):301331, 1996.

    Eades. A heuristic for graph drawing. Congressus numerantium, 42(149160):194

    202, 1984. A. Frick, A. Ludwig, and H. Mehldau. A fast adaptive layout algorithm for undirected

    graphs. Graph Drawing (Proc. GD 039; 94), volume 894 of Lecture Notes inComputer Science, 1995.

    T.M.J. Fruchterman and E.M. Reingold. Graph drawing by force-directed placement.Software- Practice and Experience, 21(11):11291164, 1991.

    P. Gajer, M. Goodrich, and S. Kobourov. A multi-dimensional approach to force-directed layouts of large graphs. In Graph Drawing, pages 211221. Springer.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    34/35

    References

    E. Gansner and S. North. Improved force-directed layouts. In Graph Drawing, pages364373. Springer, 1998.

    T. Kamada and S. Kawai. An algorithm for drawing general undirected graphs.Information processing letters, 31(1):715, 1989.

    K. Sugiyama and K. Misue. Graph drawing by the magnetic spring model. Journal of

    Visual Languages and Computing, 6(3):217231, 1995. D. Tunkelang. A practical approach to drawing undirected graphs. Carnegie Mellon

    University, 1994.

    C. Walshaw. A multilevel algorithm for force-directed graph drawing. In GraphDrawing, pages 3155. Springer, 2000.

  • 8/9/2019 Literature Review of Force-based Graphing Algorithms

    35/35

    Additional References

    F. Brandenburg, M. Himsolt, and C. Rohrer. An experimental comparison of force-directed andrandomized graph drawing algorithms. In Graph Drawing, pages 7687. Springer.

    G. Di Battista, P. Eades, R. Tamassia, and I.G. Tollis. Algorithms for drawing graphs: anannotated bibliography. Computational Geometry-Theory and Application, 4(5):235282, 1994.

    G. Di Battista, A. Garg, G. Liotta, R. Tamassia, E. Tassinari, and F. Vargiu. An experimentalcomparison of four graph drawing algorithms* 1. Computational Geometry, 7(5-6):303325,

    1997.

    S. Sim. Automatic graph drawing algorithms. Manuscript, available att, 1996.