copute graph of the question