constructing network with preferential attachment algorithm