scc
Count lines of code in files
TLDR
Print lines of code in the current directory
Print lines of code in the target directory
Display output for every file
Display output using a specific output format (defaults to tabular)
Only count files with specific file extensions
Exclude directories from being counted
Display output and sort by column (defaults to by files)
Display help
SYNOPSIS
scc < input_graph
DESCRIPTION
The `scc` command identifies and outputs the strongly connected components (SCCs) within a directed graph. It reads the graph structure from standard input, where each line represents an edge specified by two vertex numbers separated by whitespace. The command then computes the SCCs using a standard graph traversal algorithm (e.g., Kosaraju's algorithm or Tarjan's algorithm). The output consists of a list of SCCs, with each SCC represented by a list of vertices belonging to that component. This utility is useful for analyzing dependencies, identifying circular references, and understanding the overall structure of complex systems modeled as directed graphs. It finds applications in areas like compiler design (dependency analysis), network analysis, and software engineering (analyzing module dependencies). Note: While similar names may exist for source code counting tools (e.g., `sloccount`), this definition focuses on the graph-theoretical SCC analysis tool often included within graph processing suites.
CAVEATS
The `scc` command typically expects vertex numbers to be integers. Input graphs should be formatted correctly with space-separated vertices for each edge. Error handling for invalid input might be minimal.
INPUT FORMAT
The input graph must be represented as a list of edges on standard input. Each line represents one edge, with the source and destination vertices separated by whitespace. For example:
1 2
2 3
3 1
4 5
This input represents a graph with edges from vertex 1 to 2, 2 to 3, 3 to 1, and 4 to 5.
OUTPUT FORMAT
The output is a list of strongly connected components. Each component is represented by a list of vertices belonging to that component, typically enclosed in parentheses or braces and separated by spaces or commas. The order of components and vertices within each component may vary. For example, for the example graph in "Input Format", an example output might be:
{1, 2, 3}
{4, 5}
SEE ALSO
acyclic(1), components(1), transitive_closure(1)