graph problem