Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F163356701
D25883.id75135.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D25883.id75135.diff
View Options
Index: usr.bin/tsort/tsort.1
===================================================================
--- usr.bin/tsort/tsort.1
+++ usr.bin/tsort/tsort.1
@@ -75,6 +75,71 @@
intended for building libraries, where optimal ordering is not critical,
and cycles occur often.
.El
+.Sh EXAMPLES
+Assuming a file named
+.Pa dag
+with the following contents representing a directed acyclic graph:
+.Bd -literal -offset indent
+A B
+A F
+B C
+B D
+D E
+.Ed
+.Pp
+Sort the nodes of the graph:
+.Bd -literal -offset indent
+$ tsort dag
+A
+F
+B
+D
+C
+E
+.Ed
+.Pp
+White spaces and new line characters are considered equal.
+This file for example is considered equal to the one we defined before:
+.Bd -literal -offset indent
+$ cat dga
+A B A F B C B D D E
+.Ed
+.Pp
+Assume we add a new directed arc from D to A creating a cycle:
+.Bd -literal -offset indent
+A B
+A F
+B C
+B D
+D E
+D A
+.Ed
+.Pp
+Ordering the graph detects the cycle:
+.Bd -literal -offset indent
+$ tsort dag
+tsort: cycle in data
+tsort: A
+tsort: B
+tsort: D
+D
+E
+A
+F
+B
+C
+.Ed
+.Pp
+Same as above but silencing the warning about the cycle:
+.Bd -literal -offset indent
+$ tsort -q dag
+D
+E
+A
+F
+B
+C
+.Ed
.Sh SEE ALSO
.Xr ar 1
.Sh HISTORY
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 23, 11:26 AM (5 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35400445
Default Alt Text
D25883.id75135.diff (1 KB)
Attached To
Mode
D25883: tsort(1): Add EXAMPLES section
Attached
Detach File
Event Timeline
Log In to Comment