summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-09-27 19:55:22 -0500
committerJesse Luehrs <doy@tozt.net>2009-09-27 19:55:22 -0500
commitd3f5434771448cc63a54d6c51e0d4fdbdd675633 (patch)
tree88a10976eb628ce5adeb88ed8eff3cc2a033ecf8
parentb0cbb6127e3ab72f57971b7a2a9ff8b024f360f4 (diff)
downloadgraph-implicit-d3f5434771448cc63a54d6c51e0d4fdbdd675633.tar.gz
graph-implicit-d3f5434771448cc63a54d6c51e0d4fdbdd675633.zip
switch to Heap::Fibonacci::Fast instead of Heap::Simple
-rw-r--r--dist.ini3
-rw-r--r--lib/Graph/Implicit.pm10
2 files changed, 4 insertions, 9 deletions
diff --git a/dist.ini b/dist.ini
index 8fce889..2ce8d33 100644
--- a/dist.ini
+++ b/dist.ini
@@ -8,8 +8,7 @@ abstract = graph algorithms for graphs that aren\'t necessarily fully specified
[@Classic]
[Prereq]
-Heap::Simple = 0
-Heap::Simple::Perl = 0
+Heap::Fibonacci::Fast = 0
List::MoreUtils = 0
Test::More = 0
Test::Deep = 0
diff --git a/lib/Graph/Implicit.pm b/lib/Graph/Implicit.pm
index ac37291..e4ce6c9 100644
--- a/lib/Graph/Implicit.pm
+++ b/lib/Graph/Implicit.pm
@@ -1,7 +1,7 @@
use strict;
use warnings;
package Graph::Implicit;
-use Heap::Simple;
+use Heap::Fibonacci::Fast;
use List::MoreUtils qw/apply/;
=head1 NAME
@@ -187,7 +187,7 @@ sub dfs {
#my $self = shift;
#my ($start, $code) = @_;
#return $self->_traversal($start, $code,
- #sub { Heap::Simple->new(elements => 'Any') },
+ #sub { Heap::Fibonacci::Fast->new },
#sub { $_[0]->count },
#sub { $_[0]->key_insert($_[2], $_[1]) },
#sub { $_[0]->extract_top });
@@ -229,7 +229,7 @@ sub astar {
my $self = shift;
my ($from, $heuristic, $scorer) = @_;
- my $pq = Heap::Simple->new(elements => "Any");
+ my $pq = Heap::Fibonacci::Fast->new;
my %neighbors;
my ($max_vert, $max_score) = (undef, 0);
my %dist = ($from => 0);
@@ -323,10 +323,6 @@ sub make_path {
return reverse @path;
}
-=head1 NOTES
-
-This module uses L<Heap::Simple> for several of the algorithms. Unfortunately, L<Heap::Simple> doesn't provide a default implementation, so this module depends explicitly on L<Heap::Simple::Perl>, to avoid XS dependencies. The L</dijkstra> and L</astar> algorithms will run much faster if you install L<Heap::Simple::XS> manually.
-
=head1 BUGS
No known bugs.