Daniel@0: .TH CCOMPS 1 "27 August 2008" Daniel@0: .SH NAME Daniel@0: ccomps \- connected components filter for graphs Daniel@0: .SH SYNOPSIS Daniel@0: .B ccomps Daniel@0: [ Daniel@0: .B \-sxvnzC? Daniel@0: ] Daniel@0: [ Daniel@0: .BI -X [#]v Daniel@0: ] Daniel@0: [ Daniel@0: .BI -o outfile Daniel@0: ] Daniel@0: [ Daniel@0: .I files Daniel@0: ] Daniel@0: .SH DESCRIPTION Daniel@0: .B ccomps Daniel@0: decomposes graphs into their connected components, Daniel@0: printing the components to standard output. Daniel@0: .SH OPTIONS Daniel@0: The following options are supported: Daniel@0: .TP Daniel@0: .B \-s Daniel@0: No output graph is printed. The return value can be used to Daniel@0: check if the graph is connected or not. Daniel@0: .TP Daniel@0: .B \-x Daniel@0: Only the connected components are printed, as separate graphs. Daniel@0: .TP Daniel@0: .B \-v Daniel@0: Counts of nodes, edges and connected components are printed. Daniel@0: .TP Daniel@0: .B \-z Daniel@0: Sort components by size, with the largest first. This is only Daniel@0: effective if either \fB-x\fP or \fB-X#v\fP is present. Daniel@0: Thus, \fB-zX#0\fP will cause the largest component to be printed. Daniel@0: .TP Daniel@0: .B \-C Daniel@0: Use clusters in computing components in addition to normal edge Daniel@0: connectivity. In essence, this gives the connected components of the Daniel@0: derived graph in which nodes top-level clusters and nodes in the Daniel@0: original graph. This maintains all subgraph structure within a Daniel@0: component, even if a subgraph does not contain any nodes. Daniel@0: .TP Daniel@0: .B \-n Daniel@0: Do not project subgraph structure. Normally, if Daniel@0: .B ccomps Daniel@0: produces components as graphs distinct from the input graph, it will Daniel@0: define subgraphs which are projections of subgraphs of the input graph Daniel@0: onto the component. (If the projection is empty, no subgraph is produced.) Daniel@0: If this flag is set, the component contains only the relevant nodes and Daniel@0: edges. Daniel@0: .TP Daniel@0: .BI \-X " node_name" Daniel@0: Prints only the component containing the node \fInode_name\fP, Daniel@0: if any. Daniel@0: .TP Daniel@0: .BI \-X# " index" Daniel@0: Prints only component number \fIindex\fP, if any, starting at 0. Daniel@0: .TP Daniel@0: .BI \-o " outfile" Daniel@0: If specified, each graph will be written to a different file Daniel@0: with the names derived from \fIoutfile\fP. In particular, Daniel@0: if both \fB-o\fP and \fB-x\fP flags are used, then each connected Daniel@0: component is written to a different file. If \fIoutfile\fP does Daniel@0: not have a suffix, the first file will have the name \fIoutfile\fP; Daniel@0: then next \fIoutfile_1\fP, then next \fIoutfile_2\fP, and so on. Daniel@0: If \fIoutfile\fP has a suffix, i.e., has the form \fIbase.sfx\fP, Daniel@0: then the files will be named \fIbase.sfx\fP, \fIbase_1.sfx\fP, Daniel@0: \fIbase_2.sfx\fP, etc. Daniel@0: .LP Daniel@0: By default, each input graph is printed, with each connected Daniel@0: component given as a subgraph whose name is a concatenation of Daniel@0: the name of the input graph, the string "_component_" and the Daniel@0: number of the component. Daniel@0: .SH OPERANDS Daniel@0: The following operand is supported: Daniel@0: .TP 8 Daniel@0: .I files Daniel@0: Names of files containing 1 or more graphs in dot format. Daniel@0: If no Daniel@0: .I files Daniel@0: operand is specified, Daniel@0: the standard input will be used. Daniel@0: .SH RETURN CODES Daniel@0: Unless used to extract a single connected component, Daniel@0: .B ccomps Daniel@0: returns Daniel@0: .B 0 Daniel@0: if all the input graphs are connected; and Daniel@0: non-zero if any graph has multiple components, or any error occurred. Daniel@0: If just extracting a single component, Daniel@0: .B ccomps Daniel@0: returns Daniel@0: .B 0 Daniel@0: on success and non-zero if an error occurred. Daniel@0: .SH "BUGS" Daniel@0: It is possible, though unlikely, that the names used for connected Daniel@0: components and their subgraphs may conflict with existing subgraph names. Daniel@0: .SH AUTHORS Daniel@0: Stephen C. North Daniel@0: .br Daniel@0: Emden R. Gansner Daniel@0: .SH "SEE ALSO" Daniel@0: gc(1), dot(1), gvpr(1), gvcolor(1), acyclic(1), sccmap(1), tred(1), libgraph(3)