How To Read Bidirectional Graphs
This subject seems very simple to the point many may disregard how to interpret a graph adjacency list when given a matrix. This should had been very easy if you have a basic understanding of matrices. I am not to make this short article into a intro to linear algebra since myself I am little rusty on this subject but a matrix can be represented as columns and rows. Each column can be represented as axis. In a simple case, when working with 2 dimensions we working with x and y. Yet, most math books will represent each column as x1, x2, x3, ..... Based on this, we can say that is nothing but a system of equations. If we have x + 2x + 1 = 0 and another equation 2x + x =0 we can represent as: row1 [ 1 2 1 |0], row2 [2, 1, 0 |0]. However, we are to focus how to represent graph relations using matrices. So, if we have a tree node where root is connected to node 1 and node 2, and we are looking in a bidirectional graph- a graph where (A,B) and (B,A) are the same edge- we can represent as
We simple say 1 is true and 0 is false. 0 is connected to 1 and 2 and so forth. Columns and rows are vertices in this case. That way, next time you are asked, show me this tree in matrix form, you can simply formulate the matrix without needing to know linear algebra.