Errol Lloyd Design and Analysis of Algorithms Approximation

  • Slides: 24
Download presentation
Errol Lloyd Design and Analysis of Algorithms Approximation Algorithms for NP-complete Problems Bin Packing

Errol Lloyd Design and Analysis of Algorithms Approximation Algorithms for NP-complete Problems Bin Packing Computer Networks

What is bin packing? Given Objective n unlimited supply of bins (capacity 1) n

What is bin packing? Given Objective n unlimited supply of bins (capacity 1) n Items of sizes s 1, s 2, … sn 0 < si < 1 Pack the items into a minimum number of bins Restated Assign each item to a bin such that: • Number of nonempty bins is minimized • For each bin B, the sum of the sizes of the items in B does not exceed 1 . 5 . 67 . 25 . 33 . 4 . 2 . 4 . 75 . 3 2

Approximation Methods One difficulty: Bin packing is NP-complete n Cannot guarantee optimal packings in

Approximation Methods One difficulty: Bin packing is NP-complete n Cannot guarantee optimal packings in polynomial time (unless P = NP) Settle for: Packings that are close to optimal n n What is close? No more than a constant factor larger than optimal. Example: Packings using twice as many bins as optimal. 3

Any Fit Packing n n . 5 Open one bin for each item Si

Any Fit Packing n n . 5 Open one bin for each item Si if there is an open bin where Si will fit then place Si into that bin else open a new bin place Si into that new bin . 67 . 33. 5 . 25 . 33 . 25. 67 . 4 . 2. 2. 2. 4 . 2 . 4 . 3. 4 Recall: Optimal used 4 bins . 75 . 3 . 75 4

How bad can Any Fit be? How many bins might Any Fit use compared

How bad can Any Fit be? How many bins might Any Fit use compared with optimal? n Items: 18 items of size 1/2 18 items of size 1/18 Any Fit packing is 1. 8 times optimal Examples exist with Any Fit up to 2 times optimal 5

Can Any Fit do worse than 2*optimal? optimal packing uses at least b/2 bins

Can Any Fit do worse than 2*optimal? optimal packing uses at least b/2 bins Any Fit never uses more than twice optimal bins Competitive Ratio of Any Fit: 2 Running time of Any Fit: O(n log n) 6

First Fit n n Open one bin for each item Si if there is

First Fit n n Open one bin for each item Si if there is an open bin where Si will fit then place Si into the leftmost such bin else open a new bin place Si into that new bin . 5 . 67 . 2. 25. 5 . 25 . 33. 67 . 33 . 4 . 2 . 4 . 75 . 3 . 4. 2. 4 Competitive Ratio of First Fit: 1. 7 Running Time: O(n log n) 7

First Fit Decreasing A really good bin packing algorithm n n Sort the items

First Fit Decreasing A really good bin packing algorithm n n Sort the items in decreasing order by size Do a First Fit Packing using that sorted list . 75 . 67 . 25. 75 . 5. 33. 67 . 4. 33. 4. 5 . 3. 25. 2. 3. 4 . 2 . 2 Competitive Ratio: 11/9 (i. e. 1. 2222…) Running Time: O(n log n) [Johnson, Demers, Ullman, Garey, Graham, 1974] Looooong proof (originally 100+ pages) 8

Changing the Rules – Fully Dynamic Bin Packing n n n NOT given the

Changing the Rules – Fully Dynamic Bin Packing n n n NOT given the items all at once Instead: given items one at a time – INSERTs (DELETES) Upon an INSERT/DELETE, update the packing NO apriori limitations on this update – the contents of the bins may be changed at will. 5 n n . 67 . 25 . 33 Maintain a good packing at all times O(log n) time per INSERT/DELETE (to update) So, n INSERTs in O(n log n) time 9

Mostly Myopic Packing (MMP) A fully dynamic bin packing algorithm MMP Competitive Ratio: 5/4

Mostly Myopic Packing (MMP) A fully dynamic bin packing algorithm MMP Competitive Ratio: 5/4 = 1. 25 Looong proof MMP running time: O(log n) per INSERT or DELETE O(n log n) for sequence of n INSERT/DELETEs 10

Some bin packing papers n n n Z. Ivkovich and E. L. Lloyd, "Fully

Some bin packing papers n n n Z. Ivkovich and E. L. Lloyd, "Fully dynamic algorithms for bin packing: Being mostly myopic helps, " SIAM Journal on Computing, 28(1998), 574 -611. Z. Ivkovich and E. L. Lloyd, "Partially dynamic bin packing can be solved within 1+e in (amortized) polylogarithmic time", Information Processing Letters 63(1997), 45 -50. Z. Ivkovich and E. L. Lloyd, "A fundamental restriction on fully dynamic maintenance of bin packing, " Information Processing Letters, 59(1996), 229 -232. 11

