| 1 |
.TH CCOMPS 1 "30 April 2011" |
| 2 |
.SH NAME |
| 3 |
ccomps \- connected components filter for graphs |
| 4 |
.SH SYNOPSIS |
| 5 |
.B ccomps |
| 6 |
[ |
| 7 |
.B \-sxvenzC? |
| 8 |
] |
| 9 |
[ |
| 10 |
.BI \-X [#%]s[\-f] |
| 11 |
] |
| 12 |
[ |
| 13 |
.BI \-o outfile |
| 14 |
] |
| 15 |
[ |
| 16 |
.I files |
| 17 |
] |
| 18 |
.SH DESCRIPTION |
| 19 |
.B ccomps |
| 20 |
decomposes graphs into their connected components, |
| 21 |
printing the components to standard output. |
| 22 |
.SH OPTIONS |
| 23 |
The following options are supported: |
| 24 |
.TP |
| 25 |
.B \-e |
| 26 |
Do not induce edges in the connected components. |
| 27 |
.TP |
| 28 |
.B \-s |
| 29 |
No output graph is printed. The return value can be used to |
| 30 |
check if the graph is connected or not. |
| 31 |
.TP |
| 32 |
.B \-x |
| 33 |
Only the connected components are printed, as separate graphs. |
| 34 |
.TP |
| 35 |
.B \-v |
| 36 |
Counts of nodes, edges and connected components are printed. |
| 37 |
.TP |
| 38 |
.B \-z |
| 39 |
Sort components by size, with the largest first. This is only |
| 40 |
effective if either \fB\-x\fP or \fB\-X#\fP is present. |
| 41 |
Thus, \fB\-zX#0\fP will cause the largest component to be printed. |
| 42 |
.TP |
| 43 |
.B \-C |
| 44 |
Use clusters in computing components in addition to normal edge |
| 45 |
connectivity. In essence, this gives the connected components of the |
| 46 |
derived graph in which nodes top-level clusters and nodes in the |
| 47 |
original graph. This maintains all subgraph structure within a |
| 48 |
component, even if a subgraph does not contain any nodes. |
| 49 |
.TP |
| 50 |
.B \-n |
| 51 |
Do not project subgraph structure. Normally, if |
| 52 |
.B ccomps |
| 53 |
produces components as graphs distinct from the input graph, it will |
| 54 |
define subgraphs which are projections of subgraphs of the input graph |
| 55 |
onto the component. (If the projection is empty, no subgraph is produced.) |
| 56 |
If this flag is set, the component contains only the relevant nodes and |
| 57 |
edges. |
| 58 |
.TP |
| 59 |
.BI \-X " node_name" |
| 60 |
Prints only the component containing the node \fInode_name\fP, |
| 61 |
if any. |
| 62 |
.TP |
| 63 |
.BI \-X# " start" |
| 64 |
.TP |
| 65 |
.BI \-X# " start-" |
| 66 |
.TP |
| 67 |
.BI \-X# " start-last" |
| 68 |
Prints only components in the given range of indices. In the first form, only |
| 69 |
the component whose index is \fIstart\fP, if any, is printed. |
| 70 |
In the second form, each component whose index is at least \fIstart\fP |
| 71 |
is printed. In the last form, only those components whose indices are |
| 72 |
in the range \fB[\fP\fIIstart\fP\fB,\fP\fIlast\fP\fB]\fP are printed. |
| 73 |
Thus, the flag \fB\-x\fP is equivalent to \fB\-X#0-\fP. |
| 74 |
.TP |
| 75 |
.BI \-X% " min" |
| 76 |
.TP |
| 77 |
.BI \-X% " min-" |
| 78 |
.TP |
| 79 |
.BI \-X% " min-max" |
| 80 |
Prints only components in the given range of sizes. In the first form, only |
| 81 |
a component whose size is \fImin\fP, if any, is printed. |
| 82 |
In the second form, each component whose size is at least \fImin\fP |
| 83 |
is printed. In the last form, only those components whose sizes are |
| 84 |
in the range \fB[\fP\fIImin\fP\fB,\fP\fImax\fP\fB]\fP are printed. |
| 85 |
.TP |
| 86 |
.BI \-o " outfile" |
| 87 |
If specified, each graph will be written to a different file |
| 88 |
with the names derived from \fIoutfile\fP. In particular, |
| 89 |
if both \fB\-o\fP and \fB\-x\fP flags are used, then each connected |
| 90 |
component is written to a different file. If \fIoutfile\fP does |
| 91 |
not have a suffix, the first file will have the name \fIoutfile\fP; |
| 92 |
then next \fIoutfile_1\fP, then next \fIoutfile_2\fP, and so on. |
| 93 |
If \fIoutfile\fP has a suffix, i.e., has the form \fIbase.sfx\fP, |
| 94 |
then the files will be named \fIbase.sfx\fP, \fIbase_1.sfx\fP, |
| 95 |
\fIbase_2.sfx\fP, etc. |
| 96 |
.LP |
| 97 |
By default, each input graph is printed, with each connected |
| 98 |
component given as a subgraph whose name is a concatenation of |
| 99 |
the name of the input graph, the string "_cc_" and the |
| 100 |
number of the component. |
| 101 |
.SH OPERANDS |
| 102 |
The following operand is supported: |
| 103 |
.TP 8 |
| 104 |
.I files |
| 105 |
Names of files containing 1 or more graphs in dot format. |
| 106 |
If no |
| 107 |
.I files |
| 108 |
operand is specified, |
| 109 |
the standard input will be used. |
| 110 |
.SH RETURN CODES |
| 111 |
Unless used to extract a single connected component, |
| 112 |
.B ccomps |
| 113 |
returns |
| 114 |
.B 0 |
| 115 |
if all the input graphs are connected; and |
| 116 |
non-zero if any graph has multiple components, or any error occurred. |
| 117 |
If just extracting a single component, |
| 118 |
.B ccomps |
| 119 |
returns |
| 120 |
.B 0 |
| 121 |
on success and non-zero if an error occurred. |
| 122 |
.SH "BUGS" |
| 123 |
It is possible, though unlikely, that the names used for connected |
| 124 |
components and their subgraphs may conflict with existing subgraph names. |
| 125 |
.SH AUTHORS |
| 126 |
Stephen C. North <[email protected]> |
| 127 |
.br |
| 128 |
Emden R. Gansner <[email protected]> |
| 129 |
.SH "SEE ALSO" |
| 130 |
gc(1), dot(1), gvpr(1), gvcolor(1), acyclic(1), sccmap(1), tred(1), libgraph(3) |