generating adjacency matrix from nodes_cadence table
Adjacency matrix represents all the possible pathways in the execution graph.
Execution graph is a directed acyclic graph as all the nodes dependencies are only resolved from nodefrom to nodeto
There are no loops in traversing the graph.
the distinct nodes values are read and stored in a vector<string> nodes
a square matrix (vector<vector<int>>) adjacency_matrix is created with the size of the nodes vector and initialized to 0
using the values of nodefrom the vector<int> is populated with value of 1 for each nodeto in a loop to populate adjacency_matrix
generating levels for the execution start
Level 1 is the vector[0] of the adjacency_matrix, all the nodes having a value greater then 0 are started
Level 2 matrix is created using dot product of adjacency_matrix by itself, level2 is the the vector[0] of the level 2 matrix
Level 3 matrix is created using dot product of adjacency_matrix by Level2 matrix, level 3 is the vector[0] of the level 3 matrix
Level N matrix is created using dot product of adjacency_matrix by Level(N-1) matrix, level N is the vector[0] of the level N matrix
when Level N vector has only one value for the end node, generation stops
Level 1 and Level 2 nodes are started at the beginning of the run
Level 3 nodes are started when at least one Level 1 node completes
Level N nodes are started when at least one Level (N-2) node completes
creating library functions for matrix and level vectors creation
The matrix generation will be implemented in cbaUtils class
The matrix dot product will be implemented in cbaUtils class
the Level vectors generation will be implemented in cbaUtils class
Attachments:
generateAdjacencyMatix.png (image/png)
generateAdjacencyMatix.png (image/png)