====== Class: SocialNetwork ====== ====== Description ====== Class SocialNetwork calculates basic features of social network. For example, each college is a component. We calculate the component basic features such as density, diameter, average path length, number of nodes, average degree, average degree centrality, average people PageRank, average closeness and average betweenness. ====== Parameter ====== - Graph G ====== Return ====== - Matrix SN with row denotes different college, columns denote basic feature value. ====== Detail Information ====== - related python modules: networkx, MySQLdb - networkx:[[https://pypi.python.org/pypi/networkx/]] - MySQLdb:[[https://pypi.python.org/pypi/MySQL-python]] ====== Functions ====== - SocialNetwork(G):construction function. - ShowInformation(): Return basic features of graph. - GetDensity(): Return density of graph. - GetAPL(): Return average shortest path length of graph. - GetPeopleRank(): Calculate average page rank of people as graph's rank.Return page rank value of graph. - GetBetweenness(): Return average betweenness of each nodes in graph. - GetCloseness(): Return average closeness of each nodes in graph. - GetDegree(): Return degree distribution of graph. - GetDegreeCentrality(): Return degree centrality of graph.