1CCOMPS(1) General Commands Manual CCOMPS(1)
2
3
4
6 ccomps - connected components filter for graphs
7
9 ccomps [ -sxvenzC? ] [ -X[#]s[-f] ] [ -ooutfile ] [ files ]
10
12 ccomps decomposes graphs into their connected components, printing the
13 components to standard output.
14
16 The following options are supported:
17
18 -e Do not induce edges in the connected components.
19
20 -s No output graph is printed. The return value can be used to
21 check if the graph is connected or not.
22
23 -x Only the connected components are printed, as separate graphs.
24
25 -v Counts of nodes, edges and connected components are printed.
26
27 -z Sort components by size, with the largest first. This is only
28 effective if either -x or -X# is present. Thus, -zX#0 will
29 cause the largest component to be printed.
30
31 -C Use clusters in computing components in addition to normal edge
32 connectivity. In essence, this gives the connected components of
33 the derived graph in which nodes top-level clusters and nodes in
34 the original graph. This maintains all subgraph structure within
35 a component, even if a subgraph does not contain any nodes.
36
37 -n Do not project subgraph structure. Normally, if ccomps produces
38 components as graphs distinct from the input graph, it will
39 define subgraphs which are projections of subgraphs of the input
40 graph onto the component. (If the projection is empty, no sub‐
41 graph is produced.) If this flag is set, the component contains
42 only the relevant nodes and edges.
43
44 -X node_name
45 Prints only the component containing the node node_name, if any.
46
47 -X# start
48
49 -X# start-
50
51 -X# start-last
52 Prints only components in the given range. In the first form,
53 only the component whose index is start, if any, is printed. In
54 the second form, each component whose index is at least start is
55 printed. In the last form, only those components whose indices
56 are in the range [Istart,last] are printed. Thus, the flag -x
57 is equivalent to -X#0-.
58
59 -o outfile
60 If specified, each graph will be written to a different file
61 with the names derived from outfile. In particular, if both -o
62 and -x flags are used, then each connected component is written
63 to a different file. If outfile does not have a suffix, the
64 first file will have the name outfile; then next outfile_1, then
65 next outfile_2, and so on. If outfile has a suffix, i.e., has
66 the form base.sfx, then the files will be named base.sfx,
67 base_1.sfx, base_2.sfx, etc.
68
69 By default, each input graph is printed, with each connected component
70 given as a subgraph whose name is a concatenation of the name of the
71 input graph, the string "_cc_" and the number of the component.
72
74 The following operand is supported:
75
76 files Names of files containing 1 or more graphs in dot format. If
77 no files operand is specified, the standard input will be used.
78
80 Unless used to extract a single connected component, ccomps returns 0
81 if all the input graphs are connected; and non-zero if any graph has
82 multiple components, or any error occurred. If just extracting a sin‐
83 gle component, ccomps returns 0 on success and non-zero if an error
84 occurred.
85
87 It is possible, though unlikely, that the names used for connected com‐
88 ponents and their subgraphs may conflict with existing subgraph names.
89
91 Stephen C. North <north@research.att.com>
92 Emden R. Gansner <erg@research.att.com>
93
95 gc(1), dot(1), gvpr(1), gvcolor(1), acyclic(1), sccmap(1), tred(1),
96 libgraph(3)
97
98
99
100 30 April 2011 CCOMPS(1)