Topology Control for Ad-hoc Networks n What is an ad hoc network? n A

Topology Control for Ad-hoc Networks n What is an ad hoc network? n A collection of nodes that communicate with one another over a wireless medium 12

Applications n n n Military environments Search and rescue Sensor networks 13

Applications n n n Military environments Search and rescue Sensor networks 13

Topology n What is the topology of an ad hoc network? IETF MANET Group

Topology n What is the topology of an ad hoc network? IETF MANET Group Definition: The topology of the network is described by a graph G = (V, E), where V is the set of nodes and E is the set of links in the network. High Low. Transmission. Power l l High channel contention Partition l High power consumption l Low throughput 14

Why topology control? n Desirable topology & minimize energy consumption n Topology property guarantee

Why topology control? n Desirable topology & minimize energy consumption n Topology property guarantee implies: n n Improving network survivability, performance, etc Lower transmission power implies: n n Conserving battery power Increasing spatial frequency reuse 15

A formal definition n n Input: Nodes, power thresholds and a graph property n

A formal definition n n Input: Nodes, power thresholds and a graph property n Power threshold for x and y: Min power for a signal from x to reach y Output: A power assignment f(u) for each node u, s. t. the induced graph satisfies the specified graph property, and that minimizes: n Maxu(f(u)) (Max Power) OR n Sumu(f(u)) (Total Power) 16

Minimizing Max Power Gave a general framework to compute an optimal solution in polynomial

Minimizing Max Power Gave a general framework to compute an optimal solution in polynomial time for <P, Max power> where P is monotone and efficiently testable Monotone property: Property unaffected by edge additions n n Monotone: Non-monotone: 1 -connectivity Tree n <1 -connected, Max Power> in O(n 2 logn) n <Diameter K, Max Power> in O(n 3 logn) 17

Two related problems n What if a property is non-monotone? n Property: “Tree” n

Two related problems n What if a property is non-monotone? n Property: “Tree” n Complexity: NP-complete: n n n even with only three power thresholds even if the minimization objective is dropped! Can number of nodes using max power be minimized? n NP-complete even for the “ 1 -Connected” property n Approximation algorithm with: n n Competitive Ratio: Running time: 5/3 O(n e a(n)) 18

Minimizing Total Power n n Problems are NP-complete, even <1 -connected, Total Power> Developed

Minimizing Total Power n n Problems are NP-complete, even <1 -connected, Total Power> Developed a general approximation framework for monotone and efficiently testable properties <2 -connected, Total Power> Competitive ratio: 2(2 -2/n)(2+1/n) 19

Experimental results Implemented and compared: n n the approximation algorithm for <2 -connected, Total

Experimental results Implemented and compared: n n the approximation algorithm for <2 -connected, Total Power> the exact algorithm for <2 -connected, Max Power> 20

TRANSIMS networks n n Area 1 n n n Area 2 n TRANSIMS project

TRANSIMS networks n n Area 1 n n n Area 2 n TRANSIMS project of LANL and IBM Traffic in the Portland, OR metropolitan area 1716 nodes in a 3 x 3 km 2 area Uniform transmission range of 75 meters Area 1: 1 km x 1 km, 284 nodes Area 2: 0. 6 km x 1. 65 km, 271 nodes 21

TRANSIMS networks Area 1 Max Range Avg. Range Max Degree Avg. Degree Max. P

TRANSIMS networks Area 1 Max Range Avg. Range Max Degree Avg. Degree Max. P 158 m 67. 75 m 12 4. 80 Total. P 193 m 55. 07 m 5 2. 72 Avg. Range Max Degree Avg. Degree Area 2 Max Range Max. P 153 m 73. 59 m 28 7. 94 Total. P 222 m 51. 95 m 7 2. 73 Area 2 22

Some topology control papers n "Algorithmic aspects of topology control problems for ad hoc

Some topology control papers n "Algorithmic aspects of topology control problems for ad hoc networks, " Mobi. Hoc 2002, 123 -134 (E. Lloyd, M. Marathe, R. Ramanathan, S. S. Ravi, and R. Liu). To appear in the ACM journal MONET. n "Topology control problems under symmetric and asymmetric power thresholds, " ADHOCNOW'03 (S. Krumke, R. Liu, E. Lloyd, M. Marathe, R. Ramanathan, S. S. Ravi). n "CLTC: A cluster-based topology control framework for ad-hoc networks, " IEEE Transactions on Mobile Computing, (C. -C. Shen, C. Srisathatpornphat, R. Liu, E. Lloyd, Z. Huang, C. Jaikaeo). 23

Additional Information www. cis. udel. edu/~elloyd 24

Additional Information www. cis. udel. edu/~elloyd 24