TSP(Traveling salesman problem)입니다.
이 그림이 멋지게 정리된 모양으로 나와야 되는데
수업중 배운 기본 알고리즘 가지고는 그다지 멋지게 나오지 않는군요 0.0
이제 이번주 나머지는 다른 과제 때문에 다음주에나 봐야 할 듯.
일단 돌아가는 게 어디냐.. -.-
(졸업한 친구가 예전 숙제할 때 화면에 그리는 자바 클래스를 만들어두었네요 매우 감사)
http://www.cpqlinux.com/redirect.html
[root@server /root]# ./cmd 1>out.txt 2>err.txt
[root@server /root]# ./cmd 1>>out.txt 2>>err.txt
[root@server /root]# (((./cmd | tee stdout.txt) 3>&1 1>&2 2>&3\ |tee stderr.txt) 3>&1 1>&2 2>&3) 1>out.txt 2>err.txt
Note: Lines that end in a backslash are continued on the next line. Any such lines should be keyed in as one complete line. The lines are too long to fit on the web page without formatting them this way.
[root@server /root]# ./cmd | tee stdout.txt
stdout goes through the pipe and tee is able to save a copy of it to the file “stdout.txt”; however, we just lost control of stderr. stderr will not go through the pipe, instead it goes directly to our display.
[root@server /root]# (./cmd | tee stdout.txt)
Capturing stderr
Now that we have swapped our stdout and stderr, lets hook up tee once again. tee will now capture stderr (tee believes that it is really stdout because stdout is the only thing that can come through the pipe).
[root@server /root]# (./cmd | tee stdout.txt) 3>&1 1>&2 2>&3 \ | tee stderr.txt