Consider a matrix multiplicationprogram C=A*B, where A and B are (5×5) matrices. The elements c11,c22, … c5,5 are computed as follows
C11= a11*b11+a12*b21 +a13*b31 + ….A1n*b51
C12 = a11*b12+a12*b22 +a13*b32 + ….A1n*b52
…………………………
C1n = a11*b1,5+a12*b2,5 +a13*b3,5 + ….A1n*b5,55
And so on
For this computation, you are requiredto build a graph as follows:
Every element of the array isconsidered adjacent to another element if both elements are part ofone operation.
If two elements are adjacent, thenthere must be a link between them.
- Build the graph for the above code
- Color the edges of the graph with minimalcolors
- Color the nodes of the
OROR