Add functionality to Barabasi-Albert generation using price_network()
In their original formulation of the model, Barabasi and Albert did not concretely specify some of the details of their graph generating process. For example in the model with "m" edges added per node, it was not clear how to start the model (graph with 1 node and 0 degree) or whether the m edges are added in an iid fashion or with the degrees updated after each edge.
The current price_network() function forbids self-loops and parallel edges. I propose adding options for:
-
Self-loops: For each edge addition, allow for adding a self-loop back to the new node proportional to its degree. For example, for the first edge of a new node, the degree of the new node = 0 so the first edge can only connect to a previous node. But after the first edge, the new node has degree = 1.
-
Parallel edges: For the second (n>2-th) edge of a new node, allow it to connect to vertices that have already been connected to by previous edges of the same node. That is, for each edge just update the degrees in the graph (and also the corresponding probabilities) but do not eliminate any vertices for any of the later m edges.