easygraph.functions.structural_holes.evaluation module#

easygraph.functions.structural_holes.evaluation.constraint(G, nodes=None, weight=None, n_workers=None)[source]#

Burt’s metric - Constraint. :param G: :type G: easygraph.Graph :param nodes: The nodes you want to calculate. If None, all nodes in G will be calculated. :type nodes: list of nodes or None, optional (default : None) :param weight: The key for edge weight. If None, G will be regarded as unweighted graph. :type weight: string or None, optional (default : None) :param workers: The number of workers calculating (default: None).

None if not using only one worker.

Returns:

constraint – The Constraint of node in nodes.

Return type:

dict

Examples

>>> constraint(G,
...            nodes=[1,2,3], # Compute the Constraint of some nodes. The default is None for all nodes in G.
...            weight='weight', # The weight key of the graph. The default is None for unweighted graph.
...            n_workers=4 # Parallel computing on four workers. The default is None for serial computing.
...            )

References

[1]

Burt R S. Structural holes: The social structure of competition[M]. Harvard university press, 2009.

easygraph.functions.structural_holes.evaluation.effective_size(G, nodes=None, weight=None, n_workers=None)[source]#

Burt’s metric - Effective Size. :param G: :type G: easygraph.Graph or easygraph.DiGraph :param nodes: The nodes you want to calculate. If None, all nodes in G will be calculated. :type nodes: list of nodes or None, optional (default : None) :param weight: The key for edge weight. If None, G will be regarded as unweighted graph. :type weight: string or None, optional (default : None)

Returns:

effective_size – The Effective Size of node in nodes.

Return type:

dict

Examples

>>> effective_size(G,
...                nodes=[1,2,3], # Compute the Effective Size of some nodes. The default is None for all nodes in G.
...                weight='weight' # The weight key of the graph. The default is None for unweighted graph.
...                )

References

[1]

Burt R S. Structural holes: The social structure of competition[M]. Harvard university press, 2009.

easygraph.functions.structural_holes.evaluation.efficiency(G, nodes=None, weight=None)[source]#

Burt’s metric - Efficiency. :param G: :type G: easygraph.Graph :param nodes: The nodes you want to calculate. If None, all nodes in G will be calculated. :type nodes: list of nodes or None, optional (default : None) :param weight: The key for edge weight. If None, G will be regarded as unweighted graph. :type weight: string or None, optional (default : None)

Returns:

efficiency – The Efficiency of node in nodes.

Return type:

dict

Examples

>>> efficiency(G,
...            nodes=[1,2,3], # Compute the Efficiency of some nodes. The default is None for all nodes in G.
...            weight='weight' # The weight key of the graph. The default is None for unweighted graph.
...            )

References

[1]

Burt R S. Structural holes: The social structure of competition[M]. Harvard university press, 2009.

easygraph.functions.structural_holes.evaluation.hierarchy(G, nodes=None, weight=None, n_workers=None)[source]#

Returns the hierarchy of nodes in the graph :param G: :type G: graph :param nodes: :type nodes: dict, optional (default: None) :param weight: :type weight: dict, optional (default: None)

Returns:

hierarchy – the hierarchy of nodes in the graph

Return type:

dict

Examples

Returns the hierarchy of nodes in the graph G >>> hierarchy(G) Reference ——— https://m.book118.com/html/2019/0318/5320024122002021.shtm