Fill-reducing is key to sparse matrix factorization. This course contains a very good introduction to this topic. This course is much earlier but still useful. And George & Liu’s book on sparse linear systems can be downloaded there. Minimum of fill-in is an NP-complete problem. There are two major heuristic method, minimum degree and nested dissection. AMD and Metis are two popular packages corresponding to these two methods. AMD and its variants are contained in Matlab. Metis can be used in Matlab with this mex interface.
What I concern is a special case, square grid(above). There is a Matlab package MESHND for nested dissection in this simple case. Its benchmark shows it does not perform well for 5-point stencil. I thought there should be some simple and efficient method for this simple symmetric case. I tried to use constrained AMD(CAMD) with some proper constraint to improve the result. I found that eliminating four triangle in Picture A below first will produce a better result. I contacted with Bora Uçar, and he suggested to use more diamonds to partition the grid, like Picture B.The method finds out the borders and constrain them to be ordered later in CAMD. This does further improve the result, though the best number of diamonds is not easy to determine. Borders of diamonds are circles under the distance defined by the connection of 5-point stencil.They separate the domain with the minimal size. Under the condition of 9-point stencil, circles turn out to be squares in Picture C. This is the way MESHND partitions the grid.
However, the size of separators just partially explain the result. This becomes obvious when this method is extended to 3D 7-point stencil case. In 3D, the best shape for the size of separators is truncated octahedron. But those truncated octahedra are not good for fill-reducing. The best method I found is simply extending 2D diamonds to 3D. They become octahedra. Octahedra can not fill the 3D domain like diamonds in 2D (ignoring boundaries). There leaves many tetrahedra. These separators are not optimized in size, but they are much more suitable for fill-reducing. The Matlab code to generate the constraint in this way for CAMD is here. 2D version can be easily reduced from that.
Here is a comparison among different methods on s×s regular 5-point stencil grid.
There are 4 diamonds per row like picture B above for s=64,128,256. And this number turns out to be 8 when s=512,1024. As a general method, Metis performs well, but it costs much more time than the others.
And for 3D s×s×s grid, the number of nonzeros by this method is as good as the result of Metis, while Metis is much slower and its memory consumption is much higher. Metis runs out of memory on my Win32 machine when s=128.
If you have any better explanation or better method, please let me know.
There is a project applying this fill-reducing.