Algorithm-Graphs-TransitiveClosure
view release on metacpan or search on metacpan
t/000_tests.t view on Meta::CPAN
"@{$graph->[1]}" eq '1 1 1 1' and
"@{$graph->[2]}" eq '1 1 1 1' and
"@{$graph->[3]}" eq '1 1 1 1') {
print "ok ", $test_num ++, "\n";
}
else {
print "not ok ", $test_num ++, "\n";
}
};
if ($@) {print "... error: $@\n";}
eval {
my $graph = {
one => {one => 1},
two => {two => 1, three => 1, four => 1},
three => {two => 1, three => 1},
four => {one => 1, three => 1, four => 1},
};
floyd_warshall $graph;
if (1 == keys %{$graph -> {one}} && $graph -> {one} -> {one} == 1 &&
t/000_tests.t view on Meta::CPAN
$graph -> {four} -> {two} == 1 &&
$graph -> {four} -> {three} == 1 &&
$graph -> {four} -> {four} == 1) {
print "ok ", $test_num ++, "\n";
}
else {
print "not ok ", $test_num ++, "\n";
}
};
if ($@) {print "... error: $@\n";}
( run in 0.244 second using v1.01-cache-2.11-cpan-95122f20152 )