With the last video, we concluded the part related to node-link diagrams. So, what else is available? The next available technique is matrix visualization. What is a matrix visualization? Well, it's a completely different kind of method, and it's based on the idea of adjacency matrix. So, let me first explain what is an adjacency matrix, and then I'll go back to showing how this can be visualized. So, the main idea is that in adjacency matrix, rather than visualizing nodes and edges with marks and links that connect them, the way to visualize that is more indirect. The idea is to use a matrix where rows and columns represent the nodes and the intersection between a row and a column represents an edge. Let me show you an example. So, here, you see a traditional node-link graph on the left with A, B, C, D nodes. What you see on the right-hand side is the equivalent adjacency matrix of that graph. So, the nodes are represented in rows and in columns, and mark is placed at the intersection of the rows and columns that represent the connection between the two nodes. So, in other ways, a different way of saying that is that a mark exists only when there is an edge between the nodes that correspond to the row and the column. So, here is a practical example of how this looks like when we use it with the real dataset. In this specific case, we have character co-occurrences from a novel. So, the characters represent the nodes, which in this case are represented by rows and columns. You see a marker at the intersection of these rows and columns, these nodes when there is an edge between them. So, when do you use a matrix? How do you decide whether a matrix is the good representation for your problem? I think one way to go is to be mindful of what are the advantages and disadvantages of matrices over node-link diagrams. So, I would say that in summary, the main advantage is node visibility. So, one problem that we saw happens almost every time when you have node-link diagrams is that you have a lot of clutter and a lot of line crossings. So, it doesn't scale very well with respect to line crossings and number of lines. The great thing of matrices is that the nodes are fully visible. So, this means that if the information that is attached to the edges and to the nodes is a particularly important, more important than the structure of the network, then a matrix is a good candidate because it's easier to visualize any attribute that is related to the edges and to the nodes. So, visibility and no line crossings, I would say, these are the two main advantages of matrices. Of course there are also some disadvantages. What are the disadvantages? So, I think the biggest one is that people are much, much less familiar and the old metaphor is much, much less natural. I think for some reason, node-link diagrams are a very natural representation. People intuitively get the idea that if some nodes are clustered together, they have lots of connections between them, and that the connection between two nodes represents some sort of relationship. Whereas with a matrix, it's somewhat unnatural. It needs some explanation and some learning before one understands that a single dot represents a connection, that the nodes are in rows and columns, it's much less natural. The second one is scalability. Even though there's no cluttering problem, there is a problem of scalability because as the number of nodes grows, the cells that represent the edges get smaller and smaller and smaller. So, you can't really go beyond a few 100 nodes without getting the cells too small. So, that's another limitation. The final limitation of matrices is that in order to represent or to show some interesting patterns, some interesting structure, they have to be reordered using some intelligent algorithms. So, as I said, the biggest advantage of matrices is that they typically avoid what is called the Hairball Effect, which is exactly what you see here. In node-link diagrams, it's very common to come up with something like that, where everything is connected to everything else, and you'd just get a big hairball. So, you don't get that with matrices, but you do have the reordering problem. Here is an example of the reordering problem. This is exactly the same matrix that I've shown you before, but the version on the left is one that is unsorted and the one that is shown on the right is sorted using a specific clustering algorithm. There are many, many algorithms to sort matrices. I'm not going to dive deep into what these algorithms do and what are their differences, but the basic idea here is that matrices need some clever sorting methods in order to show interesting patterns. So, another couple of things that you can do with matrices is the fact that if you think about it, one thing that I didn't tell you yet is the fact that in a matrix like this one, the nodes that you have below the diagonal and above the diagonal are exactly the same as long as you have an undirected graph. What is an undirected graph? A graph that doesn't really have directions. But if you have a network where direction counts, like the one that I've shown you before on migrations, for every two pair of locations, you have people migrating in one direction or the opposite direction, well, then the matrix can naturally accommodate this problem. Why? Well, because you can represent the edges flowing from one direction to another and the bottom half of the diagonal, and those that go in the other direction in the top of the diagonal, which is exactly what we are showing here in this image. Before I conclude, I just want to mention that an alternative representation that is similar in spirit to the matrix but different is a pair of parallel lines. They are connected by edges. The reason why I am mentioning this solution here is because it's another very good solution when the problem of directionality is an important problem. So, when you have a directed graph, these kind of solutions can naturally accommodate the problem of directionality.