=head1 NAME

botch-extract-scc - extract all strongly connected components

=head1 SYNOPSIS

=over

=item B<botch-extract-scc> [options] I<graph.xml> [I<prefix>]

=back

=head1 DESCRIPTION

Extract strongly connected components (SCC) from an input graph in GraphML or
dot format.

The strongly connected components are stored as one file each in either the
current directory or the directory given by the B<--outdir> option.

The file names that were generated for them are printed on standard output.

By default that filename is of the format PREFIX_VERTEX_SIZE.EXT where PREFIX
can be set on the command line, while VERTEX defaults to the vertex ID chosen
by network, SIZE is the size of the SCC and EXT is xml by default but can be
set using the B<--extension> option. This is to reduce the possibility that two
output graph files happen to have the same name. You can make them more unique
by using the B<--outfnamevert> and B<--outfnameattr> options which refine the
string that will be printed for VERTEX.

=head1 OPTIONS

=over 4

=item B<-h, --help>

Show help.

=item B<--outdir=>I<DIR>

output directory. Default is current directory

=item B<--outfnamevert=>I<VERT>

This option picks the set of vertices from which the smallest one (by string
comparison of the attribute determined by the B<--outfnameattr> option) will be
chosen to be stored in place of VERTEX in the output file name.  The VERT
argument is a key/value pair (separated by a colon) of a graph attribute and
its value. By default (without this option), all vertices of the graph are
considered.

The special key C<__ID__> allows one to select the unique vertex identifier.

This option can be specified more than once. The final set of vertices is
chosen such that all vertices match all key/value pairs. Multiple
B<--outfnamevert> options thus form a logical conjunction (they are AND-ed
together).

=item B<--outfnameattr=>I<attribute>

This option picks the vertex attribute that is to be printed in VERTEX in the
output file name.

=item B<--extension=>I<EXT>

Output files have extension I<EXT>. Default is xml. This option also governs
the output format. The xml extension saves in GraphML format while the dot
extension saves in the dot format.

=item B<-v, --verbose>

Be verbose.

=back

=head1 EXAMPLE

Extract the strongly connected components of a buildgraph and store them in the
directory "out", prefixing each filename with "cyclic" and let the VERTEX value
be the cudfname field of source packages only.

 botch-extract-scc --verbose --outdir=out --outfnameattr=cudfname --outfnamevert type:src buildgraph.xml cyclic

=head1 BUGS

See L<http://bugs.debian.org/botch>.

=head1 SEE ALSO

Debian doc-base Manual F</usr/share/doc/botch/wiki/Home.html>

=head1 AUTHOR

This man page was written by Johannes Schauer. Botch is written by Johannes
Schauer and Pietro Abate.

=head1 COPYRIGHT

Copyright 2012-2014 Johannes Schauer, Pietro Abate

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version. A special linking exception to the GNU Lesser General Public
License applies to this library, see the COPYING file for more information.

