Quantum Fog  0.9.3
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
graphs.Dag.Dag Class Reference
Inheritance diagram for graphs.Dag.Dag:
Inheritance graph
[legend]
Collaboration diagram for graphs.Dag.Dag:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, nodes)
 
def detect_two_node_cycle (self)
 
def topological_sort (self)
 
def undirect (self)
 
def add_nodes (self, nodes)
 
def get_nx_graph (self)
 
- Public Member Functions inherited from graphs.Graph.Graph
def __init__ (self, nodes)
 
def add_nodes (self, nodes)
 
def has_node (self, node)
 
def contains (self, nodes)
 
def unmark_all_nodes (self)
 
def get_node_named (self, name)
 
def get_node_with_id_num (self, id_num)
 
def get_node_with_topo_index (self, topo_index)
 
def get_nx_graph (self)
 
def draw (self, algo_num, kwargs)
 
def write_dot (self, path)
 
def read_dot (cls, path)
 

Static Public Member Functions

def new_from_nx_graph (nx_graph)
 
- Static Public Member Functions inherited from graphs.Graph.Graph
def new_from_nx_graph (nx_graph)
 

Public Attributes

 num_nodes
 
 nodes
 
- Public Attributes inherited from graphs.Graph.Graph
 nodes
 

Detailed Description

A Dag is a Graph. DAG = Directed Acyclic Graph. A mere Graph is
undirected and is composed of Node's. A Dag is directed and is composed
of DirectedNode's.

Attributes
----------
nodes : set[DirectedNode]
num_nodes : int
    number of nodes.

Constructor & Destructor Documentation

def graphs.Dag.Dag.__init__ (   self,
  nodes 
)
Constructor

Parameters
----------
nodes : set[DirectedNode]

Returns
-------

Member Function Documentation

def graphs.Dag.Dag.add_nodes (   self,
  nodes 
)
Add a set of nodes.

Parameters
----------
nodes : set[DirectedNode]

Returns
-------
None
def graphs.Dag.Dag.detect_two_node_cycle (   self)
Detects a 2 node cycle. That is, when 2 nodes are both parents and
children of each other.

Returns
-------
None
def graphs.Dag.Dag.get_nx_graph (   self)
Returns an nx_graph built from self info.

Returns
-------
networkx Graph
def graphs.Dag.Dag.new_from_nx_graph (   nx_graph)
static
Returns a Dag constructed from nx_graph.

Parameters
----------
nx_graph : networkx DiGraph

Returns
-------
Dag
def graphs.Dag.Dag.topological_sort (   self)
Orders nodes (permutes their topo_index's) such that no node is before
any of its parents. Node with lowest topo_index number is a root
node. So this could also be called a chronological sort, youngest
nodes first. Exception is raised if graph has cycles and cannot be
ordered topologically.

Returns
-------
None
def graphs.Dag.Dag.undirect (   self)
This just goes to each node and sets its neighbor set to be
the union of parents and children.

Returns
-------
None

The documentation for this class was generated from the following file: