370 likes | 895 Views
Using Multilevel Force-Directed Algorithm to Draw Large Clustered Graph. 研究生 : 何明彥 指導老師 : 顏嗣鈞 教授. OUTLINE. Introduction Multilevel Paradigm Coarsening Phase Uncoarsening Phase Experiment result Conclusion Reference. Introduction(1/7). (a) network topology. (b) social network.
E N D
Using Multilevel Force-Directed Algorithm to Draw Large Clustered Graph 研究生: 何明彥 指導老師:顏嗣鈞 教授 NTUEE
OUTLINE • Introduction • Multilevel Paradigm • Coarsening Phase • Uncoarsening Phase • Experiment result • Conclusion • Reference NTUEE
Introduction(1/7) (a) network topology (b) social network (d) data flow chart (c) E-R diagram NTUEE
3 1 4 0 2 Introduction(2/7) • Graph is widely-used in computer science recently. • entity Vertex • relationship between entities Edge ex: 0-1,2,3,4 1-0,2,3,4 2-0,1,3,4 3-0,1,2,4 4-0,1,2,3 NTUEE
Introduction(3/7) • Good? Aesthetic? • crossing • symmetric • angular resolution • ……. Graph Drawing Algorithm NTUEE
Introduction(4/7) • Graph Drawing Algorithm • Circular Drawing • Orthogonal Drawing • Straight-Line Drawing (c) Straight-Line Drawing (b) Orthogonal Drawing (a) Circular Drawing NTUEE
Introduction(5/7)Straight-Line Drawing—Force-Directed Method • Vertex Charged ring • by Newton’s Law, repulsive force between vertices • Edge Spring • by Hook’s Law, attractive Force to make vertices closer NTUEE
Introduction(6/7) Clustering NTUEE
Introduction(7/7) • Usually, Circular drawing can express the aesthetic goal of embedded cluster. • Embedded cluster is important. • ex: hosts in which LAN for network topology; people in which group for social network • try to using Straight-Line Drawing to achieve it. NTUEE
Multilevel Paradigm(1/4) • Two parts: • Graph Coarsening: • Partition vertices to form clusterand define a new graph • Graph Uncoarsening: • To redraw original graph NTUEE
Multilevel Paradigm(2/4)Graph Coarsening given graph GL Level-L graph partitioning method Coarser graph GL+1 Level-L+1 NTUEE
Multilevel Paradigm(3/4)Graph Uncoarsening given graph GL+1 Level-L+1 uncoarsen GL+1; use spring algorithm to draw GL Level-L drawing graph GL NTUEE
Multilevel Paradigm(4/4) (a) original graph (b) group vertices (c) coarser graph (e) final result (d) uncoarsening stage NTUEE
Coarsening Phase(1/12) • Partition vertices to form clusterand define a new graph • K-way partitioning: • The number of edges of E whose incident vertices belong to different subsets is minimized. NTUEE
b f a d g g h c e d h e Coarsening Phase(2/12)Graph Partitioning • The number of edges of E whose incident vertices belong to different subsets is so-called edge-cut and should be minimized. a a f b b g c f c e d h Edge-cut=5 Edge-cut=1 NTUEE
Coarsening Phase(3/12) • Two stage • Matching stage • Using random matching • Contraction stage • A coarser graph is created by contracting former matching vertex • Using Kernighan-Lin algorithm NTUEE
Algorithm: Random matching (Go) Input:G0 Output: Match [u] and Map [u]; Match [u] store the vertex which is matched by u Map [u] store the label of v in the coarser graph begin visit vertex in random order If vertexu has not been matched yetthen random select one of its unmatched adjacent verticesv Ifv existthen put v in match [u] map [u]=map [v] else match [u]=u end NTUEE
Coarsening Phase(5/12) NTUEE
Properties of K-L Algo. NTUEE
A B A B a b a b x A B b a x NTUEE
Algorithm: Kernighan-Lin Algorithm (G) Input: G=(V,E) Output: partition A and B with small edge-cut begin partition G into A and B repeat compute Dv, for i=1 t0 n/2do find an unmarked pair (ai, bi), that maximizing gab mark ai, bi update Dv for all unmarked find j, such that Gj= is maximized ifGj>0 then move a1,…, aj from A to B move b1,…,bj from B to A until end NTUEE
b 1 c 2 1 2 1 3 a 4 d 3 2 2 a d 1 3 a d 3 2 4 2 2 4 e b e b 4 2 c f e f c f Initial edge cut=22 Random matching For “a”: NTUEE
a d f b e b d a c c f e f f b b d e a e c a e d NTUEE
f b d a c e Iteration 1 f b d a c e Iteration 2 NTUEE
Uncoarsening Phase(1/4) • Two stage • Mapping stage • Put nodes in a region • Refinement stage • Using FR force-directed method • Using Virtual spring for drawing cluster embedded clustered graph NTUEE
Algorithm: Uncoarening Input: coarser graph Gi Output: original graph G0 Begin using Force-directed method to draw Gi For each vertex u in Gi if (vertexv in Gi-1 is coarsened into u) place v in a region of u set u as the virtual node again using spring method to draw original graph Go end NTUEE
Virtual-Springto make nodes in cluster close together internal-spring: a spring force between a pair node which belong to a cluster a b external-spring: a spring force between a pair node which not belong to a cluster c d virtual node: each cluster has a virtual node Create virtual spring e g f virtual spring: a spring force between a pair node along the virtual edge h NTUEE
Experiment Result(1/6) |V|=25; |E|=60 Original: NTUEE
Experiment Result(2/6) Spring Algorithm result: NTUEE
Experiment Result(3/6) |Cluster|=5 NTUEE
Experiment Result(4/6) |V|=42; |E|=75 Original: NTUEE
Experiment Result(5/6) Spring Algorithm result: NTUEE
Experiment Result(6/6) |Cluster|=6 NTUEE
Conclusion • It is suitable for drawing large graph • Multilevel algorithm is fast and no local minimum. • K-L algorithm works well for graph partitioning. • Embedded cluster graph is available. NTUEE
Reference • Chris Walshaw, ”A multilevel algorithm for Force-Directed Graph Drawing”. Journal of Graph Algorithm and Applications, vol7,no.3,pp253-285 (2003) • J. Chuang, C.Lin, and H. Yen, "Drawing Graphs with Nonuniform Nodes Using Potential Fields," in the Proceedings of the 11th International Symposium on Graph Drawing 2003,(LNCS 2912) pp. 460-465, Perugia, Italy, Sept. 21-24, 2003 • Peter Eades, Mao Lin Huang, “Navigating Cluster Graphs using Force-Directed Methods “, Journal of Graph Algorithm and Applications(2000) • George Karypis and Vipin Kumar ,”A Fast and High Quality Multilevel Scheme for Partitioning Irregular” .SIAM of Journal on Scientific Computing • J.Fruchterman, M.Reingold, “Graph Drawing by Force-Directed Placement”, 1991 • B.W.Kernighan, S.Lin, “An efficient heuristic procedure for partitioning graphs.” The Bell System Technical Journal • S.Hachul and M.Junger, ”Drawing Large graphs with a potential-field-based multilevel algorithm” GD2004 NTUEE