# MultiAspect Graphs: Algebraic Representation and Algorithms
## 3 Algebraic Representation  
In this section, we discuss ways to represent MAGs [18] by means of algebraic structures. As a consequence to the isomorphism between MAGs and traditional directed graphs, it is straightforward to construct matrix-based representations of MAGs. This section addresses these representations, using the MAG depicted in Figure 2 as an illustrative example.  
Figure 2 shows an illustrative example of a three aspect MAG \(T\). It can be seen as a representation of a time-varying multilayer network, showing a hypothetical simple urban transit system. More specifically, Figure 2 depicts the MAG \(T\) in its composite vertices representation, \(g(T)\), which is the directed graph defined in Expression (6).  
Aligned with this view, the aspects of MAG \(T\) can be interpreted in the following way: The first aspect represents three distinct locations, labeled 1, 2 and 3. Specifically, location 1 represents a subway station, location 2 a subway station with a bus stop, and location 3 a bus stop. The second aspect represents two distinct urban transit modes depicted as layers, namely Bus and Subway. Finally, the third aspect represents three time instants. The MAG edges can be seen with the following meaning: Location 1 has no edges on the bus transit mode, since it is a subway station. Similarly, location 3 has no edges on the subway mode, since it is a bus stop. The eight black edges represent bus and subway trips between locations. As a simplification all trips are assumed to have the same duration. The red (dotted) edges represent the possibility of staying at a bus stop or subway station and not taking a transit. The six blue (dashed) edges show that it is possible to change between bus and subway layers at all times at location 2. As a simplification, the connection between the bus and subway layers is assumed to take no time. We recognize that the decision of making these edges with 0 time length  
Figure 2: Illustrative MAG \(T\) of a hypothetical simple urban transit system.  
generates cycles of length 0 in instances of location 2. In real network analysis, 0 length cycles (and also negative length cycles) can cause problems. However, we choose to let these cycles present in this toy example since they will cause no harm for the analysis conducted in this thesis, and also, they make the toy example more compact and readable. Further, we remark that if desired, these 0 length cycles could be broken by adding new composite vertices, or by making the subway/bus transition to have the same length as a subway/bus trip.  
In this model, walks represent the ways the urban transit system can be used to travel from one location to another. For instance, starting at location 1 on the subway layer at time \(t1\), it is possible to reach location 3 on the bus layer at time \(t3\). It can be done by taking a subway trip to location 2 at time \(t2\), switching from subway to bus layer at location 2, time \(t2\) and finally taking a bus trip from location 2 bus layer arriving at location 3 on the bus layer at time \(t3\).  
The presence of unconnected occurrences of location 1 at bus layer and location 3 at subway layer can be viewed as artefacts of the MAG construction. We call these vertices trivial components of the MAG. This subject will be further addressed in this section.