ArticleslgStudy

computer science

Cuthill–McKee algorithm

Cuthill–McKee algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Cuthill–McKee algorithm rather than just read about it. In short: In numerical linear algebra, the Cuthill–McKee algorithm (CM), named after Elizabeth Cuthill and James McKee, is an algorithm to permute a sparse matrix that has a symmetric sparsity pattern into a band matrix form with a small bandwidth. The reverse Cuthill–McKee algorithm (RCM) due to Alan George and Joseph Liu is the same algorithm but with the resulting index numbers reversed.

Cuthill–McKee algorithm — main illustration
Cuthill–McKee algorithm — illustration

Key takeaways

  • Cuthill–McKee algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Cuthill–McKee algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Cuthill–McKee algorithm from memory before moving on to harder problems.

Reference excerpt

In numerical linear algebra, the Cuthill–McKee algorithm (CM), named after Elizabeth Cuthill and James McKee, is an algorithm to permute a sparse matrix that has a symmetric sparsity pattern into a band matrix form with a small bandwidth. The reverse Cuthill–McKee algorithm (RCM) due to Alan George and Joseph Liu is the same algorithm but with the resulting index numbers reversed. In practice this generally results in less fill-in than the CM ordering when Gaussian elimination is applied. The Cuthill McKee algorithm is a variant of the standard breadth-first search algorithm used in graph algorithms. It starts with a peripheral node and then generates levels R i {\displaystyle R_{i}} for i = 1 , 2 , . . {\displaystyle i=1,2,..} until all nodes are exhausted. The set R i + 1 {\displaystyle R_{i+1}} is created from set R i {\displaystyle R_{i}}

by listing all vertices adjacent to all nodes in R i {\displaystyle R_{i}} . These nodes are ordered according to predecessors and degree.

Algorithm Given a symmetric n × n {\displaystyle n\times n} matrix we visualize the matrix as the adjacency matrix of a graph. The Cuthill–McKee algorithm is then a relabeling of the vertices of the graph to reduce the bandwidth of the adjacency matrix. The algorithm produces an ordered n-tuple R {\displaystyle R} of vertices which is the new order of the vertices. First we choose a peripheral vertex (the vertex with the lowest degree) x {\displaystyle x} and set R := ( { x } ) {\displaystyle R:=(\{x\})} . Then for i = 1 , 2 , … {\displaystyle i=1,2,\dots } we iterate the following steps while | R | < n {\displaystyle |R|<n}

Construct the adjacency set A i {\displaystyle A_{i}} of R i {\displaystyle R_{i}} (with R i {\displaystyle R_{i}} the i-th component of R {\displaystyle R} ) and exclude the vertices we already have in R {\displaystyle R}

A i := Adj ⁡ ( R i ) ∖ R {\displaystyle A_{i}:=\operatorname {Adj} (R_{i})\setminus R}

Sort A i {\displaystyle A_{i}} ascending by minimum predecessor (the already-visited neighbor with the earliest position in R), and as a tiebreak ascending by vertex degree. Append A i {\displaystyle A_{i}} to the Result set R {\displaystyle R} . In other words, number the vertices according to a particular level structure (computed by breadth-first search) where the vertices in each level are visited in order of their predecessor's numbering from lowest to highest. Where the predecessors are the same, vertices are distinguished by degree (again ordered from lowest to highest).

See also Graph bandwidth Sparse matrix

References

Cuthill–McKee documentation for the Boost C++ Libraries. A detailed description of the Cuthill–McKee algorithm. symrcm MATLAB's implementation of RCM. reverse_cuthill_mckee RCM routine from SciPy written in Cython.

Illustrations

Cuthill–McKee algorithm: Cuthill-McKee ordering of a matrix
Cuthill-McKee ordering of a matrix
Cuthill–McKee algorithm: RCM ordering of the same matrix
RCM ordering of the same matrix

Worked examples

Example 1 — a first encounter with Cuthill–McKee algorithm

Start with the simplest possible case. Write down what Cuthill–McKee algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Cuthill–McKee algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Cuthill–McKee algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Cuthill–McKee algorithm

In research
Cuthill–McKee algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Cuthill–McKee algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Cuthill–McKee algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Graph algorithms, Matrix theory, Sparse matrices, so understanding it makes those chapters shorter.
In everyday life
Look for Cuthill–McKee algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Cuthill–McKee algorithm” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Cuthill–McKee algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Cuthill–McKee algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Cuthill–McKee algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Cuthill–McKee algorithm in simple terms?

In numerical linear algebra, the Cuthill–McKee algorithm (CM), named after Elizabeth Cuthill and James McKee, is an algorithm to permute a sparse matrix that has a symmetric sparsity pattern into a band matrix form with a small bandwidth. The reverse Cuthill–McKee algorithm (RCM) due to Alan George…

Why does Cuthill–McKee algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Cuthill–McKee algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Cuthill–McKee algorithm.

Tags

  • Graph algorithms
  • Matrix theory
  • Sparse matrices

Keep exploring