constructor tests passed and all functionality for MatrixGraph implemented