Skip to main content

The Greedy Algorithm

  • Chapter

Part of the book series: Algorithms and Computation in Mathematics ((AACIM,volume 5))

Abstract

In this chapter we study a method for optimizing over certain set systems, the so-called greedy algorithm. More precisely, it is used for maximizing a weight function on so-called independence systems, the classical instance being the system of spanning forests of a graph. The greedy strategy is rather short-sighted: one always selects the element which seems best at the moment. In other words, among all the admissible elements, one chooses that with maximal weight and adds it to the solution being constructed. In general, this simple-minded strategy will not work, but for a certain class of structures playing a very important part in combinatorial optimization, the so-called matroids, it indeed leads to optimal solutions. Actually, matroids may even be characterized by the fact that the greedy algorithm works for them, but there are other possible definitions. We shall look at various other characterizations of matroids and also consider the notion of matroid duality. Following this, we will consider the greedy algorithm as an approximation method for maximization on independence systems which are not matroids. We examine the efficiency of this approach, that is, we derive bounds for the ratio between the solution given by the greedy algorithm and the optimal solution. We also look at the problem of minimization on independence systems. Finally, in the last section, we discuss some further generalizations of matroids and their relationship to the greedy algorithm.

Greed is good. Greed is right. Greed works.

From Wall Street

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   54.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   69.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD   109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    Originally, Whitney [Whi35] and van der Waerden [vandW37] (see also [vandW49] for an English edition) introduced matroids as an abstract generalization of the notions of linear and algebraic independence, respectively. In the next section, we give some other possible definitions. The generalization of the algorithm of Kruskal to matroids was found independently by [Gal68], [Wel68] and—actually a bit earlier—by Edmonds; see [Edm71]. Early forms of the underlying ideas go back even to [Bor26a] and [Rad57].

  2. 2.

    The construction of graphic matroids admits an obvious generalization to multigraphs. While this observation may, at first glance, not seem very interesting, it will be important in the context of duality.

  3. 3.

    The tail-partition matroid is defined analogously.

  4. 4.

    If edges not lying in a cycle—that is, edges belonging to just one face F—are allowed, one has to associate such edges with loops in the construction of G . It should also be noted that a planar graph may admit essentially different plane embeddings and, hence, nonisomorphic geometric duals.

  5. 5.

    Note that the greedy algorithm can yield different solutions T g for different orderings of the elements of E (which may occur if there are distinct elements having the same weight). Hence we indeed have to minimize over all T g .

  6. 6.

    This result was conjectured or even proved somewhat earlier by various other authors; see the remarks in [KorHa78].

  7. 7.

    Note that it does not make sense to apply the original version of the greedy algorithm if S is not closed under inclusion: in this case, it might happen that an element x cannot be added to the feasible set T constructed so far, because T∪{x} is not feasible; nevertheless, it might be permissible to add x at some later point to the set T′=TA. If w(x)>w(y) for some yA, the original greedy algorithm 5.1.1 would fail in this situation, as the element x would already have been dismissed. To avoid this, we simply keep the strategy of always selecting the largest available element; all that is required is a different formulation.

  8. 8.

    Characterizing greedoids in terms of the greedy algorithm requires the use of certain non-linear objective functions; see [KorLS91].

