In this section we’ll focus on different ways of generating graphs and the properties that arise. In particular, we will be interested in methods with properties which resemble those by social networks. Mainly, the following characteristics:
Algorithm: Start with \(n\) isolated vertices and place m edges at random between them.
Algorithm: Start with \(n\) isolated vertices and connect each pair of nodes with a probability \(p\).
Notice this family is bigger than the previous one.
Interestingly, graph properties such as diameter or probability of a giant component vs \(p\) present a threshold phenomena around \(p \simeq \frac{1}{N}\).
The characteristics achieved by this graph family:
Algorithm:
- Start with 2 connected nodes.
Repeat \(N-2\) times:
- Add new node \(v\)
- Create a link between \(v\) and one of the existing nodes with probability proportional to the degree
Notice this has the “rich get richer” snowball effect.
The graphs created using this algorithm tend to look like stars.
Notice there will never be triangles since we do not add links to the rest of the graph, just between the new node. The Barbasi-Albert model addresses this issue by allowing up to \(m\) connections for each added node.
Objective: Given a degree sequence \(k_1, ..., k_N\), build a graph with an approximate sequence:
Check out the soft configuration model for a version of this algorithm within the maximum-entropy framework.
Algorithm:
- Assign each node a number of spokes corresponding to the degrees.
- Randomly connect the spokes between nodes.
Problem: Social networks present a very high clustering coefficient and yet a very low diameter. (Small-World situations)
Algorithm:
- Construct a regular ring lattice of \(N\) nodes connected to \(K\) neighbors.
- For each node, with probability \(p\) re-wire a connecting edge.
Usually for \(p \simeq \frac{K}{N}\) we obtain the desired properties of:
Nevertheless, the degree distribution is not power law, thus resulting in unrealistic distributions.
Given a set of nodes \(V\) and communities \(C\) we first assign each node to one or more communities:
Algorithm:
for each node:
- Assign one or more memberships to a given community with probability \(p_c\)
This is for graph with communities, check our post on graph clustering for more details
Thus, the model is uniquely defined by parameters: \(B (V, C, M, \{p_c\})\). Where \(M\) are the memberships and \(p_c\) the community probabilities. Later, we create links within the communities:
Algorithm:
for each community \(A\):
for each pair fo nodes within:
- Connect them with probability \(p_A\)
Notice that the probability of two nodes being connected is:
\begin{equation} p(u, v) = 1 - \prod_{c \in M_u \cap M_v} (1 - p_c) \end{equation}