script for preferential attachment simulation