Graphs and matrices