Home | Trees | Index | Help |
---|
Package pygraphlib :: Module pygraph :: Class UGraph |
|
DGraph
--+
|
UGraph
>>> from pygraphlib import pygraph >>> graph = pygraph.UGraph() >>> graph.add_edge(1,2) >>> print graph UGraph: 2 nodes, 1 edges
Method Summary | |
---|---|
__init__(self,
*kwlist,
**kwargs)
| |
User friendly representation | |
Adds a directed edge going from head to
tail . | |
The total degree of a node | |
The total degree of a node | |
Reports an error message | |
Returns the number of edges | |
Inherited from DGraph | |
Test whether a node is in the graph | |
Iterates over all nodes in the graph | |
Returns the number of nodes | |
User friendly and verbose representation | |
Creates a new node with a node. | |
Returns a list containing all incoming and outging edges | |
Returns the data associated with an edge | |
Returns the head of the edge. | |
Returns a list of all edge_ids in the graph | |
Returns the head and the tail of an edge. | |
Returns the tail of the edge. | |
Returns the edge that connects the head to tail | |
Sets the data for an edge | |
Gets the wt of the edge | |
Hides an edge from the graph. | |
Hides a node from the graph. | |
Returns the number of incoming edges | |
Returns a list of the incoming edges | |
Returns a list of nodes connected by incoming edges. | |
Returns the data associated with a node | |
Returns a list of the nodes in the graph. | |
Returns the number of hidden edges. | |
Returns the number of hidden nodes. | |
Returns the number of nodes | |
Returns the number of outgoing edges | |
Returns a list of the outgoing edges. | |
Returns a list of nodes connected by outgoing edges. | |
Restores all hidden edges. | |
Restores all hidden nodes. | |
Restores a hidden edge. | |
Restores a hidden node | |
Fets the data for an edge | |
Sets the wt of the edge |
Method Details |
---|
__str__(self)
User friendly representation
|
add_edge(self, head, tail, wt=1.0, data=None, create_nodes=True)Adds a directed edge going fromhead to
tail . The wt and edge_data
parameters allow you to associate a numerical weight wt
and/or arbitrary data with the edge. If
create_nodes=True it will automatically create the non
existing nodes.
|
all_degree(self, node)The total degree of a node
|
all_nbrs(self, node)The total degree of a node
|
graph_error(self, msg)Reports an error message
|
number_of_edges(self)Returns the number of edges
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Wed Jan 5 09:38:28 2005 | http://epydoc.sf.net |