sorted graph