NAME
Meta::Ds::Dgraph - data structure that represents a graph.
COPYRIGHT
Copyright (C) 2001 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: Dgraph.pm PROJECT: meta
SYNOPSIS
package foo;
use Meta::Ds::Dgraph qw();
my($graph)=Meta::Ds::Dgraph-
new();> $graph-
node_insert("mark",undef);> $graph-
node_insert("doron",undef);> $graph-
edge_insert("mark","doron",undef);>
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. The extra that this library gives you over the regular Graph.pm module is that this one can have extra information (whatever you want) on the nodes and edges of the graph.
EXPORTS
new($)
nodes($)
node_size($)
node_has($$)
node_data($$)
node_insert($$$)
node_remove($$)
edges($)
edge_size($)
edge_has($$$)
edge_data($$$)
edge_insert($$$$)
edge_remove($$$)
edge_ou($$)
edge_ou_size($$)
edge_in($$)
edge_in_size($$)
print($$)
numb_cycl($$$)
all_ou($$$$)
FUNCTION DOCUMENTATION
- new($)
-
Gives you a new Dgraph 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_data($$)
-
This method retrieves the data associated with the node.
- 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_data($$$)
-
This method retrieves the data object associated with the edge.
- 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.
BUGS
None.
AUTHOR
Mark Veltzer <mark2776@yahoo.com>
HISTORY
start of revision info 1 Mon Jan 1 16:38:12 2001 MV initial code brought in 2 Tue Jan 2 06:08:54 2001 MV bring databases on line 2 Thu Jan 4 13:36:17 2001 MV ok. This is for real 3 Sat Jan 6 11:39:39 2001 MV make quality checks on perl code 4 Sat Jan 6 17:14:09 2001 MV more perl checks 5 Tue Jan 9 18:15:19 2001 MV check that all uses have qw 5 Tue Jan 9 19:29:31 2001 MV fix todo items look in pod documentation 6 Wed Jan 10 12:05:55 2001 MV more on tests/more checks to perl 7 Tue Jan 23 14:08:51 2001 MV Java simulation framework 8 Sun Jan 28 02:34:56 2001 MV perl code quality 9 Sun Jan 28 13:51:26 2001 MV more perl quality 10 Tue Jan 30 03:03:17 2001 MV more perl quality 11 Wed Jan 31 15:28:22 2001 MV get basic Simul up and running 12 Sat Feb 3 23:41:08 2001 MV perl documentation 13 Mon Feb 5 03:21:02 2001 MV more perl quality 14 Tue Feb 6 01:04:52 2001 MV perl qulity code 15 Tue Feb 6 07:02:13 2001 MV more perl code quality 16 Tue Feb 6 22:19:51 2001 MV revision change end of revision info
SEE ALSO
Nothing.
TODO
Nothing.