Lably
Skip to content

Cuthill–McKee algorithm

Numerical linear algebra algorithm

  • 1 min read
  • 1 chapter

Related on Lably

Through Algorithm, Symmetric matrix and Graph (discrete mathematics)

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 Ri for i=1,2,.. until all nodes are exhausted. The set Ri+1 is created from set Ri by listing all vertices adjacent to all nodes in Ri. These nodes are ordered according to predecessors and degree.

Algorithm

Given a symmetric n×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 of vertices which is the new order of the vertices.

First we choose a peripheral vertex (the vertex with the lowest degree) x and set R:=({x}).

Then for i=1,2,… we iterate the following steps while |R|<n

  • Construct the adjacency set Ai of Ri (with Ri the i-th component of R) and exclude the vertices we already have in R
Ai:=Adj⁡(Ri)∖R
  • Sort Ai ascending by minimum predecessor (the already-visited neighbor with the earliest position in R), and as a tiebreak ascending by vertex degree.
  • Append Ai to the Result set 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).

More in Computing and communication