Bio::ConnectDots::SimpleGraph is a simple, hopefully fast undirected graph package.
SYNOPSIS
use SimpleGraph;
my $graph=new Bio::ConnectDots::SimpleGraph;
# read pairs of nodes from STDIN
while () {
my($node1,$node2)=split;
$graph->add_edge($node1,$node2);
}
my @nodes=graph->nodes; # get list of nodes
my @edges=graph->edges; # get list of edges
for each $node (@nodes) {
my @neighbors=$node->neighbors; # get list of neighboring nodes
}
The only reason this exists is that the standard CPAN Graph pacakge, Graph::Base, is seriously broken. The package implements a small and eclectic assortment of standard graph algorithms that we happened to need for our applications.
This module is a subclass of Class::AutoClass (available at CPAN). AutoClass auotgenerates simple accessor and mutator methods (aka get and set methods). It also automates class initialization.
Nodes can be any Perl values, including object references. Edges are pairs of nodes.
(Caveat: be careful with values that contain embedded instances of $; (the character Perl uses to separate components of multi-dimensional subscripts), because we use this in the text representation of edges.
Product's homepage
Requirements:
· Perl