this file includes some functions used to caculate the charateristics of the network