void AbsorbNodes_bn ( nodelist_bn*  nodes )

Absorbs all of nodes from their net. This removes and deletes (frees) the nodes while maintaining the global relationship (i.e. joint distribution) of the remaining nodes. In the probabilistic literature this is often referred to as "summing out" variables (or "maxing out" when they are decision nodes).

In order to maintain the joint distribution, Netica may have to add links. Absorbing a nature node which has no finding will only add links from the parents of the removed node and its children's parents, to the removed node's children. However, if it has a finding, many links between the ancestors of the removed node may be added (possibly resulting in very large CPT tables leading to slow behavior or an out-of-memory condition). Absorbing nodes with likelihood findings or negative findings is the worst. When a decision node is absorbed, links will be added from its parents to its children. No links are added when a utility node is absorbed. Added links never created a directed cycle, when there wasn't one to begin with.

The order of the nodes in nodes doesn't matter. The order in which the absorptions are done will be chosen to minimize intermediate calculations (and if decision nodes are involved, it will be similar to that described in Shachter86).

All of the nodes in nodes must be from the same net.

WARNING: The nodes list passed to AbsorbNodes_bn will be deleted by this function, so it should not be used after calling this function (it would contain invalid data anyway, since each of the nodes it refers to will have been deleted).

If it is not possible to absorb all of nodes, as many as possible will be absorbed, and then an error message will be generated explaining why the next node couldn't be absorbed. Reasons it may not be possible to continue are: nodes are missing CPTs, presence of disconnected links, more than one link from a node to another, presence of directed cycles, unacceptable structure between decision and utility nodes, or multiple utility nodes.

Version:

This function is available in all versions.

See also:

DeleteNode_bn  Removes a node without maintaining joint distribution
OptimizeDecisions_bn  Solves decision problems by node absorption
MaxMemoryUsage_ns  In case this function is consuming too much memory

Example:

// Handy function to absorb a single node
//
void AbsorbNode (node_bn* node){
    nodelist_bn* nodes = NewNodeList_bn (1, env);
    SetNthNode_bn (nodes, 0, node);
    AbsorbNodes_bn (nodes);
}