NAME

Meta::Ds::Graph - data structure that represents a graph.

COPYRIGHT

Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.

DETAILS

MANIFEST: Graph.pm
PROJECT: meta
VERSION: 0.37

SYNOPSIS

package foo;
use Meta::Ds::Graph qw();
my($graph)=Meta::Ds::Graph->new();
$graph->node_insert("mark");
$graph->node_insert("doron");
$graph->edge_insert("mark","doron");

DESCRIPTION

This is a library to let you create a graph like data structure. The library gives services like the n'th node, n'th edge etc... The graphs are directional.

FUNCTIONS

new($)
nodes($)
node_size($)
node_has($$)
node_insert($$)
node_remove($$)
edges($)
edge_size($)
edge_has($$$)
edge_insert($$$)
edge_remove($$$)
edge_ou($$)
edge_ou_size($$)
edge_in($$)
edge_in_size($$)
print($$)
numb_cycl($$$)
all_ou($$$$)
all_ou_new($$$)
clear($)
TEST($)

FUNCTION DOCUMENTATION

new($)

Gives you a new Graph object.

nodes($)

Return the set of nodes in the graph.

node_size($)

return number of nodes in the graph.

node_has($$)

This will return whether the graph has this node or not.

node_insert($$)

Insert a new node into the graph.

node_remove($$)

This removes a node with all edges attached

edges($)

Return the set of edges in the graph.

edge_size($)

Returns number of edges in the graph.

edge_has($$$)

This method returns whether there is already an edge in the graph with the nodes you request.

edge_insert($$$)

Insert a new edge into the graph.

edge_remove($$$)

This removes an edge from the graph (both nodes remain in the graph).

edge_ou($$)

This gives you the set of all nodes this edge connects to.

edge_ou_size($$)

This gives you how many edges go out of a node.

edge_in($$)

This gives you the set of all nodes this edge connects from.

edge_in_size($$)

This gives you how many edges go in to a node.

print($$)

Print the current graph to a file. The input is the file to print to.

numb_cycl($$$)

This method returns the number of cycles in the graph and acts verbosly accoding to the flag given to it. This is also receives the name of the file to be verbose into...

all_ou($$$$)

This method will add the nodes which are outwardly connected (recursivly) to the hash given to it.

all_ou_new($$$)

New and better algorithm which does the same as all_ou but with a cleaner set approach.

clear($)

Clear the graph. Works fast.

TEST($)

Test suite for this module. Currently it just creates a Graph object and prints it out.

SUPER CLASSES

None.

BUGS

None.

AUTHOR

Name: Mark Veltzer
Email: mailto:veltzer@cpan.org
WWW: http://www.veltzer.org
CPAN id: VELTZER

HISTORY

0.00 MV initial code brought in
0.01 MV bring databases on line
0.02 MV ok. This is for real
0.03 MV make quality checks on perl code
0.04 MV more perl checks
0.05 MV check that all uses have qw
0.06 MV fix todo items look in pod documentation
0.07 MV more on tests/more checks to perl
0.08 MV Java simulation framework
0.09 MV perl code quality
0.10 MV more perl quality
0.11 MV more perl quality
0.12 MV get basic Simul up and running
0.13 MV perl documentation
0.14 MV more perl quality
0.15 MV perl qulity code
0.16 MV more perl code quality
0.17 MV revision change
0.18 MV languages.pl test online
0.19 MV misc fixes
0.20 MV html site update
0.21 MV fix up cook files
0.22 MV PDMT/SWIG support
0.23 MV Pdmt stuff
0.24 MV perl packaging
0.25 MV PDMT
0.26 MV md5 project
0.27 MV database
0.28 MV perl module versions in files
0.29 MV movies and small fixes
0.30 MV more thumbnail code
0.31 MV thumbnail user interface
0.32 MV more thumbnail issues
0.33 MV website construction
0.34 MV web site automation
0.35 MV SEE ALSO section fix
0.36 MV teachers project
0.37 MV md5 issues

SEE ALSO

Meta::Ds::Oset(3), Meta::Error::Simple(3), Meta::Utils::Arg(3), Meta::Utils::Output(3), strict(3)

TODO

Nothing.