# Algorithms and complexity

### From CS2001 Wiki

Algorithms are fundamental to computer science and software engineering. The real-world performance of any software system depends on only two things: (1) the algorithms chosen and (2) the suitability and efficiency of the various layers of implementation. Good algorithm design is therefore crucial for the performance of all software systems. Moreover, the study of algorithms provides insight into the intrinsic nature of the problem as well as possible solution techniques independent of programming language, programming paradigm, computer hardware, or any other implementation aspect.

An important part of computing is the ability to select algorithms appropriate to particular purposes and to apply them, recognizing the possibility that no suitable algorithm may exist. This facility relies on understanding the range of algorithms that address an important set of well-defined problems, recognizing their strengths and weaknesses, and their suitability in particular contexts. Efficiency is a pervasive theme throughout this area.

With the emergence of multicore processors, issues related to parallel algorithms have become more relevant. While the parallelism topics remain listed here as elective, the committee believes that the role of parallelism throughout the curriculum needs to be considered.

## AL/BasicAnalysis [core]

*Minimum core coverage time: 4 hours*

*Topics:*

- Asymptotic analysis of upper and average complexity bounds
- Identifying differences among best, average, and worst case behaviors
- Big O, little o, omega, and theta notation
- Standard complexity classes
- Empirical measurements of performance
- Time and space tradeoffs in algorithms
- Using recurrence relations to analyze recursive algorithms

*Learning objectives:*

- Explain the use of big O, omega, and theta notation to describe the amount of work done by an algorithm.
- Use big O, omega, and theta notation to give asymptotic upper, lower, and tight bounds on time and space complexity of algorithms.
- Determine the time and space complexity of simple algorithms.
- Deduce recurrence relations that describe the time complexity of recursively defined algorithms.
- Solve elementary recurrence relations.

## AL/AlgorithmicStrategies [core]

*Minimum core coverage time: 6 hours*

*Topics:*

- Brute-force algorithms
- Greedy algorithms
- Divide-and-conquer
- Backtracking
- Branch-and-bound
- Heuristics
- Pattern matching and string/text algorithms
- Numerical approximation algorithms

*Learning objectives:*

- Describe the shortcoming of brute-force algorithms.
- For each of several kinds of algorithm (brute force, greedy, divide-and-conquer, backtracking, branch-and-bound, and heuristic), identify an example of everyday human behavior that exemplifies the basic concept.
- Implement a greedy algorithm to solve an appropriate problem.
- Implement a divide-and-conquer algorithm to solve an appropriate problem.
- Use backtracking to solve a problem such as navigating a maze.
- Describe various heuristic problem-solving methods.
- Use pattern matching to analyze substrings.
- Use numerical approximation to solve mathematical problems, such as finding the roots of a polynomial.

## AL/FundamentalAlgorithms [core]

*Minimum core coverage time: 12 hours*

*Topics:*

- Simple numerical algorithms
- Sequential and binary search algorithms
- Quadratic sorting algorithms (selection, insertion)
- O(N log N) sorting algorithms (Quicksort, heapsort, mergesort)
- Hash tables, including collision-avoidance strategies
- Binary search trees
- Representations of graphs (adjacency list, adjacency matrix)
- Depth- and breadth-first traversals
- Shortest-path algorithms (Dijkstra’s and Floyd’s algorithms)
- Transitive closure (Floyd’s algorithm)
- Minimum spanning tree (Prim’s and Kruskal’s algorithms)
- Topological sort

*Learning objectives:*

- Implement the most common quadratic and O(NlogN) sorting algorithms.
- Design and implement an appropriate hashing function for an application.
- Design and implement a collision-resolution algorithm for a hash table.
- Discuss the computational efficiency of the principal algorithms for sorting, searching, and hashing.
- Discuss factors other than computational efficiency that influence the choice of algorithms, such as programming time, maintainability, and the use of application-specific patterns in the input data.
- Solve problems using the fundamental graph algorithms, including depth-first and breadth-first search, single-source and all-pairs shortest paths, transitive closure, topological sort, and at least one minimum spanning tree algorithm.
- Demonstrate the following capabilities: to evaluate algorithms, to select from a range of possible options, to provide justification for that selection, and to implement the algorithm in programming context.

## AL/DistributedAlgorithms [core]

*Minimum core coverage time: 3 hours*

*Topics:*

