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.