⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 least.pl.in

📁 Lin-Kernighan heuristic for the TSP and minimum weight perfect matching
💻 IN
字号:
#! @PERL@ -w# @configure_input@## leastlength.pl# Find the least length for a given instance.# usage: # 	leastlength.pl file1 file2 ...## output is name of instance followed by the least length value seen on the# inputs for that instance.## Key is instance name.  Value is the least length.my %instance = ();my $files = join(' ',@ARGV);my $this_instance = "";open(IN,"zcat $files|");while(<IN>) {	chop;	if (m/^Instance name:\s+([^\s]+)/) {		$this_instance=$1;#print "instance $1\n";	} elsif (m/^Length:\s+([^\s]+)/) {		my $least = $instance{$this_instance};		$this_length=$1+0;#print "length $1 least $least\n";		if ( !defined($least) || $least >$this_length ) {			$instance{$this_instance} =  $this_length;		}	}}my $i;for $i ( keys(%instance) ) {	print "$i $instance{$i}\n";}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -