snapping graph drawings to the grid optimally
play

Snapping Graph Drawings to the Grid Optimally Andre L offler, - PowerPoint PPT Presentation

Snapping Graph Drawings to the Grid Optimally Andre L offler, Thomas C. van Dijk, Alexander Wolff Chair for Computer Science I: Algorithms, Complexity and Knowledge-Based Systems University of W urzburg 19. September 2016 Andre L


  1. Tunnels & Pushes • For a PM3SAT -formula F , our construction resembles its graph. • White vertices always cost at least 1 to be rounded. • If F is satisfiable, no black vertex needs to be moved. • Edges form tunnels that transmit pushes. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  2. Tunnels & Pushes • For a PM3SAT -formula F , our construction resembles its graph. • White vertices always cost at least 1 to be rounded. • If F is satisfiable, no black vertex needs to be moved. • Edges form tunnels that transmit pushes. • Topological safety ensures consistency of transmission. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  3. Clauses • At the center, there is a decider vertex with (up to) three possibible target grid points. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  4. Clauses • At the center, there is a decider vertex with (up to) three possibible target grid points. • Following one arrow, rounding generates pushes. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  5. Clauses • At the center, there is a decider vertex with (up to) three possibible target grid points. • Following one arrow, rounding generates pushes. • Blocking the bottom tunnel gives clause-gadgets for two variables. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  6. Clauses • At the center, there is a decider vertex with (up to) three possibible target grid points. • Following one arrow, rounding generates pushes. • Blocking the bottom tunnel gives clause-gadgets for two variables. • All-unnegated gadgets are constructed mirroring at a horizontal line. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  7. Variables • Has tunnel connections for negated and unnegated occurances. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  8. Variables • Has tunnel connections for negated and unnegated occurances. • Grows horizontally with number of occurances. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  9. Variables • Has tunnel connections for negated and unnegated occurances. • Grows horizontally with number of occurances. • At the left wall, there is an assignment vertex. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  10. Variables • Has tunnel connections for negated and unnegated occurances. • Grows horizontally with number of occurances. • At the left wall, there is an assignment vertex. • Following one arrow blocks tunnels on this side and creates pushes. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  11. Variables • Has tunnel connections for negated and unnegated occurances. • Grows horizontally with number of occurances. • At the left wall, there is an assignment vertex. • Following one arrow blocks tunnels on this side and creates pushes. • Moving the assignment vertex up equals a true -assignment, false otherwise. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  12. Hardness Proof Theorem Cost-bound Topologially Safe Snapping is NP -complete. Sketch of proof: Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  13. Hardness Proof Theorem Cost-bound Topologially Safe Snapping is NP -complete. Sketch of proof: • Combine gadgets according to formula-graphs structure. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  14. Hardness Proof Theorem Cost-bound Topologially Safe Snapping is NP -complete. Sketch of proof: • Combine gadgets according to formula-graphs structure. • Cost-bound c min equals number of white vertices. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  15. Hardness Proof Theorem Cost-bound Topologially Safe Snapping is NP -complete. Sketch of proof: • Combine gadgets according to formula-graphs structure. • Cost-bound c min equals number of white vertices. • If total movement cost equals c min , truth-assignment is obtained from assignment vertices. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  16. Hardness Proof Theorem Cost-bound Topologially Safe Snapping is NP -complete. Sketch of proof: • Combine gadgets according to formula-graphs structure. • Cost-bound c min equals number of white vertices. • If total movement cost equals c min , truth-assignment is obtained from assignment vertices. • If the formula is unsatisfiable, at least one black vertex has to be moved ⇒ c min is exceeded. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  17. Other results Corollary Topologially Safe Snapping is also NP -hard when using Euclidean distance. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  18. Other results Corollary Topologially Safe Snapping is also NP -hard when using Euclidean distance. In this case it is also NP -hard to minimize the maximum movement instead of the sum. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  19. Other results Corollary Topologially Safe Snapping is also NP -hard when using Euclidean distance. In this case it is also NP -hard to minimize the maximum movement instead of the sum. Corollary Euclidean Topologially Safe Snapping with the objective to minimize maximum movement is A PX -hard. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  20. Integer Linear Program

  21. Overview Things to handle: Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  22. Overview Things to handle: • Unique vertex coordinates Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  23. Overview Things to handle: • Unique vertex coordinates (very simple) Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  24. Overview Things to handle: • Unique vertex coordinates (very simple) • Planarity Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  25. Overview Things to handle: • Unique vertex coordinates (very simple) • Planarity • Embeddings Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  26. Overview Things to handle: • Unique vertex coordinates (very simple) • Planarity • Embeddings Basics: Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  27. Overview Things to handle: • Unique vertex coordinates (very simple) • Planarity • Embeddings Basics: • x v , y v are output coordinates. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  28. Overview Things to handle: • Unique vertex coordinates (very simple) • Planarity • Embeddings Basics: • x v , y v are output coordinates. • Objective function: � Minimize ( | x v − X v | + | y v − Y v | ) v ∈ V Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  29. Overview Things to handle: • Unique vertex coordinates (very simple) • Planarity • Embeddings Basics: • x v , y v are output coordinates. • Objective function: � Minimize ( | x v − X v | + | y v − Y v | ) v ∈ V • Constraint: distinct vertex coordinates. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  30. Planarity • Similar to Metro-Map Drawing by N¨ ollenburg & Wolff. [GD ’05] Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  31. Planarity • Similar to Metro-Map Drawing by N¨ ollenburg & Wolff. [GD ’05] • Idea: every edge has some D min -neighborhood that only incident edges are allowed to intersect. Octilinear, D min = 0 . 5 Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  32. Planarity • Similar to Metro-Map Drawing by N¨ ollenburg & Wolff. [GD ’05] • Idea: every edge has some D min -neighborhood that only incident edges are allowed to intersect. Octilinear, D min = 0 . 5 • We consider any possible direction (not only octilinear ones). Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  33. Planarity • Similar to Metro-Map Drawing by N¨ ollenburg & Wolff. [GD ’05] • Idea: every edge has some D min -neighborhood that only incident edges are allowed to intersect. Octilinear, D min = 0 . 5 • We consider any possible direction (not only octilinear ones). • According to bounding box size: 1 D min = max { X max , Y max } + 1 Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  34. Directions • Generated using the Farey sequence: Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  35. Directions • Generated using the Farey sequence: 1 / 1 1 2 / 3 1 / 2 1 / 3 0 / 1 0 0 1 Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  36. Directions • Generated using the Farey sequence: 1 / 1 1 2 / 3 1 / 2 1 / 3 0 / 1 0 0 1 Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  37. Directions • Generated using the Farey sequence: 1 / 1 1 2 / 3 1 / 2 1 / 3 0 / 1 0 0 1 • Inside [ − k , k ] × [ − k , k ] area, there are Θ( k 2 ) directions to consider. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  38. Directions • Generated using the Farey sequence: 1 / 1 1 2 / 3 1 / 2 1 / 3 0 / 1 0 0 1 • Inside [ − k , k ] × [ − k , k ] area, there are Θ( k 2 ) directions to consider. • Consider them to be ordered counter-clockwise. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  39. Embeddings • Circular order of neighbors arround any vertex must not change. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  40. Embeddings • Circular order of neighbors arround any vertex must not change. • Idea: for every vertex-neighbor pair, detect direction of that edge. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  41. Embeddings • Circular order of neighbors arround any vertex must not change. • Idea: for every vertex-neighbor pair, detect direction of that edge. • Compare direction slopes to edge slope. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  42. Embeddings • Circular order of neighbors arround any vertex must not change. • Idea: for every vertex-neighbor pair, detect direction of that edge. • Compare direction slopes to edge slope. v 2 v 1 v D Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  43. Embeddings • Circular order of neighbors arround any vertex must not change. • Idea: for every vertex-neighbor pair, detect direction of that edge. • Compare direction slopes to edge slope. v 2 v 1 v D • Map edges to directions Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  44. Embeddings • Circular order of neighbors arround any vertex must not change. • Idea: for every vertex-neighbor pair, detect direction of that edge. • Compare direction slopes to edge slope. v 2 v 1 v D • Map edges to directions and compare the ordering of those directions to the given embedding. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  45. Integer Linear Program Theorem This ILP solves Topologially Safe Snapping . Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  46. Integer Linear Program Theorem This ILP solves Topologially Safe Snapping . • In practice, our model easily becomes too large to solve (in reasonable time). Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  47. Integer Linear Program Theorem This ILP solves Topologially Safe Snapping . • In practice, our model easily becomes too large to solve (in reasonable time). • We use delayed constraint generation to iteratively improve our model. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  48. Integer Linear Program Theorem This ILP solves Topologially Safe Snapping . • In practice, our model easily becomes too large to solve (in reasonable time). • We use delayed constraint generation to iteratively improve our model. • We generate most constraints on demand: Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  49. Integer Linear Program Theorem This ILP solves Topologially Safe Snapping . • In practice, our model easily becomes too large to solve (in reasonable time). • We use delayed constraint generation to iteratively improve our model. • We generate most constraints on demand: first iteration is simple rounding (with unique coordinates). Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  50. Experimental Evaluation

  51. The Setup • Using the JAVA bindings for IBM CPLEX. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  52. The Setup • Using the JAVA bindings for IBM CPLEX. • Test system: Linux server with 16 cores (2666 MHz, 4 MB cache), 16 GB main memory. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  53. The Setup • Using the JAVA bindings for IBM CPLEX. • Test system: Linux server with 16 cores (2666 MHz, 4 MB cache), 16 GB main memory. • Numbers of rows & columns before CPLEX presolving. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  54. The Setup • Using the JAVA bindings for IBM CPLEX. • Test system: Linux server with 16 cores (2666 MHz, 4 MB cache), 16 GB main memory. • Numbers of rows & columns before CPLEX presolving. • Runtime in wall-clock time. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  55. The Setup • Using the JAVA bindings for IBM CPLEX. • Test system: Linux server with 16 cores (2666 MHz, 4 MB cache), 16 GB main memory. • Numbers of rows & columns before CPLEX presolving. • Runtime in wall-clock time. • For delayed constraint generation, time is accumulated total. Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  56. The Good Full Delayed rows cols time Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  57. The Good Full Delayed rows cols time Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  58. The Good • Even small examples take several seconds to solve. Full Delayed rows 42 699 cols 11 300 10.6 s time Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  59. The Good • Even small examples take several seconds to solve. • This is a very simple example! Full Delayed rows 42 699 cols 11 300 10.6 s time Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  60. The Good • Even small examples take several seconds to solve. • This is a very simple example! • Delayed constraint generation gives speed-up. Full Delayed rows 42 699 88 cols 11 300 110 10.6 s 0.5 s time Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

  61. The Bad Full Delayed rows cols time Andre L¨ offler, Thomas C. van Dijk, Alexander Wolff Snapping Graph Drawings to the Grid Optimally

Recommend


More recommend