face2face.statistics.network_quantities.calculating_number_of_edges_nodes

face2face.statistics.network_quantities.calculating_number_of_edges_nodes(network)

Calculate number of edges/nodes

Calculating the amount of edges and nodes for a given network

Parameters

network (networkx Graph) – A graph with a specified degree sequence. Nodes are labeled based on the imported data set.

Returns

  • number_of_nodes (int) – Contains the number of nodes.

  • number_of_edges (int) – Contains the number of edges.

Examples

>>> attr_list = ["ID", "Age", "Sex"]
>>> test_df = Data(path_tij="face2face/data/Test/tij_test.dat", separator_tij="\t",
>>>               path_meta="face2face/data/Test/meta_test.dat", separator_meta="\t",
>>>               meta_attr_list=attr_list)
>>> test_network = create_network_from_data(test_df)
>>> number_of_nodes, number_of_edges = calculating_number_of_edges_nodes(test_network)
>>> print(number_of_nodes)
10
>>> print(number_of_edges)
10