【发布时间】:2013-09-26 05:45:26
【问题描述】:
我有一个存储有向图的文件。每行表示为
node1 TAB node2 TAB 权重
我想找到节点集。有没有更好的工会方式?我目前的解决方案涉及创建临时文件:
cut -f1 input_graph | sort | uniq > nodes1
cut -f2 input_graph | sort | uniq > nodes2
cat nodes1 nodes2 | sort | uniq > nodes
【问题讨论】: