Path::Graph

Path::Graph is a Perl module created to generate paths from hash graph.
Download

Path::Graph Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Cristian Vasquez Diaz
  • Publisher web site:
  • http://search.cpan.org/~cavasquez/Paths-Graph-0.02/Graph.pm

Path::Graph Tags


Path::Graph Description

Path::Graph is a Perl module created to generate paths from hash graph. Path::Graph is a Perl module created to generate paths from hash graph.SYNOPSISCode 1#!usr/bin/perlmy %graph = ( A => {B=>1,C=>4}, B => {A=>1,C=>2}, C => {A=>4,B=>2});use Paths::Graph;my $g = Paths::Graph->new(-origin=>"A",-destiny=>"C",-graph=>%graph);my @paths = $g->shortest_path();for my $path (@paths) { print "Shortest Path:" . join ("->" , @$path) . " Cost:". $g->get_path_cost(@$path) ."n";}This package provides an object class which can be used to get diferents graph paths , with only pure perl code and I don't use other packet or module cpan.This class calculates the shortest path between two nodes in a graph and return in other method , vals in the execution time (free_path_event).Technically , the graph is composed of vertices (nodes) and edges (with optional weights) linked between them.The shortest path is found using the Dijkstra's algorithm. This algorithm is the fastest and requires all weights to be positive.The object builds a help about this concept of the graph's , exist a method named debug(). Requirements: · Perl


Path::Graph Related Software