Minimum Spanning Tree by nn

{A[$3]=$0}END{for(;i++<122;)if($0=A[i]){n=!index(x=b[$1],FS$2FS)
print n?"T":"F",$0
$0=b[$2]x$0
for(n*=NF;n;n--)b[$n]=FS$0FS}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page