summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-06-21 13:41:00 -0500
committerJesse Luehrs <doy@tozt.net>2009-06-21 13:41:00 -0500
commit140d103796ebf22b0e951034c6c1152d4271eae7 (patch)
treea1ce290d716bb0e007016dafeb394e7c14dbc95b
parent42dd14730e38ea8c01d9165b7dba99e4509f79f4 (diff)
downloadgraph-implicit-140d103796ebf22b0e951034c6c1152d4271eae7.tar.gz
graph-implicit-140d103796ebf22b0e951034c6c1152d4271eae7.zip
add SYNOPSIS
-rw-r--r--lib/Graph/Implicit.pm24
1 files 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
-