pymnet.sampling.reqs.relaxed_check_reqs

pymnet.sampling.reqs.relaxed_check_reqs(network, nodelist, layerlist)

Checks whether a multilayer induced subgraph of the form [nodelist][layerlist] is connected and does not contain any empty layers or nodes. Works on one-aspect multilayer networks. See section Details for more information.

Parameters:
networkMultilayerNetwork

A one-aspect multilayer network containing the induced subgraph.

nodelistlist of node names

The nodes in the induced subgraph.

layerlistlist of layer names

The layers in the induced subgraph.

Returns:
True if the induced subgraph is connected and does not contain empty layers
or nodes, False otherwise.

Notes

The phrase ‘does not contain any empty layers or nodes’ means that for each layer, there is at least one nodelayer in the induced subgraph, and that for each node, there is at least one nodelayer in the induced subgraph. In other words, each node in the nodelist and each layer in the layerlist appears at least once as the node identity or the layer identity, respectively, among the nodelayers present in the induced subgraph.

Examples

Suppose we have the multilayer network N:

(1,'X')----(2,'X')
              |
              |
           (2,'Y')

Calling

>>> relaxed_check_reqs(N,[1,2],['X','Y'])

returns True, but calling

>>> relaxed_check_reqs(N,[1,2],['Y'])

returns False, because node 1 is empty.