Articulo de referencia

Bareiss algorithm

In mathematics, the Bareiss algorithm , named after Erwin Bareiss , is an algorithm to calculate the determinant or the echelon form of a matrix with integer entries using only ...

In mathematics, the Bareiss algorithm, named after Erwin Bareiss, is an algorithm to calculate the determinant or the echelon form of a matrix with integer entries using only integer arithmetic; any divisions that are performed are guaranteed to be exact (there is no remainder). The method can also be used to compute the determinant of matrices with (approximated) real entries, avoiding the introduction of any round-off errors beyond those already present in the input.

Overview

The definition of the determinant of a matrix involves only the operations of multiplication, addition and subtraction. Therefore the determinant of a matrix is an integer whenever all the entries are integers. However, actual computation of the determinant using the definition or Leibniz formula is impractical, as it requires O(n!) operations. Gaussian elimination has O(n3) complexity, but introduces division, which results in round-off errors when implemented using floating point numbers.

Round-off errors can be avoided if all the numbers are kept as integer fractions instead of floating point. But then the size of each element grows in size exponentially with the number of rows.[1]

Bareiss brings up a question of performing an integer-preserving elimination while keeping the magnitudes of the intermediate coefficients reasonably small. Two algorithms are suggested:[2][3]

  1. Division-free algorithm — performs matrix reduction to triangular form without any division operation.
  2. Fraction-free algorithm — uses division to keep the intermediate entries smaller, but due to the Sylvester's Identity the transformation is still integer-preserving (the division has zero remainder).

For completeness Bareiss also suggests fraction-producing multiplication-free elimination methods.[2]

Algorithm

The program structure of this algorithm is a simple triple-loop, as in the standard Gaussian elimination. However in this case the matrix is modified so that each Mk,k entry contains the leading principal minor [M]k,k. Algorithm correctness is easily shown by induction on k.[4]

  • Entrada: M — una matriz cuadrada de n elementos, suponiendo que sus principales menores [ M ] k,k son todos distintos de cero.
  • Sea M 0,0 = 1 (Nota: M 0,0 es una variable especial)
  • Para k desde 1 hasta n 1:
    • Para i desde k +1 hasta n :
      • Para j desde k +1 hasta n :
        • ColocarMETROi,j=METROi,jMETROk,kMETROi,kMETROk,jMETROk1,k1{\displaystyle M_{i,j}={\frac {M_{i,j}M_{k,k}-M_{i,k}M_{k,j}}{M_{k-1,k-1}}}}
      • Establecer M i,k = 0
  • Salida: La matriz se modifica in situ , cada entrada M k,k contiene el menor principal [ M ] k,k , la entrada M n,n contiene el determinante de la M original .

Si la suposición sobre los menores principales resulta ser falsa, por ejemplo, si M k 1, k 1 = 0 y algún M i , k 1 ≠ 0 ( i = k ,..., n ) entonces podemos intercambiar la fila k 1 con la fila i y cambiar el signo de la respuesta final.

Análisis

Durante la ejecución del algoritmo de Bareiss, cada entero calculado es el determinante de una submatriz de la matriz de entrada. Esto permite, mediante la desigualdad de Hadamard , acotar el tamaño de estos enteros. Por lo demás, el algoritmo de Bareiss puede considerarse una variante de la eliminación gaussiana y requiere aproximadamente el mismo número de operaciones aritméticas.

De ello se deduce que, para una matriz n × n de valor máximo (absoluto) 2 L para cada entrada, el algoritmo de Bareiss se ejecuta en O( n 3 ) operaciones elementales con un límite de O( n n /2  2 nL ) en el valor absoluto de los valores intermedios necesarios. Su complejidad computacional es, por lo tanto, O( n 5 L 2  (log( n ) 2  + L 2 )) cuando se utiliza aritmética elemental o O( n 4 L (log( n ) + L ) log(log( n ) + L ))) mediante multiplicación rápida .       

Uso

El algoritmo de Bareiss no se usa comúnmente para matrices de enteros, porque la aritmética multimodular permite una complejidad similar a la del algoritmo de Bareiss con multiplicación rápida, y es mucho más sencillo de implementar.

Por otro lado, el algoritmo de Bareiss puede utilizarse con entradas en cualquier dominio integral equipado con un algoritmo de división exacta y, en particular, para matrices de polinomios.

Referencias

  1. Middeke, J.; Jeffrey, DJ; Koutschan, C. (2020), "Factores comunes en descomposiciones de matrices sin fracciones", Mathematics in Computer Science , 15 (4): 589–608 , arXiv : 2005.12380 , doi : 10.1007/s11786-020-00495-9
  2. 1 2 Bareiss, Erwin H. (1968), "Identidad de Sylvester y eliminación gaussiana multietapa que preserva los enteros" (PDF) , Mathematics of Computation , 22 (103): 565– 578, doi : 10.2307/2004533 , JSTOR 2004533 
  3. Bareiss, Erwin H. (1966), ELIMINACIÓN GAUSSIANA MULTIPASO QUE PRESERVA LOS ENTEROS (PDF)( Contiene una descripción más clara de la secuencia de operaciones)
  4. Yap, Chee Keng (2000), Problemas fundamentales del álgebra algorítmica , Oxford University Press