Creating Barabási–Albert(BA) graph with spacific node and edgs

1.1k Views Asked by At

I am trying to construct a BA graph with 500 nodes and about 37000 edges. The number of edges to attach from a new node to existing nodes should be at least 91 to make enough number of edges. I checked it from barabasi_albert_graph(n, m, seed=None) function in Networkx. The algorithm is as follows[1]:

  1. Add $m$ nodes to G.

  2. Connect nodes in $G$ randomly until you get a connected graph.

  3. Create a new node i.

  4. Pick a node j uniformly at random from the graph G. Set $ p= k(j)/k_{tot}$.

  5. Pick a real number $r$ uniformly at random between $0$ and $1$.

  6. If $ r<p$ then add $j$ to i's adjacency list.

  7. Repeat steps 4 - 6 until i has m nodes in its adjacency list.

  8. Add $i$ to the adjacency list of each node in its adjacency list.

  9. Add $i$ to to the graph.

  10. Repeat steps 3 - 9 until there are $N$ nodes in the graph.

The question is step 2. When $m$ should be at least 91, a large part of my graph have a random construction. Is it a correct way of making the BA model?