This repository contains an implementation of a low-level concurrent version of the Gaussian elimination algorithm in Java. The program generates the Diekert graph and computes the Foata normal form, which is subsequently used to design the order of concurrent operations by analyzing dependencies and indivisible steps.
For a given system of equations:
we perform Gaussian elimination for the matrix represented as:
The Gaussian elimination algorithm is divided into the following indivisible operations:
-
$A_{i, k}$ - finding the next multiplier for the i-th row to subtract the product from the k-th row:$m_{i, k} := \frac{M_{k, i}}{M_{i, i}}$ -
$B_{i, j, k}$ - multiplying the j-th element of the i-th row by the found multiplier in$A_{i, k}$ :$n_{i, j, k} = m_{i, k} \cdot M_{i, j}$ -
$C_{i, j, k}$ - subtracting the j-th element of the i-th row, multiplied by the multiplier, from the k-th row:$M_{k,j} = M_{k,j} - n_{i,j,k}$
Based on the described indivisible computational tasks, we can formulate an alphabet as follows:
where:
$i \in set( 1, 2, \ldots, n-1 )$ $j \in set( i, i+1, \ldots, m+1 )$ $k \in set( i+1, i+2, \ldots, n )$
The Gaussian elimination algorithm executed sequentially assumes using the i-th row to eliminate all subsequent k-th rows, iterating through each row. For example, eliminating row
From the above, it's easy to generalize and conclude that the required sequence of tasks is:
where
The dependency relations are determined as follows:
where:
$i \in set( 1, 2, \ldots, n-1 )$ $j \in set( i, i+1, \ldots, m+1 )$ $k \in set( i+1, i+2, \ldots, n )$
The independent relations can be determined as:
The Diekert graph is determined using a program written in Java (visualization is done using Graphviz).
The program follows these steps:
- Creation of the graph vertices; each element of the alphabet is a vertex,
- Adding directed edges corresponding to the appropriate dependency relations,
- Removing unnecessary edges.
The Foata Normal Form (FNF) is also determined using a program written in Java. It is created based on the Diekert graph using the BFS algorithm.
In general, FNF is represented as:
where:
$j \in set( i, i + 1, \dots, m + 1 )$ $k \in set( i + 1, i + 2, \dots, n )$
For the given input file:
4
2.0 1.0 3.0 1.0
4.0 3.0 8.0 1.0
6.0 5.0 16.0 1.0
6.0 15.0 27.0 1.0
6.0 15.0 27.0 1.0
The program determines the following Diekert graph (along with, e.g., the alphabet and FNF):
and solves the system of equations:
x_1 = 5.700
x_2 = -3.700
x_3 = 1.000
x_4 = -4.700
