what is the link between matricies and graph theory