Is this topological sorting exercise correct?

32 Views Asked by At

I just want to verify that I understood the concept of toposort since the professor didn't give an exhaustive list of correct answers for the exercises. I need to topologically sort this graph.

Graph and the corresponding Hasse diagram

If I understood correctly, I have to take out the smallest elements, so 9, 1, 4. Then I have to do it again with 2 and 5, and then 3, and then 6 and 8. The final order would be

$$\{1,4,9 \text{ in arbitrary order}\} \leq \{2, 5 \text{ in arbitrary order}\} \leq 3 \leq \{6, 8 \text{ in arbitrary order}\}$$

Then $7$ isn't connected to any other number so I can place it wherever I want.

1

There are 1 best solutions below

0
On

Yes, this is correct.

I'm posting this CW answer so that users who confidently concur have something to vote on, and so this question doesn't stagnate in the Unanswered Questions Queue. If however anyone would like to write a more substantial response to the question, please downvote this answer and post your own.