Created
January 21, 2011 06:20
-
-
Save gobengo/789318 to your computer and use it in GitHub Desktop.
Check it out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Imagine graph G with vertexes A, B, C (sketch this if that's your thing). G has the following directed edges: | |
A->B | |
B->C | |
C->A | |
Basically this is a triangle with a loop. Now, let's say we model this with a binary matrix. Edge A->B means that G[A][B]=1. Similarly: G[B][C], G[C][A] = 1, 1. Think about this 2D array as a matrix G1: | |
ABC | |
A010 | |
B001 | |
C100 | |
Pretty slick. But hey, what if it was an undirected graph? So that any connection A->B implies B->A? B<->A, if you will. Then you'd get G2: | |
ABC | |
A010 | |
B101 | |
C010 | |
Note that this is a symmetric graph (across the NW->SE axes). This is special, because the Transpose of the graph is the same graph. A somewhat intuitive theorem is: | |
All directed graphs, when represented as matricies as above, correspond to a symmetric matrix. | |
Furthermore, I feel like there's something special about the relation of G1 and G2. I'm doing more testing and researching now. | |
For some reason this reminds me of the Linear Algebra class I never went to in college. That prof was a baller... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh, and think about if it wasn't a binary matrix, but instead a value between 0-1, even irrational expressions. These could represent weights on the graph. Sick. Let's go make some neural net matrix calculations in JavaScript!