cs270 project overview maximum planar subgraph danyel fisher jason hong greg lawrence jimmy lin
TRANSCRIPT
CS270 Project Overview
Maximum Planar Subgraph
Danyel FisherJason Hong
Greg LawrenceJimmy Lin
Overview
• What is Maximum Planar Subgraph?• Our approximation approaches• Implementation• Results• Comparison with existing
approximations• Conclusions
Maximum Planar Subgraph
• Input:– a graph G = (V, E)
• Output:– a planar subgraph of G of maximum size
(#edges)
• Why is it useful?– circuit layout– graph drawing
Metrics
• Performance Ratio
• Max #edges in planar graph is 3|V| - 6• Elapsed Time
approx #edges optimal #edges=
Implementation
• Microsoft Visual C++ 6.0• C++ Package LEDA
– Library of Efficient Data types and Algorithms
– Max-Planck-Institut für Informatik in Saarbrücken
– Used Graph data structure and planarity test (linear time)
• Pentium II 300MHz, NT 4.0 • Drinks
Test Set
• Randomly generate graphs– G(n,p)
•n is #nodes •p is probability an edge exists between two nodes
– Originally generated ~4500 graphs• Too slow, not enough computing power• Extra data didn’t seem useful
– Culled down to 273 graphs• Nodes range from 5 to 195• Probabilities 1%, 4%, 7%, 10%, 13%, 16%, 19%, 22%
Our Approximation Approaches
• Approximation Approaches– Randomly remove edges until planar– Randomly add edges until nonplanar– Spanning Tree– Spanning Tree + randomly add edges– Force-directed placement– Simulated annealing
Random
• Algorithm for random removewhile (g is not planar) {
remove a random edge from g
}
• Algorithm for random addlet g’ = (V, )
//// Stop on first failure.
while (g’ is planar) {
randomly choose an edge from g
add that edge to g'
}
Results of Random
• O(EV+E2)– Check for planarity O(V + E)– Remove up to E edges
• Results– Ran each trial 5 times
• Used max of resulting #edges• Used sum of time
– Performance Ratios both 1/3
Spanning Tree
• Spanning Tree– Output any spanning tree of graph G– Performance ratio at least 1/3 of optimal
• For |V| vertices, |V-1| edges for spanning tree•
• Spanning Tree + Random Add– Start with Spanning Tree– Call Random Add method
|V-1|3|V|-6
13
Results of Spanning Tree
• Spanning Tree– Running time is O(V + E)– Empirical running time is around 10ms– Performance Ratio ~1/3
• Spanning Tree + Random Add– Performance Ratio slightly better (36%)
Force-Directed Placement
• Find low-energy configuration– Should be well distributed
• High degree nodes should be internal• Low degree nodes should be out of the way
• Assign initial (random) placement• Connect every pair of nodes by spring
– An edge implies short spring– No edge implies long spring– Energy is set to Euclidean distance
Force-Directed Placement
• Find edge crossings– Remove edge with most crossings
• But relaxation is expensive– Too many iterations: so we cut the top 5% or
2.5% of edges each relaxation
• There are some bad minima:– Requires random shakeup
• Good but slow– empirically ~50% of optimal– ~30 hours for ~270 graphs
Alternative Force-Directed
Simulated Annealing
• Assign initial (random) placement• Cost function: number of edge
crossings in the graph• Neighbor: move the position of a single
node to a random location• Probability of making a move
– P(C) = e(-C/T) [C is the number of crossings]
– Cool down the system by decreasing T
Simulated Annealing
• Next, make the graph planar– Remove edge with the greatest number of
crossings– Continue trying to make improvements by
examining neighbor states– Repeat until planar
• Veerrrryyyyy Sloooooowwwwww – ~2 hours for a “small” graph (~300 edges)– Too slow, not completed
Results
• Randomly adding/deleting edges 1/3• Spanning tree: Effectiveness = 1/3• Force Directed Placement ~ 1/2
– Slow
• Simulated Annealing 1/2– Veerrrryyyyy Sloooooowwwwww
Comparison with other Projects
• Max Triangular Cactus– Performance Ratio 4/9 =44.4%
• Other algorithms– Performance Ratio 1/3 worst case
• Other heuristics– In practice, around 50%
Conclusions
• Randomly removing or adding edges does not work well
• Spanning tree has best bang-for-buck• Force-directed placement has good
results, but slow• Preliminary simulated annealing results
look promising, but very slow
Questions?
Existing Approaches
• Spanning Tree– Output any spanning tree of graph G– Performance ratio 1/3 of optimal size
• Maximal Planar Subgraph– Output any planar subgraph that cannot
have any edges added to it– Performance ratio 1/3 of optimal size
• Branch and Cut– Exponential amount of time!
Existing Approaches (cont.)
• Lots of other techniques– Worst case performance = 1/3– Enhancing a spanning tree with cycles– Finding maximum cycles– PQ-Trees
• Some other more complex algorithms– Performance ratio 1/3 of optimal size– Simpler approximations better than
complex?!
Newer Approaches
• Triangles Everywhere! [Calinescu et al 1998]– Find as many triangles as possible until we
have a spanning subgraph (greedy)– Connect the components together– Performance ratio 7/18 of optimal size
Newer Approaches (cont.)
• Maximize the Cactus! [Calinescu et al 1998]– In cactus, cycles are triangles and all
edges are in some cycle– Find Max Triangular Cactus (linear
algorithm)– Connect triangles together– Performance ratio 4/9 of optimal size