Commit | Line | Data |
---|---|---|
07d825db KB |
1 | .\" Copyright (c) 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
d8e69841 | 3 | .\" |
07d825db KB |
4 | .\" This manual is derived from one contributed to Berkeley by |
5 | .\" Michael Rendell of Memorial University of Newfoundland. | |
6 | .\" | |
7 | .\" %sccs.include.redist.man% | |
8 | .\" | |
9 | .\" @(#)tsort.1 6.2 (Berkeley) %G% | |
10 | .\" | |
11 | .TH tsort 1 "" | |
d8e69841 KM |
12 | .AT 3 |
13 | .SH NAME | |
07d825db | 14 | tsort \- topological sort of a directed graph |
d8e69841 | 15 | .SH SYNOPSIS |
07d825db KB |
16 | .nf |
17 | .ft B | |
18 | tsort [ file ] | |
19 | .ft R | |
20 | .fi | |
d8e69841 KM |
21 | .SH DESCRIPTION |
22 | .I Tsort | |
07d825db KB |
23 | takes a list of pairs of node names representing directed arcs in |
24 | a graph and prints the nodes in topological order on standard output. | |
25 | Input is taken from the named file, or from standard input if no file | |
26 | is given. | |
27 | .PP | |
28 | Node names in the input are separated by white space and there must be an | |
29 | even number of nodes. | |
30 | .PP | |
31 | Presence of a node in a graph can be represented by an arc from the node | |
32 | to itself. | |
33 | This is useful when a node is not connected to any other nodes. | |
d8e69841 | 34 | .PP |
07d825db KB |
35 | If the graph contains a cycle (and therefore cannot be properly sorted), |
36 | one of the arcs in the cycle is ignored and the sort continues. | |
37 | Cycles are reported on standard error. |