References

  1. Bachem, A., Kern, W.: Linear Programming Duality. An Introduction to Oriented Matroids. Springer, Berlin (1992)

    MATH  Google Scholar 

  2. Bjørner, A., Ziegler, G.M.: Introduction to greedoids. In: White, N. (ed.) Matroid Applications, pp. 284–357. Cambridge University Press, Cambridge (1992)

    Chapter  Google Scholar 

  3. Bjørner, A., Las Vergnas, M., Sturmfels, B., White, N., Ziegler, G.M.: Oriented Matroids. Cambridge University Press, Cambridge (1992)

    Google Scholar 

  4. Boruvka, O.: O jistém problému minimálním. Acta Soc. Sci. Nat. Morav. 3, 37–58 (1926)

    Google Scholar 

  5. Boyd, E.A., Faigle, U.: An algorithmic characterization of antimatroids. Discrete Appl. Math. 28, 197–205 (1990)

    Article  MathSciNet  MATH  Google Scholar 

  6. Bryant, V., Brooksbank, P.: Greedy algorithm compatibility and heavy-set structures. Eur. J. Comb. 13, 81–86 (1992)

    Article  MathSciNet  MATH  Google Scholar 

  7. Cunningham, W.H.: Improved bounds for matroid partition and intersection algorithms. SIAM J. Comput. 15, 948–957 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  8. Edmonds, J.: Submodular functions, matroids and certain polyhedra. In: Guy, K. (ed.) Combinatorial Structures and Their Applications, pp. 69–87. Gordon & Breach, New York (1970)

    Google Scholar 

  9. Edmonds, J.: Matroids and the greedy algorithm. Math. Program. 1, 127–136 (1971)

    Article  MathSciNet  MATH  Google Scholar 

  10. Edmonds, J.: Matroid intersection. Ann. Discrete Math. 4, 39–49 (1979)

    Article  MathSciNet  MATH  Google Scholar 

  11. Faigle, U.: The greedy algorithm for partially ordered sets. Discrete Math. 28, 153–159 (1979)

    Article  MathSciNet  MATH  Google Scholar 

  12. Faigle, U.: On ordered languages and the optimization of linear functions by greedy algorithms. J. Assoc. Comput. Mach. 32, 861–870 (1985)

    Article  MathSciNet  MATH  Google Scholar 

  13. Frank, A., Tardos, E.: Generalized polymatroids and submodular flows. Math. Program. 42, 489–563 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  14. Fujishige, S.: Submodular Functions and Optimization. North Holland, Amsterdam (1991)

    MATH  Google Scholar 

  15. Gale, D.: Optimal assignments in an ordered set: an application of matroid theory. J. Comb. Theory 4, 176–180 (1968)

    Article  MathSciNet  MATH  Google Scholar 

  16. Goecke, O.: A greedy algorithm for hereditary set systems and a generalization of the Rado-Edmonds characterization of matroids. Discrete Appl. Math. 20, 39–49 (1988)

    Article  MathSciNet  MATH  Google Scholar 

  17. Hausmann, D., Korte, B.: Algorithmic versus axiomatic definitions of matroids. Math. Program. Stud. 14, 98–111 (1981)

    Article  MathSciNet  MATH  Google Scholar 

  18. Helman, P., Mont, B.M.E., Shapiro, H.D.: An exact characterization of greedy structures. SIAM J. Discrete Math. 6, 274–283 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  19. Jenkyns, T.A.: The efficacy of the ‘greedy’ algorithm. In: Proc. 7th Southeastern Conf. Combinatorics, Graph Theory and Computing, pp. 341–350 (1976)

    Google Scholar 

  20. Korte, B., Hausmann, D.: An analysis of the greedy heuristic for independence systems. Ann. Discrete Math. 2, 65–74 (1978)

    Article  MathSciNet  MATH  Google Scholar 

  21. Korte, B., Lovász, L.: Mathematical structures underlying greedy algorithms. In: Gécseg, F. (ed.) Fundamentals of Computation Theory, pp. 205–209. Springer, Berlin (1981)

    Chapter  Google Scholar 

  22. Korte, B., Lovász, L., Schrader, R.: Greedoids. Springer, Berlin (1991)

    Book  MATH  Google Scholar 

  23. Kruskal, J.B.: On the shortest spanning subtree of a graph and the travelling salesman problem. Proc. Am. Math. Soc. 7, 48–50 (1956)

    Article  MathSciNet  MATH  Google Scholar 

  24. Lawler, E.L.: Matroid intersection algorithms. Math. Program. 9, 31–56 (1975)

    Article  MathSciNet  MATH  Google Scholar 

  25. Lawler, E.L.: Combinatorial Optimization: Networks and Matriods. Holt, Rinehart and Winston, New York (1976)

    Google Scholar 

  26. Lehman, A.: A solution of the Shannon switching game. SIAM J. Appl. Math. 12, 687–725 (1964)

    Article  MathSciNet  MATH  Google Scholar 

  27. Minty, G.J.: On the axiomatic foundations of the theories of directed linear graphs, electrical networks and network programming. J. Math. Mech. 15, 485–520 (1966)

    MathSciNet  MATH  Google Scholar 

  28. Oxley, J.G.: Matroid Theory. Oxford University Press, Oxford (1992)

    MATH  Google Scholar 

  29. Pym, J.S., Perfect, H.: Submodular functions and independence structures. J. Math. Anal. Appl. 30, 1–31 (1970)

    Article  MathSciNet  MATH  Google Scholar 

  30. Qi, L.: Directed submodularity, ditroids and directed submodular flows. Math. Program. 42, 579–599 (1988)

    Article  MATH  Google Scholar 

  31. Rado, R.: Note on independence functions. Proc. Lond. Math. Soc. 7, 300–320 (1957)

    Article  MathSciNet  MATH  Google Scholar 

  32. Recski, A.: Matroid Theory and Its Applications. Springer, Berlin (1989)

    Google Scholar 

  33. Reingold, E.M., Tarjan, R.E.: On a greedy heuristic for complete matching. SIAM J. Comput. 10, 676–681 (1981)

    Article  MathSciNet  MATH  Google Scholar 

  34. Tutte, W.T.: Introduction to the Theory of Matroids. Elsevier, New York (1971)

    MATH  Google Scholar 

  35. van der Waerden, B.L.: Moderne Algebra, 2nd edn. Springer, Berlin (1937)

    Google Scholar 

  36. van der Waerden, B.L.: Modern Algebra, Vol. I. Frederick Ungar, New York (1949) (translated from the 2nd revised German edition by Fred Blum, with revisions and additions by the author)

    MATH  Google Scholar 

  37. Welsh, D.J.A.: Kruskal’s theorem for matroids. Proc. Camb. Philos. Soc. 64, 3–4 (1968)

    Article  MathSciNet  MATH  Google Scholar 

  38. Welsh, D.J.A.: Matroid Theory. Academic Press, New York (1976)

    MATH  Google Scholar 

  39. White, N. (ed.): Theory of Matroids. Cambridge University Press, Cambridge (1986)

    MATH  Google Scholar 

  40. White, N. (ed.): Combinatorial Geometries. Cambridge University Press, Cambridge (1987)

    MATH  Google Scholar 

  41. White, N. (ed.): Matroid Applications. Cambridge University Press, Cambridge (1992)

    MATH  Google Scholar 

  42. Whitney, H.: Planar graphs. Fundam. Math. 21, 73–84 (1933)

    Google Scholar 

  43. Whitney, H.: On the abstract properties of linear dependence. Am. J. Math. 57, 509–533 (1935)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Jungnickel, D. (2013). The Greedy Algorithm. In: Graphs, Networks and Algorithms. Algorithms and Computation in Mathematics, vol 5. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-32278-5_5

Download citation

Publish with us

Policies and ethics