The graph in Figure 3, which is the subgraph of consisting of {v1, v3, v4, v6} in Figure 2, has two distinct topological sorts given by {v1,v3, v4, v6} and {v1, v3, v6, v4}. These sorts are shown in Figure 4. In Figure 4, notice that in a topological sort, one can put the vertices in a row from left to right and connect the vertices with arcs.
---- ---- ----
| v | ---------> | v | ---------> | v |
| 1 | | 3 | | 6 |
---- ---- ----
|
|
|
v
----
| v |
| 4 |
----
Figure 3: An acyclic directed multigraph.
----------------------------
| |
| v
---- ---- ---- ----
| v | ------> | v | ------> | v | | v |
| 1 | | 3 | | 6 | | 4 |
---- ---- ---- ----
----------------------------
| |
| v
---- ---- ---- ----
| v | ------> | v | ------> | v | | v |
| 1 | | 3 | | 4 | | 6 |
---- ---- ---- ----
Figure 4: Two possible topological sorts for Figure 3.