sorted outputh graph