grid and graph