Getting most non-zero values near diagonal of matrix

  • Thread starter Nask
  • Start date
  • Tags
    Matrix
In summary, the conversation discusses the problem of optimizing a matrix to have most of its non-zero values near its diagonal. Methods such as Jordan Normal form and bandwidth reduction algorithms are mentioned, but the problem remains unsolved for large matrices. The conversation also clarifies the meaning of "diagonal" in a non-square matrix.
  • #1
Nask
2
0
When I have a matrix like this:

0 0 1 0
0 1 0 0
1 0 0 1
0 0 1 1
0 0 0 1

I can get most non zero values in the centre changing only the order of rows

1 0 0 1
0 1 0 0
0 0 1 0
0 0 1 1
0 0 0 1

Probably when I am allowed to change the order of columns and rows at the same time I will even get a better result, getting rid of the 1 in the top-right corner.

Is there an algorithm that can be used to optimise a n by m matrix, having most of its non zero values near its diagonal?

Background:
The columns are the different client orders, the rows the different articles. I like to divide the clients that require a simular set of articles in different groups. The real amount of clients is about 500, articles about 2500, so I need an algorithm that also works for larger matrices (calculation has to be made each day upfront).




Thanks,

Nasko
 
Physics news on Phys.org
  • #3
The problem of how to find the absolutely "optimal" ordering for a large matrix, in a short enough time to be useful, is an unsolved problem.

There are many approximate methods that will produce "good" but not "perfect" orderings, ranging from quick single-pass methods to complex iterative algorithms. Search for matrix bandwith or profile reduction algorithms used in solving sparse linear equations.

Which method works best depends very much on the "shape" of the matrix. Often several different methods are tried, and the best result is used.

Note: the standard methods only work with square matrices. It is not quite clear what you mean by the "diagonal" of a rectangular matrix. But you should be able to use the basic ideas behind the methods to get what you want.
 
  • #4
Thanks for both answers. Knowing the term bandwidth reduction helps a lot finding information on internet!


And for the diagonal of a non-square matix.. just the line from the top left to the bottem right... :-)
 
  • #5


I can suggest a few different approaches that can be used to optimize a matrix in the way you described.

1. Sorting by Diagonal Elements: One approach is to sort the rows and columns of the matrix based on the values of their diagonal elements. This will bring the largest values towards the center of the matrix, making the non-zero values more concentrated near the diagonal. This approach is simple and can be easily implemented for larger matrices.

2. Clustering: Another approach is to use clustering algorithms to group similar rows and columns together. This will help in identifying patterns and similarities in the data, and arranging them in a way that maximizes the non-zero values near the diagonal. This approach may require some initial data analysis and may be more complex to implement, but it can provide better results for larger matrices.

3. Matrix Factorization: Matrix factorization techniques, such as Singular Value Decomposition (SVD) or Non-negative Matrix Factorization (NMF), can also be used to optimize a matrix. These techniques break down a matrix into smaller matrices that represent its underlying structure. By rearranging these smaller matrices, the non-zero values can be concentrated near the diagonal. However, these techniques may not be suitable for larger matrices as they can be computationally intensive.

In conclusion, there are several methods that can be used to optimize a matrix and achieve a concentration of non-zero values near the diagonal. The choice of which approach to use will depend on the specific characteristics of your data and the level of complexity and computation that you are willing to invest. I hope this helps.
 

1. What is the purpose of getting most non-zero values near diagonal of matrix?

The purpose is to have a matrix that is more organized and easier to interpret, especially for visual analysis. This is because the diagonal values are typically the most important and relevant to the overall data, so having them closer together can help to highlight patterns and relationships.

2. How can I get most non-zero values near diagonal of a given matrix?

One approach is to use a reordering algorithm, such as the Reverse Cuthill-McKee algorithm, which rearranges the rows and columns of a matrix to minimize the fill-in (non-zero) values near the diagonal. Another option is to manually adjust the matrix by swapping rows and columns to achieve a similar result.

3. Can getting most non-zero values near diagonal of matrix affect the accuracy of my data?

No, the rearrangement of the matrix does not change the values of the data, it only changes the way they are organized. Therefore, the accuracy of the data remains the same.

4. Are there any disadvantages to getting most non-zero values near diagonal of matrix?

One potential disadvantage is that the reordering process can be time-consuming and computationally expensive, especially for large matrices. Additionally, depending on the data and the chosen algorithm, the resulting matrix may not have a significant improvement in terms of organization.

5. Is there a specific type of data or analysis that benefits the most from getting most non-zero values near diagonal of matrix?

This technique is particularly useful for symmetric matrices, where the values above and below the diagonal are equal. It is also beneficial for data that has a clear pattern or relationship that can be highlighted by having the values near the diagonal closer together.

Similar threads

Replies
5
Views
207
  • Linear and Abstract Algebra
Replies
14
Views
2K
  • Linear and Abstract Algebra
Replies
2
Views
1K
Replies
3
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
1K
  • Linear and Abstract Algebra
Replies
9
Views
4K
  • Precalculus Mathematics Homework Help
Replies
32
Views
841
  • Linear and Abstract Algebra
Replies
6
Views
1K
  • Linear and Abstract Algebra
Replies
1
Views
1K
  • Linear and Abstract Algebra
Replies
4
Views
1K
Back
Top