# MultiAspect Graphs: Algebraic Representation and Algorithms
## 2 MultiAspect Graph (MAG)
### MAG Definition  
We define a MAG as \(H=(A,E)\), where \(E\) is a set of edges and \(A\) is a finite list of _aspects_. Each aspect \(\varphi\in A\) is a finite set, and the number of aspects \(p=|A|\) is called the order of \(H\). Each edge \(e\in E\) is a tuple with \(2\times p\) elements. All edges are constructed so that they are of the form \((a_{1},\ldots,a_{p},b_{1},\ldots,b_{p})\), where \(a_{1},b_{1}\) are elements of the first aspect of \(H\), \(a_{2},b_{2}\) are elements of the second aspect of \(H\), and so on, until \(a_{p},b_{p}\) which are elements of the \(p\)-th aspect of \(H\). Note that the ordered tuple that represents each MAG edge is constructed so that their elements are divided into two distinct groups, each having exactly one element of each aspect, in the same sequence as the aspects are defined on the list \(A\).  
As a matter of notation, we say that \(A(H)\) is the aspect list of \(H\) and \(E(H)\) is the edge set of \(H\). Further, \(A(H)[n]\) is the \(n\)-th aspect in \(A(H)\), \(|A(H)[n]|=\tau_{n}\) is the number of elements in \(A(H)[n]\), and \(p=|A(H)|\) is the order of \(H\).  
In addition to the former definition, we define the following two sets constructed from the cartesian products of aspects of an order \(p\) MAG:  
\[\mathbb{V}(H)=\bigtimes_{n=1}^{p}A(H)[n], \tag{1}\]  
the cartesian product of all the aspects of the MAG \(H\), and  
\[\mathbb{E}(H)=\bigtimes_{n=1}^{2p}A(H)[(n-1)(mod\ p)+1], \tag{2}\]  
which is the set of all possible edges in the MAG \(H\), so that \(E(H)\subseteq\mathbb{E}(H)\).  
We call \(\mathbf{u}\in\mathbb{V}(H)\) a _composite vertex_ of MAG \(H\). As a matter of notation, a composite vertex is always represented as a bold lowercase letter, as in \(\mathbf{u}\), for instance. From the properties stated for the MAG edge in our definition, it follows that an MAG edge is closely related to an ordered pair of composite vertices. For any given MAG \(H\), every MAG edge \(e\in E(H)\) has the form \((a_{1},\ldots,a_{p},b_{1},\ldots,b_{p})\), so that \((a_{1},\ldots,a_{p})\in\mathbb{V}(H)\) and \((b_{1},\ldots,b_{p})\in\mathbb{V}(H)\) are composite vertices of this given MAG \(H\). From this, we can define two functions  
\[\begin{split}\pi_{o}:\mathbb{E}(H)&\to\mathbb{V}(H) \\ e&=(a_{1},a_{2},\ldots,a_{p},b_{1},b_{2},\ldots,b_{p}) &\mapsto(a_{1},a_{2},\ldots,a_{p})=\mathbf{u},\end{split} \tag{3}\]  
and  
\[\begin{split}\pi_{d}:\mathbb{E}(H)&\to\mathbb{V}(H) \\ e&=(a_{1},a_{2},\ldots,a_{p},b_{1},b_{2},\ldots,b_{p}) &\mapsto(b_{1},b_{2},\ldots,b_{p})=\mathbf{v}.\end{split} \tag{4}\]  
We call \(\pi_{o}(e)\) the origin composite vertex of \(e\) and \(\pi_{d}(e)\) the destination composite vertex of \(e\). Moreover, we can define the function  
\[\begin{split}\psi:\mathbb{E}(H)&\to\mathbb{V}(H) \times\mathbb{V}(H)\\ e&\mapsto(\pi_{o}(e),\pi_{d}(e))=((a_{1},\ldots,a _{p}),(b_{1},\ldots,b_{p}))=(\mathbf{u},\mathbf{v}),\end{split} \tag{5}\]  
from which we can construct a directed graph \(G_{H}=(V(H),\psi(E(H))\). In [18], we demonstrate that the directed graph \(G_{H}=(V(H),\psi(E(H))\) is isomorphic to the MAG \(H\) from which it was originated. At this point, we can therefore define the function  
\[\begin{split} g:(A(H),E(H))&\to(\mathbb{V}(H), \mathbb{V}(H)\times\mathbb{V}(H))\\ H&\mapsto(\mathbb{V}(H),\psi(E(H)),\end{split} \tag{6}\]which maps every MAG \(H\) to its isomorphic directed graph \(g(H)\). Further, we define the set of functions  
\[\begin{split}\pi_{i}:\mathbb{V}(H)&\to A(H)[i]\\ (a_{1},a_{2},\ldots,a_{p})&\mapsto a_{i},\end{split} \tag{7}\]  
which extracts the \(n\)-th element of a composite vertex tuple.