# MultiAspect Graphs: Algebraic Representation and Algorithms
## 3 Algebraic Representation
### Elimination of Trivial Components  
In the MAG \(T\) shown in Figure 3 the composite vertices of numerical representation \((1),(6),(7),(12),(13),\) and \((18)\) are trivial components (i.e., unconnected composite vertices). They are created in consequence of the regularity needed on the MAG \(H\) to build the set \(\mathbb{V}(H)\). This type of padding is not necessary in a directed graph and its algebraic representation. Therefore, it is possible to remove the trivial components from the composite vertices representation and its associated matrices. However, it is important to bear in mind that the graph resulting from this transformation may no longer be isomorphic to the MAG and neither are the matrices associated with it. The only case in which the isomorphism is preserved is when there are no trivial components on the MAG and nothing is removed. Nevertheless, this kind of transformation can be helpful for application, by reducing the number of composite vertices present on the graph and so simplifying its construction and manipulation. The same sort of padding is discussed in [15], where authors suggest that this padding may cause problems in the computing of some metrics, such as mean degree or clustering coefficients, unless one accounts for the padding scheme in an appropriate way. In this subsection, we show that the padding with the trivial components may be eliminated, if desired. Anyway, if needed, it suffices to be cautious in computing the metrics of interest on MAGs by considering the existence of the padding scheme, as suggested by [15]. In particular, the MAG algorithms we discuss in Section 4 remain unaffected by this padding issue. For a given MAG \(H\), we define its main components graph \(m(H)\) as the MAG's composite vertices representation with all its trivial components removed. Figure 4 shows the main components graph \(m(T)\) for the MAG \(T\). It is worth noting that numerical representations are not defined for \(m(T)\). This can be achieved algebraically for any MAG \(H\) with the help of a matrix \(\mathbf{R}(H)\) constructed from the identity \(\mathbf{I}\in\mathbb{R}^{n\times n}\), where \(n=|\mathbb{V}(H)|\) is the number of composite vertices on the MAG. The matrix \(\mathbf{R}(H)\) is obtained from this \(n\times n\) identity by removing the columns which match the numerical representations of the trivial components of the MAG. Therefore, assuming that the MAG \(H\) has \(r\) trivial components, the matrix \(\mathbf{R}(H)\in\mathbb{R}^{n\times n-r}\) has \(n\) rows and \(n-r\) columns. In particular, in the cases where the MAG \(H\) has no trivial components, we have that \(\mathbf{R}(H)=\mathbf{I}\in\mathbb{R}^{n\times n}\). It is also worth noting that the matrix \(\mathbf{I}_{m}(H)=\mathbf{R}(H)\ \mathbf{R}(H)^{T}\in\mathbb{R}^{n\times n}\) is a matrix akin to the identity \(\mathbf{I}\in\mathbb{R}^{n\times n}\), but the diagonal entries corresponding to the trivial components (removed in \(\mathbf{R}(H)\)) have value 0. Therefore, multiplying a \(n\times n\) matrix by \(\mathbf{I}_{m}(H)\) to the left has the effect of turning all entries on the rows corresponding to the trivial components to 0 s. Similarly, multiplying by \(\mathbf{I}_{m}(H)\) to the right has the effect of turning the entries of the columns corresponding to the trivial elements to 0 s.  
As an example, we show the matrix \(\mathbf{R}(T)\in\mathbb{R}^{18\times 12}\),  
\[\mathbf{R}(T)= \begin{pmatrix}0&0&0&0&0&0&0&0&0&0&0\\ \mathbf{1}&0&0&0&0&0&0&0&0&0&0\\ 0&\mathbf{1}&0&0&0&0&0&0&0&0&0\\ 0&0&\mathbf{1}&0&0&0&0&0&0&0&0\\ 0&0&0&\mathbf{1}&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&\mathbf{1}&0&0&0&0&0&0\\ 0&0&0&0&\mathbf{1}&0&0&0&0&0&0\\ 0&0&0&0&0&\mathbf{1}&0&0&0&0&0\\ 0&0&0&0&0&0&\mathbf{1}&0&0&0&0\\ 0&0&0&0&0&0&0&\mathbf{1}&0&0&0\\ 0&0&0&0&0&0&0&0&0&\mathbf{1}&0\\ 0&0&0&0&0&0&0&0&0&0&\mathbf{1}\\ 0&0&0&0&0&0&0&0&0&0&0\\ 0&0&0&0&0&0&0&0&0&0&0\\ \end{pmatrix}