# Matrices

Matrices are another way to visualize network data.

This is done using an **adjacency matrix**.

The nodes are encoded using **rows** and **columns**, and the edges are encoded in the **cells**.

![](/files/-M5-0Vrod_2tYI8koHy5)

## Why Use Matrices?

* **Full visibility** of nodes and relationships, and corresponding properties
* **No line crossings** (so, no clutter)

  This gets rid of the **hairball effect** that is common in node-link diagrams, especially when every node is connected to every other node: &#x20;

  ![](/files/-M5-0VrrtCcyCuNCcWqT)

## Drawbacks

* **Less familiarity** with the representation, since it isn't very common
* Feels **less natural** than using nodes and links
* **Less scalability** (cells become too small beyond 100-200 nodes)
* **Needs reordering** in order to show structures or patterns

  ![](https://github.com/vikrambajaj22/cs-gy-6313-information-visualization/tree/3c48b78fa6863e413bc5de9fbb02bc202da645ff/assets/reordering.png)**Left**: without sorting the data, **Right**: after sorting the data

### Note

For undirected networks, matrices are symmetric. However, for directed networks, the cells can be filled according to the edge directions.

A **parallel axes** representation is a common substitute for matrices, when direction is to be shown:\
![](/files/-M5-0VryVTpRMa9GFDa1)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://vikram-bajaj.gitbook.io/cs-gy-6313-information-visualization/networks-and-trees/visualizing-network-data/matrices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
