| Home | Trees | Indices | Help |
|
|---|
|
|
This class represents a Graph object. Elements can be added using the add() method and sorted using solve(). This class can also return an adjacency map representing the currently stored elements in graph. A topological sorting algorithm (using Tarjan's) is used to by solve().
| Instance Methods | |||
|
|||
| entropy.graph.GraphNode |
|
||
|
|||
| dict |
|
||
| dict |
|
||
| dict |
|
||
| list |
|
||
|
Inherited from |
|||
| Properties | |
|
Inherited from |
| Method Details |
Graph representation constructor.
|
Return GraphNode instance for added item (through add())
|
Add arbitrary object to Graph, specifying its dependencies.
@param item: Python object to be added to the graph
@type item: Python object
@param dependency_items: list of items which are dependencies of
the given item object
@type dependency_items; set
|
Return an adjacency map given the current items in Graph.
|
This method is equal to solve() but doesn't do any item back-translation and just returns the relation between GraphNode objects that can be manipulated directly by the caller.
|
Thanks to "R. E. Tarjan" (1972) for the help ;-) Serialize the graph and spit out a dependency order. Data is returned in map form, where key represents the dependency level and value a list of items at that dependency level.
|
Return all items stored in the graph in raw form (list) without sorting them.
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Sun Dec 13 00:16:21 2009 | http://epydoc.sourceforge.net |