p.calculation function

Calculate selection probabilities for each node