An automatic node relabelling scheme for minimizing a matrix or network bandwidth