Search code examples
pythonnetworkxweb-mining

Degree, Proximity and Rank Prestige


I want to find these three Prestige measures for an existing graph using python:

  1. Degree Prestige
  2. Proximity Prestige
  3. Rank Prestige

Can I use networkx for this purpose? If not, then which library can I use and how can I do it. Any links or references are appreciated.


Solution

  • Yes, you can but you to implement the measures by yourself as far as I know.
    For instance, consider the Degree prestige defined as the number of incoming links to a node divided by the total possible number of incoming links.

    In this case you could just calculate it as:

    n_nodes = 10
    d = nx.gnp_random_graph(n_nodes, 0.5, directed=True)
    degree_prestige = dict((v,len(d.in_edges(v))/(n_nodes-1)) for v in d.nodes_iter())
    

    Same for the other measures which can be easily implemented used the functions defined by networkx.