0

My problem was I needed to understand to which node in my given graph I need to give a voucher so it can reach all nodes in the shortest time possible so I used nx.closeness_centrality to see who is the closest to all nodes. Now I need to limit my steps to 4 because after 4 the voucher disappears and after each step the voucher value drops by 2.5%. first I tried to limit my steps like that but its not really working:

def multiple_steps_diminished_voucher(network):
    cs = nx.closeness_centrality(network, distance=4)
    return cs

Thanks.

Or Meiri
  • 1
  • 1
  • `distance` is the edge attrbute to be used when computing the shortest path. By limiting the steps to 4 what do you mean exactly? Could you detail your use case? – abc Dec 17 '20 at 12:32
  • By limting the steps to 4 i mean the voucher can not travel more than 4 nodes away from the node I started. My case is to find the best node in my network who I should give the voucher to so he could pass it to many people as posible with the limitations i stated above. the 4 steps and the reduction of 2.5% from the voucher each node it passes throught – Or Meiri Dec 17 '20 at 13:12

0 Answers0