-1

I'm practising with graphs and adjacency matrices. But I couldn't find a good example that differentiates symmetric and asymmetric matrix. Can anyone tell me how to distinguish the difference between symmetric or asymmetric matrix.

JVTura
  • 313
  • 1
  • 4
  • 12

2 Answers2

2

An adjacency matrix is symmetric if it is derived from an undirected graph.

That means, the path from node A -> B has the same cost/weight/length as the path from node B -> A.

If you create the adjacency matrix M, it will be symmetric, meaning that for any i and j, M[i][j] == M[j]i]. More mathematically, the matrix is identical to its transpose. So if you transpose your matrix, it will look exactly the same. Graphically, such a matrix looks like this:

0 2 3 4
2 0 5 6
3 5 0 7
4 6 7 0

Due to the symmetry, you can often represent it using less memory. For algorithms like the Floyd-Warshall-algorithm on undirected graphs, you can reduce the amount of computation by 50% since you only need to compute half of the matrix:

0 2 3 4
  0 5 6
    0 7
      0

For comparison, an asymmetric matrix:

0 2 3 9 <--
2 0 5 6
3 5 0 7
4 6 7 0

Note, that it is almost identical to the previous example, but in the upper right corner, there is a 9. So it is no longer possible to mirror the matrix along it's diagonal axis.

Slizzered
  • 869
  • 2
  • 9
  • 23
  • I also read that, if number columns equals to the rows that's a symmetric matrix. Is that also valid for the adjacency matrix. – JVTura Apr 16 '15 at 22:10
  • 1
    If (number of columns == number of rows), then it is a **square** matrix. A *symmetric* matrix is a special case of a square matrix where the matrix is equal to the transposed matrix (see my answer) – Slizzered Apr 16 '15 at 22:47
  • @JVTura if your question is answered, please consider marking the answer. If not, please modify your question to give us more information about what you want to know :) – Slizzered May 02 '15 at 18:29
0

You can check the example of symmetric graph

enter image description here

DaveL17
  • 1,673
  • 7
  • 24
  • 38
Rehmy
  • 1
  • Would be a good idea to explain the concept a little further. How does the cells correspond each other? – alseether Jul 08 '21 at 14:37