Java icon indicating copy to clipboard operation
Java copied to clipboard

[FEATURE REQUEST] Add LU decomposition algorithm for matrix (java) (hactoberfest'25)

Open sourav-625 opened this issue 1 month ago • 2 comments

What would you like to Propose?

I would like to propose the addition of LU decomposition algorithm under src/main/java/com/thealgorithms/matrix

This algorithm is widely used in:

  • Solving systems of linear equations (Ax = b)
  • Finding matrix inverses
  • Computing determinants efficiently

Issue details

The above mentioned algorithm decomposes a square matrix A into product of 2 matrices:

A = L * U

where:

  • L is a lower triangular matrix with 1s on its diagonal
  • U is an upper triangular matrix

Example: Matrix: A = { {2, -1, -2}, {-4, 6, 3}, {-4, -2, 8} }

Expected Output: L = { {1.000, 0.000, 0.000}, {-2.000, 1.000, 0.000}, {-2.000, -1.000, 1.000} }

U = { {2.000, -1.000, -2.000}, {0.000, 4.000, -1.000}, {0.000, 0.000, 3.000} }

Time Complexity: O(n^3)

Reference: https://en.wikipedia.org/wiki/LU_decomposition

Additional Information

No response

sourav-625 avatar Oct 19 '25 07:10 sourav-625

I would like to be assigned this issue, as I have already solved it. My Java program implementing this algorithm is neat and efficient.

sourav-625 avatar Oct 19 '25 07:10 sourav-625

I would like to work on this.

thanay2007 avatar Oct 20 '25 09:10 thanay2007