1 / 18

Algoritmi on-line e risoluzione di problemi complessi

Algoritmi on-line e risoluzione di problemi complessi. Carlo Fantozzi (carlo.fantozzi@dei.unipd.it). Summary & Caveats. From Professor Ausiello’s course Structure of the talk: approximation algorithms (core) on-line algorithms (a few words) 16:1 compression ratio!

jerzy
Download Presentation

Algoritmi on-line e risoluzione di problemi complessi

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Algoritmi on-line e risoluzione di problemi complessi Carlo Fantozzi(carlo.fantozzi@dei.unipd.it)

  2. Summary & Caveats • From Professor Ausiello’s course • Structure of the talk: • approximation algorithms (core) • on-line algorithms (a few words) • 16:1 compression ratio! • Heterogeneous audience (& dumb speaker) • No details: only the framework of the course

  3. Complexity Theory • What is efficiently computable? • Efficient = “Polynomial time” • Decision problems: yes/no answer • The P class: poly-time solution • The NP class: poly-time verification • Poly-time (Karp) reductions • NP-hard problems • NP-complete problems • P  NP; is it also P=NP?

  4. Optimization problems • Optimization problem: a quadruple • Set of instances I • Set of feasible solutions S • Cost function m(x,y), x I, yS • min/MAX • We are interested in optimal solutions • Example: min vertex cover

  5. Optimization: 3 Approaches • Decision problem:“is there a solution with cost m? m?” • Evaluation problem:“find optimal value of cost function” • Constructive optimization problem:“find the optimal solution” • Approaches are not (proved to be) equivalent. • They are equivalent whenever the decision problem is NP-complete.

  6. Complexity Revised (1) • Solutions have polynomial size • Cost function computable in poly time • PO class: poly-time algorithm returns optimal solution and optimal cost • NPO class: poly-time verification alg. for feasible solutions • PO  NPO; is it also PO=NPO?

  7. Complexity Revised (2) • Poly-time Turing reductions;P1 T P2 if there exists an algorithm for P1 which queries an oracle for P2 • NP-hard optimization problem:every decision problem is T-reducible to it in poly time • PO=NPO if and only if P=NP:do not hope for poly-time algs…

  8. Approximation Algs (1) • Poly-time algs that give approx solutions • Guaranteed performance (1970s):maximum “distance” from optimumover all problem instances • Absolute approximation:cost within an additive constant from opt. • Relative error:E(x,y)=|opt(x)-m(x,y)|/MAX{opt(x),m(x,y)} • Performance ratio:R(x,y)=MAX{m(x,y)/opt(x),opt(x)/m(x,y)}

  9. Approximation Algs (2) • r-approximate algorithm: R(x,y)r x,i.e. cost is at most r times the optimum • Example: min vertex cover (NP-hard) • Pick an edge • Include nodes of the edge into the cover • Remove nodes from the graph; repeat • Greedy algorithm is 2-approximate

  10. Approximation classes • Sometimes things are not so easy • Some problems are “more approximable” than others • Many approximation classes exist • The APX class • The PTAS class • The FPTAS class • These classes form a hierarchy if PNP

  11. The APX class • Class of all NPO problems that admit a poly-time r-approximate algorithm • The general TSP is not in the APX class (unless P=NP) • The metric TSP is in the APX class (best algorithm: Cristofides', with a 3/2 performance ratio)

  12. The PTAS class • Class of NPO problems that admita poly-time approximation scheme • An approximaxion scheme is a tunable alg:can trade running time for performance • An algorithm is a PTAS for P if it gives anr-approx. solution in poly time for anyr>1 • The metric TSP is not in the PTAS class:no (129/128)-approximate algorithm exists • The Euclidean TSP is in the PTAS class

  13. The FPTAS class • The approximation scheme must bepolynomial in both |x| and r • Problems in this class are optimally solvable for most practical purposes • The Euclidean TSP is not in FPTAS • Maximum Knapsack is in FPTAS • Not many problems belong to FPTAS

  14. Class Hierarchy NPO e.g. TSP APX e.g. MTSP PTAS e.g. ETSP FPTAS e.g. Knapsack

  15. Approximation Techniques • Greedy approach • Linear programming • Dynamic programming • Randomization • Computational geometry • A compendium of NPO problems: http://www.nada.kth.se/~viggo/wwwcompendium/

  16. On-Line Algorithms • An on-line algorithm • does not know entire input in advance • must take a decision each time it receivesan input piece; each decision has a cost • total cost must be maximized/minimized • The constraint on the input makes these optimization problems much more difficult! • Off-line algorithm:knows entire input as usual

  17. Performance Evaluation • Competitive analysis: compareon-line solution & optimal off-line sol. • On-line algorithm A is c-competitiveif there exists a constant a such that • Worst-case analysis: A may performmuch better on real-world inputs mA(x) cmOPT(x)+ax

  18. Examples • Ski rental problem: for how long should a novice skier rent skis before buying? • Buy when the total cost of rental becomes higher than the cost of skis • Greedy strategy is 2-competitive • Task scheduling problem • Graham’s algorithm (1966): assign new task to the less loaded processor • Greedy strategy is (2-1/p)-competitiveif the durations of tasks are known in advance

More Related