GDPTree

(class from pyomo.gdp.util)

class pyomo.gdp.util.GDPTree[source]

Bases: object

Stores a forest representing the hierarchy between GDP components on a model: for single-level GDPs, each tree is rooted at a Disjunction and each of the Disjuncts in the Disjunction is a leaf. For nested GDPs, the Disjuncts may not be leaves, and could have child Disjunctions of their own.

__init__()[source]

Methods

__init__()

add_edge(u, v)

add_node(u)

children(u)

Returns the direct descendents of node u.

in_degree(u)

is_leaf(u)

parent(u)

Returns the parent node of u, or None if u is a root.

parent_disjunct(u)

Returns the parent Disjunct of u, or None if u is the closest-to-root Disjunct in the forest.

reverse_topological_sort()

root_disjunct(u)

Returns the highest parent Disjunct in the hierarchy, or None if the component is not nested.

topological_sort()

Attributes

disjunct_nodes

leaves

vertices

Member Documentation

children(u)[source]

Returns the direct descendents of node u.

Arg:

u : A node in the tree

parent(u)[source]

Returns the parent node of u, or None if u is a root.

Arg:

u : A node in the tree

parent_disjunct(u)[source]

Returns the parent Disjunct of u, or None if u is the closest-to-root Disjunct in the forest.

Arg:

u : A node in the forest

root_disjunct(u)[source]

Returns the highest parent Disjunct in the hierarchy, or None if the component is not nested.

Arg:

u : A node in the tree