From d3f5434771448cc63a54d6c51e0d4fdbdd675633 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 27 Sep 2009 19:55:22 -0500 Subject: switch to Heap::Fibonacci::Fast instead of Heap::Simple --- dist.ini | 3 +-- lib/Graph/Implicit.pm | 10 +++------- 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 for several of the algorithms. Unfortunately, L doesn't provide a default implementation, so this module depends explicitly on L, to avoid XS dependencies. The L and L algorithms will run much faster if you install L manually. - =head1 BUGS No known bugs. -- cgit v1.2.3-54-g00ecf