Skip to main content

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

Abstract

In this chapter, we show in an intuitive manner what an algorithm is and develop a way to measure the quality of algorithms. In particular, we consider some basic aspects of graph theoretic algorithms such as, for example, the problem of how to represent a graph. Moreover, we need a way to formulate the algorithms we deal with. We shall illustrate and study these concepts quite thoroughly using two specific examples, namely Euler tours and acyclic digraphs. At the end of the chapter we consider a class of apparently very difficult problems (the so-called NP-complete problems) which plays a central role in complexity theory; we will meet this type of problem over and over again in this book.

If to do were as easy as to know what were good to do…

William Shakespeare

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

Access this chapter

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

Institutional subscriptions

Notes

  1. 1.

    It is probably because of this aspect of mechanical practicability that some people doubt if algorithms are really a part of mathematics. I think this is a misunderstanding: performing an algorithm in practice does not belong to mathematics, but development and analysis of algorithms—including the translation into a program—do. Like Lüneburg, I am of the opinion that treating a problem algorithmically means understanding it more thoroughly.

  2. 2.

    In most cases, we will not require this property.

  3. 3.

    We can check whether a graph is connected with the BFS technique presented in Sect. 3.3.

  4. 4.

    The problem of generating permutations of a given set can be formulated in a graph theoretic way, see Exercise 2.1.3. Algorithms for this are given in [NijWi78] and [Eve73].

  5. 5.

    This statement refers only to the representation of graphs in algorithms in general. For each concrete algorithm, we still have to check whether this substitution makes sense. For example, we always get directed cycles by this approach.

  6. 6.

    How difficult it really is to deal with such a distribution can be seen in the probabilistic analysis of the simplex algorithm, cf. [Bor87].

  7. 7.

    We write \(\overline{p}\) for the negation of the logical variable p, p+q for the disjunction p or q, and pq for the conjunction p and q. The \(x'_{i}\) are called literals, the C i are clauses.

  8. 8.

    We may solve an evaluation problem quite efficiently by repeated calls of the associated decision problem, if we use a binary search. But in general, we do not know how to find an optimal solution just from its value. However, in problems from graph theory, it is often sufficient to know that the value of an optimal solution can be determined polynomially. For example, for the TSP we would check in polynomial time whether there is an optimal solution not containing a given edge. In this way we can find an optimal tour by sequentially using the algorithm for the evaluation problem a linear number of times.

  9. 9.

    To be formally correct, we would have to state how an instance of a problem is coded (so that the length of the input data could be measured) and what an algorithm is. This can be done by using the concept of a Turing machine introduced by [Tur36]. For detailed expositions of complexity theory, we refer to [GarJo79, LewPa81], and [Pap94].

  10. 10.

    Note that no analogous certificate is known for the question whether a graph is not Hamiltonian.

  11. 11.

    Thus, for NP as well as for Co-NP, we look at a kind of oracle which presents some (positive or negative) answer to us; and this answer has to be verifiable in polynomial time.

  12. 12.

    Thus we can presumably read NP also as non-polynomial. However, one also finds the opposite conjecture P = NP (along with some incorrect attempts at proving this claim) and the suggestion that the problem might be undecidable.

References

  1. Aho, A.V., Hopcroft, J.E., Ullman, J.D.: The Design and Analysis of Computer Algorithms. Addison Wesley, Reading (1974)

    MATH  Google Scholar 

  2. Aho, A.V., Hopcroft, J.E., Ullman, J.D.: Data Structures and Algorithms. Addison Wesley, Reading (1983)

    MATH  Google Scholar 

  3. Arora, S., Barak, B.: Computational Complexity. A Modern Approach. Cambridge University Press, Cambridge (2009)

    Book  MATH  Google Scholar 

  4. Bäbler, F.: Über eine spezielle Klasse Eulerscher Graphen. Comment. Math. Helv. 21, 81–100 (1953)

    Article  Google Scholar 

  5. Bauer, F.L., Wössner, H.: Algorithmic Language and Program Development. Springer, Berlin (1982)

    Book  MATH  Google Scholar 

  6. Biggs, N.L.: Algebraic Graph Theory, 2nd edn. Cambridge University Press, Cambridge (1993)

    Google Scholar 

  7. Book, R.V.: Relativizations of the P =? NP and other problems: developments in structural complexity theory. SIAM Rev. 36, 157–175 (1994)

    Article  MATH  MathSciNet  Google Scholar 

  8. Borgwardt, K.H.: The Simplex Method. A Probabilistic Analysis. Springer, Berlin (1987)

    MATH  Google Scholar 

  9. Burkard, R.E.: Efficiently solvable special cases of hard combinatorial optimization problems. Math. Program. 79, 55–69 (1997)

    MATH  MathSciNet  Google Scholar 

  10. Burkard, R.E., Deineko, V.G., van Dal, R., van der Veen, J.A.A., Woeginger, G.J.: Well-solvable special cases of the traveling salesman problem: a survey. SIAM Rev. 40, 496–546 (1998)

    Article  MATH  MathSciNet  Google Scholar 

  11. Cameron, P.J., van Lint, J.H.: Designs, Graphs, Codes and Their Links. Cambridge University Press, Cambridge (1991)

    Book  MATH  Google Scholar 

  12. Chartrand, G., White, A.T.: Randomly transversable graphs. Elem. Math. 25, 101–107 (1970)

    MATH  MathSciNet  Google Scholar 

  13. Cook, S.A.: The complexity of theorem proving procedures. In: Proc. 3rd ACM Symp. on the Theory of Computing, pp. 151–158 (1971)

    Google Scholar 

  14. Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press, Cambridge (2009)

    MATH  Google Scholar 

  15. Cvetkovic, D.M., Doob, M., Sachs, H.: Spectra of Graphs. Academic Press, New York (1980)

    Google Scholar 

  16. Cvetkovic, D.M., Doob, M., Gutman, I., Torgasev, A.: Recent Results in the Theory of Graph Spectra. North Holland, New York (1987)

    Google Scholar 

  17. de Bruijn, N.G.: A combinatorial problem. Indag. Math. 8, 461–467 (1946)

    Google Scholar 

  18. Edmonds, J.: Paths, trees and flowers. Can. J. Math. 17, 449–467 (1965)

    Article  MATH  MathSciNet  Google Scholar 

  19. Etzion, T.: An algorithm for constructing m-ary de Bruijn sequences. J. Algorithms 7, 331–340 (1986)

    Article  MATH  MathSciNet  Google Scholar 

  20. Even, S.: Combinatorial Algorithms. Macmillan, New York (1973)

    Google Scholar 

  21. Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NP-Completeness. Freeman, New York (1979)

    MATH  Google Scholar 

  22. Golomb, S.W.: Shift Register Sequences. Holden-Day, San Francisco (1967)

    MATH  Google Scholar 

  23. Hierholzer, C.: Über die Möglichkeit, einen Linienzug ohne Wiederholung und ohne Unterbrechung zu umfahren. Math. Ann. 6, 30–32 (1873)

    Article  MATH  MathSciNet  Google Scholar 

  24. Hopcroft, J., Ullman, J.D.: Introduction to Automata Theory, Languages and Computation. Addison Wesley, Reading (1979)

    MATH  Google Scholar 

  25. Jensen, K., Wirth, N.: PASCAL User Manual and Report, 3rd edn. Springer, New York (1985)

    Book  MATH  Google Scholar 

  26. Jungnickel, D.: Finite Fields. B.I. Wissenschaftsverlag, Mannheim (1993)

    MATH  Google Scholar 

  27. Kahn, A.B.: Topological sorting of large networks. Commun. ACM 5, 558–562 (1962)

    Article  MATH  Google Scholar 

  28. Karp, R.M.: Reducibility among combinatorial problems. In: Miller, R.E., Thatcher, J.W. (eds.) Complexity of Computer Computations, pp. 85–103. Plenum Press, New York (1972)

    Chapter  Google Scholar 

  29. Khuller, S.: Design and Analysis of Algorithms: Course Notes. Dept. of Computer Science, University of Maryland

    Google Scholar 

  30. Korte, B., Vygen, J.: Combinatorial Optimization. Theory and Algorithms, 5th edn. Springer, Berlin (2012)

    Google Scholar 

  31. Lewis, H.R., Papadimitriou, C.H.: Elements of the Theory of Computation. Prentice Hall, Englewood Cliffs (1981)

    MATH  Google Scholar 

  32. Lüneburg, H.: Programmbeispiele aus Algebra, Zahlentheorie und Kombinatorik. Report, Universität Kaiserslautern (1982)

    Google Scholar 

  33. MacWilliams, F.J., Sloane, N.J.A.: The Theory of Error-Correcting Codes. North Holland, Amsterdam (1977)

    MATH  Google Scholar 

  34. Mehlhorn, K.: Data Structures and Algorithms. Springer, Berlin (1984)

    Google Scholar 

  35. Mohar, B., Poljak, S.: Eigenvalues in combinatorial optimization. In: Brualdi, R., Friedland, S., Klee, V. (eds.) Combinatorial and Graph-Theoretic Problems in Linear Algebra, pp. 107–151. Springer, New York (1993)

    Chapter  Google Scholar 

  36. Nijenhuis, A., Wilf, H.S.: Combinatorial Algorithms, 2nd edn. Academic Press, New York (1978)

    MATH  Google Scholar 

  37. Ore, O.: A problem regarding the tracing of graphs. Elem. Math. 6, 49–53 (1951)

    MATH  MathSciNet  Google Scholar 

  38. Papadimitriou, C.H.: Computational Complexity. Addison-Wesley, Reading (1994)

    MATH  Google Scholar 

  39. Papadimitriou, C.H., Steiglitz, K.: Combinatorial Optimization: Algorithms and Complexity. Prentice Hall, Englewood Cliffs (1982)

    MATH  Google Scholar 

  40. Ralston, A.: A new memoryless algorithm for de Bruijn sequences. J. Algorithms 2, 50–62 (1981)

    Article  MATH  MathSciNet  Google Scholar 

  41. Rueppel, R.: Analysis and Design of Stream Ciphers. Springer, New York (1986)

    Book  MATH  Google Scholar 

  42. Schwenk, A.J., Wilson, R.: On the eigenvalues of a graph. In: Beineke, L., Wilson, R. (eds.) Selected Topics in Graph Theory, pp. 307–336. Academic Press, London (1978)

    Google Scholar 

  43. Sipser, K.: Introduction to the Theory of Computation, 2nd edn. Thompson, Boston (2006)

    MATH  Google Scholar 

  44. Syslo, M.M., Deo, N., Kowalik, J.S.: Discrete Optimization Algorithms. Prentice Hall, Englewood Cliffs (1983)

    MATH  Google Scholar 

  45. Turing, A.M.: On computable numbers, with an application to the Entscheidungsproblem. Proc. Lond. Math. Soc. 42, 230–265 (1936)

    Article  MathSciNet  Google Scholar 

  46. Wirth, N.: Algorithms + Data Structures = Programs. Prentice Hall, Englewood Cliffs (1976)

    MATH  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). Algorithms and Complexity. 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_2

Download citation

Publish with us

Policies and ethics