From 140d103796ebf22b0e951034c6c1152d4271eae7 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 21 Jun 2009 13:41:00 -0500 Subject: add SYNOPSIS --- lib/Graph/Implicit.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/Graph/Implicit.pm b/lib/Graph/Implicit.pm index c69e17d..b9a3556 100644 --- a/lib/Graph/Implicit.pm +++ b/lib/Graph/Implicit.pm @@ -10,6 +10,18 @@ Graph::Implicit - graph algorithms for implicitly specified graphs =head1 SYNOPSIS + my $graph = Graph::Implicit->new(sub { + my $tile = shift; + map { [$_, $_->intrinsic_cost] } + $tile->grep_adjacent(sub { $_[0]->is_walkable }) + }); + my @reachable_vertices = $graph->vertices; + my @reachable_edges = $graph->edges; + my ($sssp_predecessors, $dest_vertex) = $graph->dijkstra( + current_tile(), + sub { is_target($_[0]) ? 'q' : 0 }, + ); + my @sssp_path = $graph->make_path($sssp_predecessors, $dest_vertex); =head1 DESCRIPTION @@ -265,15 +277,3 @@ the same terms as perl itself. =cut 1; - -__END__ - -=for example - -sub { - map { [$_, $_->intrinsic_cost] } - shift->grep_adjacent(sub { shift->is_walkable }) -} - -=cut - -- cgit v1.2.3-54-g00ecf