If it comes from finite differences or similar, you can’t. But there’s Cuthill-McKee algorithm that can calculate the minimi bandwidth permutation for general sparse matrices, which is yet to be implemented: https://github.com/JuliaMatrices/BandedMatrices.jl/issues/76