CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

31
CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin

Transcript of CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

Page 1: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

CS270 Project Overview

Maximum Planar Subgraph

Danyel FisherJason Hong

Greg LawrenceJimmy Lin

Page 2: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

Overview

• What is Maximum Planar Subgraph?• Our approximation approaches• Implementation• Results• Comparison with existing

approximations• Conclusions

Page 3: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 4: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

Metrics

• Performance Ratio

• Max #edges in planar graph is 3|V| - 6• Elapsed Time

approx #edges optimal #edges=

Page 5: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 6: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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%

Page 7: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 8: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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'

}

Page 9: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 10: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.
Page 11: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 12: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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%)

Page 13: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.
Page 14: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.
Page 15: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 16: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 17: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.
Page 18: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.
Page 19: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

Alternative Force-Directed

Page 20: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 21: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 22: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.
Page 23: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.
Page 24: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

Results

• Randomly adding/deleting edges 1/3• Spanning tree: Effectiveness = 1/3• Force Directed Placement ~ 1/2

– Slow

• Simulated Annealing 1/2– Veerrrryyyyy Sloooooowwwwww

Page 25: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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%

Page 26: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 27: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

Questions?

Page 28: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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!

Page 29: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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?!

Page 30: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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

Page 31: CS270 Project Overview Maximum Planar Subgraph Danyel Fisher Jason Hong Greg Lawrence Jimmy Lin.

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