Algorithm-Networksort

 view release on metacpan or  search on metacpan

lib/Algorithm/Networksort/Best.pm  view on Meta::CPAN

    	print $nw->title(), "\n", $nw, "\n";
    }

To get the list of all available names (regardless of input size), simply
call the function with no argument:

    my @names = nwsrt_best_names();

=cut

sub nw_best_names
{
	my($inputs) = @_;

	return keys %nw_best_by_name unless (defined $inputs);

	unless (exists $nw_best_by_input{$inputs})
	{
		carp "No 'best' sorting networks exist for size $inputs";
		return ();
	}

	return @{$nw_best_by_input{$inputs}};
}

=head3 nw_best_title

Return a descriptive title for the network, given a name key.

    $title = nw_best_title($key);

These are the titles for the available networks. By themselves, they provide
a readable list of choices for an interactive program. They are not to be
confused with a sorting network's title, which may be set by the programmer.

=cut

sub nw_best_title
{
	my $key = shift;
	
	unless (exists $nw_best_by_name{$key})
	{
		carp "Unknown 'best' name '$key'.";
		return "";
	}

	return $nw_best_by_name{$key}{title};
}

1;
__END__

=head1 ACKNOWLEDGMENTS

L<Doug Hoyte|https://github.com/hoytech> pointed out Sherenaz Waleed
Al-Haj Baddar's paper.

L<Morwenn|https://github.com/Morwenn> found for me the SAT and SENSO
papers, contributed 23-input and 24-input sorting networks, and caught
documentation errors.

=head1 SEE ALSO

=head2 Non-algorithmic discoveries

=over 3

=item

The networks by Floyd, Green, Shapiro, and Waksman are in
Donald E. Knuth's B<The Art of Computer Programming, Vol. 3:
Sorting and Searching> (2nd ed.), Addison Wesley Longman Publishing Co., Inc.,
Redwood City, CA, 1998.

=item

The Evolving Non-Determinism (END) algorithm by Hugues Juillé has found
more efficient sorting networks:
L<http://www.cs.brandeis.edu/~hugues/sorting_networks.html>.

=item

The 18 and 22 input networks found by Sherenaz Waleed Al-Haj Baddar
are described in her dissertation "Finding Better Sorting Networks" at
L<http://etd.ohiolink.edu/view.cgi?acc_num=kent1239814529>.

=item

The 16 input network found by David C. Van Voorhis is described in chapter
5 of B<Designing Sorting Networks>, by Sherenaz W. Al-Haj Baddar and Kenneth E.
Batcher.

=item

The Symmetry and Evolution based Network Sort Optimization (SENSO) found more
networks for inputs of 9 through 23.

=item

Morwenn's 23 and 24-input networks are described at
L<https://github.com/Morwenn/cpp-sort/wiki/Original-research#sorting-networks-23-and-24>.

=item

Ian Parberry, "A computer assisted optimal depth lower bound for sorting
networks with nine inputs", L<http://www.eng.unt.edu/ian/pubs/snverify.pdf>.

=back

=head1 AUTHOR

John M. Gamble may be found at B<jgamble@cpan.org>

=cut



( run in 1.538 second using v1.01-cache-2.11-cpan-adec679a428 )