- Consensus and election
- Termination detection
- Fault tolerance
- Stabilization

*Learning objectives:*

- Explain the distributed paradigm.
- Explain one simple distributed algorithm.
- Determine when to use consensus or election algorithms.
- Distinguish between logical and physical clocks.
- Describe the relative ordering of events in a distributed algorithm.

## AL/BasicComputability [core]

*Minimum core coverage time: 6 hours*

*Topics:*

- Finite-state machines
- Context-free grammars
- Tractable and intractable problems
- Uncomputable functions
- The halting problem
- Implications of uncomputability

*Learning objectives:*

- Discuss the concept of finite state machines.
- Explain context-free grammars.
- Design a deterministic finite-state machine to accept a specified language.
- Explain how some problems have no algorithmic solution.
- Provide examples that illustrate the concept of uncomputability.

## AL/PversusNP [elective]

*Topics:*

- Definition of the classes P and NP
- NP-completeness (Cook’s theorem)
- Standard NP-complete problems
- Reduction techniques

*Learning objectives:*

- Define the classes P and NP.
- Explain the significance of NP-completeness.
- Prove that a problem is NP-complete by reducing a classic known NP-complete problem to it.

## AL/AutomataTheory [elective]

*Topics:*

- Deterministic finite automata (DFAs)
- Nondeterministic finite automata (NFAs)
- Equivalence of DFAs and NFAs
- Regular expressions
- The pumping lemma for regular expressions
- Push-down automata (PDAs)
- Relationship of PDAs and context-free grammars
- Properties of context-free grammars
- Turing machines
- Nondeterministic Turing machines
- Sets and languages
- Chomsky hierarchy
- The Church-Turing thesis

*Learning objectives:*

- Determine a language’s location in the Chomsky hierarchy (regular sets, context-free, context-sensitive, and recursively enumerable languages).
- Prove that a language is in a specified class and that it is not in the next lower class.
- Convert among equivalently powerful notations for a language, including among DFAs, NFAs, and regular expressions, and between PDAs and CFGs.
- Explain at least one algorithm for both top-down and bottom-up parsing.
- Explain the Church-Turing thesis and its significance.

## AL/AdvancedAnalysis [elective]

*Topics:*

- Amortized analysis
- Online and offline algorithms
- Randomized algorithms
- Dynamic programming
- Combinatorial optimization

*Learning objectives:*

- Use the potential method to provide an amortized analysis of previously unseen data structure, given the potential function.
- Explain why competitive analysis is an appropriate measure for online algorithms.
- Explain the use of randomization in the design of an algorithm for a problem where a deterministic algorithm is unknown or much more difficult.
- Design and implement a dynamic programming solution to a problem.

## AL/CryptographicAlgorithms [elective]

*Topics:*

- Historical overview of cryptography
- Private-key cryptography and the key-exchange problem
- Public-key cryptography
- Digital signatures
- Security protocols
- Applications (zero-knowledge proofs, authentication, and so on)

*Learning objectives:*

- Describe efficient basic number-theoretic algorithms, including greatest common divisor, multiplicative inverse mod n, and raising to powers mod n.
- Describe at least one public-key cryptosystem, including a necessary complexity-theoretic assumption for its security.
- Create simple extensions of cryptographic protocols, using known protocols and cryptographic primitives.

## AL/GeometricAlgorithms [elective]

*Topics:*

- Line segments: properties, intersections
- Convex hull finding algorithms

*Learning objectives:*

- Describe and give time analysis of at least two algorithms for finding a convex hull.
- Justify the Omega(N log N) lower bound on finding the convex hull.
- Describe at least one additional efficient computational geometry algorithm, such as finding the closest pair of points, convex layers, or maximal layers.

## AL/ParallelAlgorithms [elective]

*Topics:*

- PRAM model
- Exclusive versus concurrent reads and writes
- Pointer jumping
- Brent’s theorem and work efficiency

*Learning objectives:*

- Describe implementation of linked lists on a PRAM.
- Use parallel-prefix operation to perform simple computations efficiently in parallel.
- Explain Brent’s theorem and its relevance.

See also NetCentric computing for algorithm topics related to security, cryptography and compression.

To give feedback on this area of revision, go to here and use your ACM user name and login. |

To give feedback on security section of this area of revision, go to here and use your ACM user name and login. |

Copyright © 2008, ACM, Inc. and IEEE, Inc.