Package gPy :: Module Hypergraphs :: Class JoinForest
[hide private]
[frames] | no frames]

Class JoinForest

source code


A DecomposableHypergraph whose hyperedges are the vertices of a join forest

Instance Methods [hide private]
 
__init__(self, hypergraph=(), modify=False, trace=False, elimination_order=None)
Construct join forest from a hypergraph
source code
String
__str__(self)
Return pretty representation of a hypergraph
source code
The same as self
copy(self)
Return a deep copy of the hypergraph
source code
Graphs.UForest
join_forest(self)
Return a join forest graph, assuming decomposability
source code
Frozenset
clique(self)
Return an arbitrary clique
source code
 
clique_neighbours(self, clique, banned=frozenset([]))
Return neighbours of a clique in the join forest
source code
List
perfect_sequence(self, root=None)
Return an ordering of the cliques obeying the running intersection property
source code

Inherited from DecomposableHypergraph: is_decomposable

Inherited from GraphicalHypergraph: is_graphical

Inherited from Hypergraph: __contains__, __eq__, __ge__, __getitem__, __iter__, __le__, __len__, __ne__, __repr__, add_hyperedge, discard_hyperedge, discard_hyperedges, discard_vertex, discard_vertices, dual, grahams, gui_display, gui_grahams_algorithm, hyperedges, is_acyclic, is_arboreal, is_conformal, is_empty, is_reduced, is_redundant, is_separating, is_simple, join, join_forest_ve, make_decomposable, make_decomposable2, makes_unreduced, matrix, matrix_generate, maximum_cardinality_search, merge, msc_decompcover, multiplicity, neighbours, order, red, redundant_hyperedges, remove_hyperedge, remove_hyperedge_once, remove_hyperedges, remove_vertex, remove_vertices, rename_vertices, representative_graph, restriction, simplify, size, star, star_size, stars, two_section, vertices, would_be_redundant

Inherited from Hypergraph (private): _add_hyperedge, _gui_graham

Inherited from Incidence: reachable, separates

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Instance Variables [hide private]
Graphs.UForest #@ivar _elimination_ordering: An elimination ordering consistent with the #hypergraph's _uforest #@type _elimination_ordering: Tuple #@ivar destination: Maps hyperedges in the hypergraph from which the instance was #created to hyperedges in the instance. Can be deleted without altering the instance. #@type destination: Dictionary #@ivar edges: The edges of the instance's _uforest when the instance was #created. Each edge is a frozenset #with the two connected cliques as members. Can be deleted without altering the instance. #@type edges: List _uforest
The join forest itself

Inherited from Hypergraph (private): _extras, _hyperedges, _star

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, hypergraph=(), modify=False, trace=False, elimination_order=None)
(Constructor)

source code 

Construct join forest from a hypergraph

If hypergraph is indeed a hypergraph then the new JoinForest object has identical attributes to hypergraph (plus a new one of its own).

If hypergraph is not a hypergraph then it is assumed to be a collection of hyperedges, a Hypergraph object is created from these hyperedges as the first step of construction and execution proceeds exactly as if this Hypergraph object had been the original value of hypergraph. The default value for hypergraph constructs an empty JoinForest).

Parameters:
  • hypergraph (Hypergraph or iterable of iterables) - Hypergraph/hyperedges used to generate new join forest
  • modify (Boolean) - Whether hypergraph is to modified to be made decomposable
  • trace (Boolean) - In the case where modify=True whether a mapping from each hyperedge to the new hyperedge into which it has been merged should be created. If so, it is stored in a trace attribute of self
  • elimination_order (Sequence) - If supplied and modify=True, the elimination order to use to make the hypergraph decomposable. (If not supplied maximum cardinality search is used to generate an order.)
Raises:
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

Return pretty representation of a hypergraph

Returns: String
Pretty representation of a hypergraph
Overrides: object.__str__
(inherited documentation)

copy(self)

source code 

Return a deep copy of the hypergraph

Returns: The same as self
A copy of self
Overrides: Hypergraph.copy
(inherited documentation)

join_forest(self)

source code 

Return a join forest graph, assuming decomposability

Any repeated hyperedges are ignored

Uses maximum_cardinality_search. See that method for bibliographical references.

Returns: Graphs.UForest
A join forest graph
Raises:
Overrides: Hypergraph.join_forest
(inherited documentation)

clique(self)

source code 

Return an arbitrary clique

Returns: Frozenset
An arbitrary clique

clique_neighbours(self, clique, banned=frozenset([]))

source code 

Return neighbours of a clique in the join forest

Excludes the cliques in banned

Parameters:
  • clique (Frozenset) - Cliques whose neighbours are sought
  • banned (set or frozenset) - Neighbours to exclude from result

perfect_sequence(self, root=None)

source code 

Return an ordering of the cliques obeying the running intersection property

Parameters:
  • root (An iterable) - A root hyperedge for the ordering; it will be the first element of the returned ordering. If not supplied, it is chosen arbitrarily.
Returns: List
An ordering of the cliques obeying the running intersection property
Raises:
  • ValueError - If root is supplied but not in join forest.