Skip to content

Instantly share code, notes, and snippets.

@medined
Created December 3, 2014 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save medined/c95df9f68eb4887ebdbb to your computer and use it in GitHub Desktop.
Save medined/c95df9f68eb4887ebdbb to your computer and use it in GitHub Desktop.
Adjacency Matrices
Adjacency matrices are often square and both out-vertices (rows) and the in-vertices (columns) are the same set of vertices.
A B C
D 1 0 0
F 0 0 0
G 0 0 1
The above matrix represents two 6 vertices and two edges. They could be represented as:
D -> A
G -> C
With a weighted adjacency matrix you could use values other than 1. For example,
A B C
D 0.25 0 0
F 0 0 0
G 0 0 0.76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment