Algorithm-BellmanFord

 view release on metacpan or  search on metacpan

lib/Algorithm/BellmanFord.pm  view on Meta::CPAN

 
######################### variables #######
sub new
{
       $class = shift;
       $self = {
        input_file => shift,
		output_file => shift,
        };
    # Print all the values just for clarification.
    bless $self, $class;     
	return $self;
	}
sub calculate
{
open FILE, "$self->{input_file}" or die $!;
open FILE2, "$self->{output_file}" or die $!;
 @lines = <FILE>;

 $lines[0] =~/nodes ([0-9]+);links ([0-9]+)/;
 $totNodes = $1;



( run in 0.632 second using v1.01-cache-2.11-cpan-de7293f3b23 )