IFN Lab: Adjacency Matrix and Network Graph
By Kardi Teknomo, PhD
< Previous | Index | Next >
Brief Description
Learn to draw network from weighted adjacency matrix and to convert back from network graph to adjacency matrix
Learning Objectives
- Learn to draw network from adjacency matrix.
- number of nodes is the same as the number of rows or columns in the adjacency matrix
- number of links is the same as the number of positive entries in the adjacency matrix
- link thickness represents the scaled weight of the adjacency matrix
- Learn to get adjacency matrix from network.
- network self loop is represented in the diagonal of the matrix
- add a node means adding a row and a column in the matrix
- delete a node means reducing matrix size by one
- reverse link direction means change value on upper and lower triangular part of the matrix
- Basic graph theory: node can stand alone. Link must be supported by two nodes.: thickness represents scale weight
Prerequisite
Read: Graph Theory and Linear Algebra
Instruction
Use the visual lab tool below to find the relationship between weighted adjacency matrix, matrix visualization and network directed graph. You can see the connection between the pattern of matrix elements and the network.
- Generate random adjacency matrix by clicking
- Left click on the pattern of visualization to increase the cell value. Right click to decrease the cell value
- Click on the network to create a node. Drag line between two nodes to create a link. Observe what happens to the matrix visualization and the adjacency matrix
- Change the matrix manually on the text area and observe the matrix visualization and the network
- Change the color pattern and the sum schema to see the structure of the matrix
Click button below for the help instructions on how to use the network
Experiment and Discussion
- Draw network from adjacency matrix.
- If a network has 4 nodes, how many columns and rows are the adjacency matrix?
- Count the number of positive entries in the adjacency matrix. How is it related to the number of links?
- Change the value of the weight in the adjacency matrix. How is it related to the link thickness?
- What happen if you have only a matrix of one cell contain zero?
- What happen if you have only a matrix of one cell contain one? Self-loop is shown only by thickness on the node
- Get adjacency matrix from network
- Select a node, press R key to create network self loop. How the self-loop is represented in the matrix? Did you notice the diagonal element has change?
- add a node by clicking. What happen to the row and column in the matrix?
- delete a node by press D or Del key. What happen to the rows and column in the matrix?
- reverse link direction by pressing L, R, or B. What happen to the values on upper and lower triangular part of the matrix?
- Did you notice that a node can stand alone without a link? Connect two nodes by dragging from one node to another. Did you observe that a link must be supported by two nodes?
Challenge yourself
- Create a strongly connected network. What is the pattern of the matrix?
- Create a premagic matrix. What happen to the sum of row and the sum of column in the matrix?
- Create an ideal flow network. What happen to the sum of row and the sum of column in the matrix?
- Create a complete Graph. What is the pattern of the matrix?
Lab Tool: Matrix & Network
IFN Lab: Adjacency Matrix and Network Graph
Index