Bio::Graph::SimpleGraph

Bio::Graph::SimpleGraph is a Perl module that can create and manipulate undirected graphs.
Download

Bio::Graph::SimpleGraph Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Nat Goodman
  • Publisher web site:
  • http://search.cpan.org/~sendu/bioperl-1.5.2_102/Bio/Graph/SimpleGraph.pm

Bio::Graph::SimpleGraph Tags


Bio::Graph::SimpleGraph Description

Bio::Graph::SimpleGraph is a Perl module that can create and manipulate undirected graphs. Bio::Graph::SimpleGraph is a Perl module that can create and manipulate undirected graphs.SYNOPSIS use Bio::Graph::SimpleGraph; my $graph=new 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 foreach my $node (@nodes) { my @neighbors=$node->neighbors; # get list of neighboring nodes }This is a simple, hopefully fast undirected graph package. 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.The main data structures are: An edge (x,y) is represented canonically as a two element list in which the lexically smaller value is first. Eg, the node ('b','a') is represented as . The graph contains 1) A hash mapping the text representation of a node to the node itself. This is mostly relevant when the node is a reference. 2) A hash mapping the text representation of a node to a list of the node's neighbors. 3) A hash mapping the text representation of an edge to the edge itself. Requirements: · Perl


Bio::Graph::SimpleGraph Related Software