igraph has a rather general implementation of preferential attachment that could be in principle extended. When a new vertex is added, each of its m edges will connect each existing vertex i with probability proportional to
d_i^\alpha + A
where \alpha and A are parameters.
d can be either the in-degree or total degree. Multi-edges can be allowed or disallowed. A>0 is meant to ensure that there is a non-zero connection probability to existing vertices of zero in-degree in the directed case.
If we are going to be naïve about this, this could be easily generalized to to allowing self-loops. We simply included the just-added vertex in the candidates to connect to. A ensures that self-connections are possible.
But am quite reluctant to do this as a naïve generalization of the algorithm, without a good scientific justification. If I were dealing with real-world scale-free networks that have self-loops, and tried to use such a model, one of the first things I’d likely end up needed to try is to tune the self-loop probability separately from the connection probabilities to other vertices, to be able to reproduce the number of observed loops.
That would be yet another parameter for an already complex function. At this point, making this generalization, and defining/justifying included parameters, essentially becomes a research project. We can’t take on such a research project as part of igraph development.
So here’s what I propose
If you have the time to look into this, and are able to find some uses of such models in the literature, we can consider including this feature. A very solid mathematical justification (perhaps based on some invariance) for why it’s interesting/useful to include this even WITHOUT separate control of self-loop probabilities might also do.
We are preparing for a large release within a month after which the API will be frozen for a while. Thus this should be done within two weeks at most to keep within time.
I did a quick literature search and was unable to find anything. Let me know if you do find something that we can use.
Note that I am not asking about network datasets that seem to follow a scale-free degree distribution while having self-loops. I’m asking for published articles that describe a preferential attachment process / model that allows loops (either to try to model such data, or for other purposes).