Package TEES :: Package Core :: Module SimpleGraph :: Class Graph
[hide private]

Class Graph

source code

One edge per-associated data per direction

Instance Methods [hide private]
 
__init__(self, directed=True) source code
 
__resetAnalyses(self) source code
 
isDirected(self) source code
 
toUndirected(self) source code
 
addNode(self, node) source code
 
addNodes(self, nodes) source code
 
addEdge(self, node1, node2, data=None) source code
 
addEdgeTuple(self, edge) source code
 
addEdges(self, edges) source code
 
__insertEdge(self, node1, node2, data)
Assumes edge doesn't exist already
source code
 
hasEdges(self, node1, node2) source code
 
hasEdge(self, node1, node2, data) source code
 
hasEdgeTuple(self, edge) source code
 
getEdges(self, node1, node2) source code
 
getInEdges(self, node) source code
 
getOutEdges(self, node) source code
 
FloydWarshall(self, filterCallback=None, callbackArgs={})
From Wikipedia, modified to return all paths
source code
 
resetAnalyses(self) source code
 
showAnalyses(self) source code
 
getPaths(self, i, j, depth=0) source code
 
getPathOldSinglePath(self, i, j) source code
 
getWalks(self, path, directed=False) source code
 
__getWalks(self, path, position=1, walk=None, directed=False)
A path is defined by a list of tokens.
source code
 
toGraphviz(self, filename=None) source code
Method Details [hide private]

__getWalks(self, path, position=1, walk=None, directed=False)

source code 

A path is defined by a list of tokens. But since there can be more than one edge between the same two tokens, there are multiple ways of getting from the first token to the last token. This function returns all of these "walks", i.e. the combinations of edges that can be travelled to get from the first to the last token of the path.