Home | Trees | Indices | Help |
---|
|
object --+ | Graph --+ | WeightedGraph
This abstract class manages the weights of edges of a graph.
A weighted graph wraps an inner representation, and provides a few more functions for manipulating weights. WeightedGraph is only a mixin class.
One of the key invariants is that if this class returns True for self.isArc(i, j), then self.getArcWeight(i, j) must return a legitimate weight, or zero if none was set.
However, the output of self.getArcWeight(i, j), called with arbitrary arguments, is not guaranteed.
Note: a weighted graph is an abstract class, and intended to be inherited from.
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
list |
|
||
|
|||
|
|||
Inherited from Inherited from |
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
Creates a mapping dictionary of edge weights, and assigns all edges a default weight of 0 Note: You MUST call the other Graph class's constructor _before_ calling this one.
|
Extends Graph.copy to copy weighted graphs. This method creates a copy graph g. The copy is of type cls. If g is a weighted graph, the weights are copied as well.
|
Sets the weight of arc (i, j) to w.
|
Returns the weight of arc (i, j), or zero if no weight was set.
|
Returns a list of weights of the neighbours of i. This method returns a list of the weights of the arcs out of i, in a direct correspondence to the list returned by neighbours(i). In other words, for every element at index j in neighbours, the weight of the arc from i to j is the jth element of getNeighbourWeights,
|
Removes a given arc from this graph, and cleans up the weights.
|
Removes a given vertex from this graph, and cleans up the weights.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Feb 25 13:23:35 2010 | http://epydoc.sourceforge.net |