Algorithm 1 gives the pseudocode for the Hedetniemi algorithm, which computes powers of the original weighted adjacency matrix A, quitting when two successive powers are identical. We leave it as Exercise 3 to determine the efficiency of the algorithm.