Graphs and Matrix Manipulation