summaryrefslogtreecommitdiffstats
path: root/lib/Graph/Implicit.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Graph/Implicit.pm')
-rw-r--r--lib/Graph/Implicit.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Graph/Implicit.pm b/lib/Graph/Implicit.pm
index 26f4f5c..828c67f 100644
--- a/lib/Graph/Implicit.pm
+++ b/lib/Graph/Implicit.pm
@@ -28,6 +28,9 @@ sub edges {
}
sub neighbors {
+ my $self = shift;
+ my ($from) = @_;
+ return $self->($from);
}
# traversal
@@ -73,7 +76,7 @@ sub dijkstra {
($max_vert, $max_score) = ($vertex, $score)
if ($score > $max_score);
}
- $neighbors{$vertex} = [$self->($vertex)]
+ $neighbors{$vertex} = [$self->neighbors($vertex)]
unless exists $neighbors{$vertex};
for my $neighbor (@{ $neighbors{$vertex} }) {
my ($vert_n, $weight_n) = @{ $neighbor };