Linux command
tred 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Compute transitive reduction
tred [input.dot] > [output.dot]
Process from stdin
cat [graph.dot] | tred > [reduced.dot]
Show verbose output
tred -v [input.dot]
Reduce graph before rendering
tred [graph.dot] | dot -Tpng -o [output.png]
说明
tred computes the transitive reduction of directed graphs. It removes edges that are implied by transitivity, simplifying the graph while preserving reachability relationships. In a transitive reduction, if there exists a path from node A to node C through node B (A→B→C), the direct edge A→C is removed as redundant. This is particularly useful for simplifying dependency graphs, inheritance hierarchies, and other directed graphs where implied relationships clutter visualization. The tool reads graphs in DOT format from input files or standard input, and outputs the reduced graph to standard output. Nodes and subgraphs are preserved; only redundant edges are removed. Undirected graphs are silently ignored. tred is commonly used as a preprocessor to dot to reduce visual clutter in dense graph layouts.
参数
- -v
- Verbose output. Print information about removed edges to stderr.
- -?
- Print usage information and exit.
FAQ
What is the tred command used for?
tred computes the transitive reduction of directed graphs. It removes edges that are implied by transitivity, simplifying the graph while preserving reachability relationships. In a transitive reduction, if there exists a path from node A to node C through node B (A→B→C), the direct edge A→C is removed as redundant. This is particularly useful for simplifying dependency graphs, inheritance hierarchies, and other directed graphs where implied relationships clutter visualization. The tool reads graphs in DOT format from input files or standard input, and outputs the reduced graph to standard output. Nodes and subgraphs are preserved; only redundant edges are removed. Undirected graphs are silently ignored. tred is commonly used as a preprocessor to dot to reduce visual clutter in dense graph layouts.
How do I run a basic tred example?
Run `tred [input.dot] > [output.dot]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -v do in tred?
Verbose output. Print information about removed edges to stderr.