Lin-Kernighan heuristic for the TSP and minimum weight perfect matching
源代码在线查看: table.tex
\documentclass{article} \pagestyle{myheadings} \markright{\today \#1} \def\linezerom#1{#1\\ \hline} \def\lineonem#1#2{#1 & #2 \\ \hline} \def\linetwom#1#2#3{#1 & #2 & #3 \\ \hline} \def\linethreem#1#2#3#4{#1 & #2 & #3 & #4 \\ \hline} \def\renderpair#1#2#3#4{#1 & #2 & #4} \def\renderpair#1#2#3#4{#1 & #2 & #3} \def\manytable#1{\par\vbox{\vbox{#1}\vbox{\begin{tabular}{|l||r|r|r||r|r|r||r|r|r|rrrr}\hline \input #1 \end{tabular}}}\vskip 1cm} \def\fewtable#1{\par\vbox{\vbox{#1}\vbox{\begin{tabular}{|l||r|r|r||r|r|r|}\hline \input #1 \end{tabular}}}\vskip 1cm} \begin{document} %%%%%%%%%%%%%%%%%%%% TSP %%%%%% TSPLIB few \def\renderpair#1#2#3#4{#1 & #2 & #3} \fewtable{table.tsp.tsplib.few.hk.pct.out} \fewtable{table.tsp.tsplib.few.hk-estimate.pct.out} \fewtable{table.tsp.tsplib.few.optimal.pct.out} %% render time \def\renderpair#1#2#3#4{#1 & #2 & #4} \fewtable{table.tsp.tsplib.few.hk.time.out} \tracingcommands=1 \fewtable{table.tsp.tsplib.few.hk-estimate.time.out} \fewtable{table.tsp.tsplib.few.optimal.time.out} %lllllllfewmany %%%%%% TSPLIB many %% render pct \def\renderpair#1#2#3#4{#1 & #2 & #3} \manytable{table.tsp.tsplib.many.hk.pct.out} \manytable{table.tsp.tsplib.many.hk-estimate.pct.out} \manytable{table.tsp.tsplib.many.optimal.pct.out} %% render time \def\renderpair#1#2#3#4{#1 & #2 & #4} \manytable{table.tsp.tsplib.many.hk.time.out} \manytable{table.tsp.tsplib.many.hk-estimate.time.out} \manytable{table.tsp.tsplib.many.optimal.time.out} %%%%%% Ben few %% render pct \def\renderpair#1#2#3#4{#1 & #2 & #3} \fewtable{table.tsp.ben.few.hka.pct.out} \fewtable{table.tsp.ben.few.hka.pct.out.con} %% render time \def\renderpair#1#2#3#4{#1 & #2 & #4} \fewtable{table.tsp.ben.few.hka.time.out} \fewtable{table.tsp.ben.few.hka.time.out.con} %%%%%% DSJR few %% render pct \def\renderpair#1#2#3#4{#1 & #2 & #3} \manytable{table.tsp.dsjr.small.many.hka.pct.out} \manytable{table.tsp.dsjr.small.many.hka.pct.out.con} %% render time \def\renderpair#1#2#3#4{#1 & #2 & #4} \manytable{table.tsp.dsjr.small.many.hka.time.out} \manytable{table.tsp.dsjr.small.many.hka.time.out.con} % Unif big % Clones %%%%%%%%%%%%%%%%%%%% WPM %%%%%%%%%%% TSPLIB %% render pct \def\renderpair#1#2#3#4{#1 & #2 & #3} \manytable{table.wpm.tsplib.optimal.pct.out} %% render time \def\renderpair#1#2#3#4{#1 & #2 & #4} \manytable{table.wpm.tsplib.optimal.time.out} %%%%%%%%%%% Ben %% render pct \def\renderpair#1#2#3#4{#1 & #2 & #3} \manytable{table.wpm.ben.optimal.pct.out} \manytable{table.wpm.ben.optimal.pct.out.con} %% render time \def\renderpair#1#2#3#4{#1 & #2 & #4} \manytable{table.wpm.ben.optimal.time.out} \manytable{table.wpm.ben.optimal.time.out.con} %%%%%%%%%%% DSJR %% render pct \def\renderpair#1#2#3#4{#1 & #2 & #3} \manytable{table.wpm.dsjr.small.optimal.pct.out} \manytable{table.wpm.dsjr.small.optimal.pct.out.con} %% render time \def\renderpair#1#2#3#4{#1 & #2 & #4} \manytable{table.wpm.dsjr.small.optimal.time.out} \manytable{table.wpm.dsjr.small.optimal.time.out.con} % Unif big % Clones \end{document}