Generating networks
with arbitrary properties
Social Interaction

“You’re my friend”

Jérôme Kunegis

Generating Networks with Arbitrary Properties

2
Many Social Interactions
”
y friend
m
You’re
“

Jérôme Kunegis

’re m
y frie
nd”

”
nd
rie

y friend”

“You

y

’re
my
frie
nd
”

f
my
’re
ou
“Y

“You’re m

’re
ou
“Y

m

d”
n
ie
fr

“Yo
u

y friend
m
“You’re

Generating Networks with Arbitrary Properties

”

3
Abstract: It's a Network

Jérôme Kunegis

Generating Networks with Arbitrary Properties

4
Problem: Generate Realistic Graphs

Why generate graphs?
To visualize an existing network: generate a
smaller graph with same properties as a large
real (note: sampling a subset will skew the properties)
●

For testing algorithms: Generate a larger
network then those currently known
●

Jérôme Kunegis

Generating Networks with Arbitrary Properties

5
Basic Idea for Generating Networks: Random Graphs

Each edge has
probability p of existing

Paul Erdős
Jérôme Kunegis

Generating Networks with Arbitrary Properties

6
Random Graphs Are Not Realistic

Real network

Random graph

Jérôme Kunegis

Generating Networks with Arbitrary Properties

7
Real Networks Have Special Properties

Many triangles
(“clustering”)

Many 2-stars
(“preferential attachment”)

Short paths (“small world”)
●
Assortativity
●
Power-law-like degree distributions
●
Connectivity
●
Reciprocity
●
Global structure
●
Subgraph patterns
●
etc., etc., etc., etc., etc.
●

Jérôme Kunegis

Generating Networks with Arbitrary Properties

8
Solution: Exponential Random Graph Models
Example with three statistics:
P(G) = exp( a1 m + a2 t + a3 s + b )
m, t, s: Properties of G
m = Number of edges; t = Number of triangles; s = Number of 2-stars
a1, a2, a3, b: Parameters of the model

Jérôme Kunegis

Generating Networks with Arbitrary Properties

9
Problems of Exponential Random Graph Models

P(G) = exp( a1 x1 + a2 x2 + … + ak xk + b )

Many exponential random graph models are degenerate:
They contain mostly almost-empty or almost-full graphs
But on average, they produce the correct statistics!

Jérôme Kunegis

Generating Networks with Arbitrary Properties

10
Explanation of Degeneracy

Consider a variable x between 0 and 1
with expected value 0.3.
An exponential random model for it is given by:
P(x) = exp( ax + b )

P(x)

We get
Mode[x] = 0
!!
0
Jérôme Kunegis

0

0.3

Generating Networks with Arbitrary Properties

1

x
11
Idea
Require not that E[x] = c, but that x follow a normal distribution
P(x)

0

0

0.3

1

x

P(G) = Pnorm (x1, x2, …; μ1, μ2, …, σ1, σ2, …)
Jérôme Kunegis

Generating Networks with Arbitrary Properties

12
Real Networks Have a Distribution of Values Anyway

P(G) = Pnorm (x1, x2, …)

Data from konect.uni-koblenz.de

Jérôme Kunegis

Generating Networks with Arbitrary Properties

13
Monte Carlo Markov Chain Methods
+ Current graphs
× Possible next steps
Wanted distribution
×
Random graphs
+
×

x2

×

×

×
P = high

×

Sampling will be bias
towards the distribution
of random graphs

P = low
×
×
×
×

×
×

×

×

×

×
x1
Jérôme Kunegis

Generating Networks with Arbitrary Properties

14
Solution: Integral of Measure of Voronoi Cells

Wanted distribution
×
×

Random graphs
×

×

x2

×

×

×

×

×
×

×

×
×

×

×

×
x1
Jérôme Kunegis

Generating Networks with Arbitrary Properties

15
How To Compute The Integral over Voronoi Cells
Answer: We don't have to.
Sampling strategy:
Sample point in statistic-space according to our
wanted distribution
●
Find nearest possible network (i.e., nearest “×”)
●

Claim: This distribution at each step is similar to the
underlying measure, giving an unbiased sampling.

Jérôme Kunegis

Generating Networks with Arbitrary Properties

16
Result: Close, But Not Exact

Jérôme Kunegis

Generating Networks with Arbitrary Properties

17
Convergence Speed (σ = 3)

Edge count

2-star count

Triangle count

Jérôme Kunegis

Generating Networks with Arbitrary Properties

18
Example: Generate Network with Same Properties as Zachary's Karate Club

Jérôme Kunegis

Generating Networks with Arbitrary Properties

19

Generating Networks with Arbitrary Properties

  • 1.
  • 2.
    Social Interaction “You’re myfriend” Jérôme Kunegis Generating Networks with Arbitrary Properties 2
  • 3.
    Many Social Interactions ” yfriend m You’re “ Jérôme Kunegis ’re m y frie nd” ” nd rie y friend” “You y ’re my frie nd ” f my ’re ou “Y “You’re m ’re ou “Y m d” n ie fr “Yo u y friend m “You’re Generating Networks with Arbitrary Properties ” 3
  • 4.
    Abstract: It's aNetwork Jérôme Kunegis Generating Networks with Arbitrary Properties 4
  • 5.
    Problem: Generate RealisticGraphs Why generate graphs? To visualize an existing network: generate a smaller graph with same properties as a large real (note: sampling a subset will skew the properties) ● For testing algorithms: Generate a larger network then those currently known ● Jérôme Kunegis Generating Networks with Arbitrary Properties 5
  • 6.
    Basic Idea forGenerating Networks: Random Graphs Each edge has probability p of existing Paul Erdős Jérôme Kunegis Generating Networks with Arbitrary Properties 6
  • 7.
    Random Graphs AreNot Realistic Real network Random graph Jérôme Kunegis Generating Networks with Arbitrary Properties 7
  • 8.
    Real Networks HaveSpecial Properties Many triangles (“clustering”) Many 2-stars (“preferential attachment”) Short paths (“small world”) ● Assortativity ● Power-law-like degree distributions ● Connectivity ● Reciprocity ● Global structure ● Subgraph patterns ● etc., etc., etc., etc., etc. ● Jérôme Kunegis Generating Networks with Arbitrary Properties 8
  • 9.
    Solution: Exponential RandomGraph Models Example with three statistics: P(G) = exp( a1 m + a2 t + a3 s + b ) m, t, s: Properties of G m = Number of edges; t = Number of triangles; s = Number of 2-stars a1, a2, a3, b: Parameters of the model Jérôme Kunegis Generating Networks with Arbitrary Properties 9
  • 10.
    Problems of ExponentialRandom Graph Models P(G) = exp( a1 x1 + a2 x2 + … + ak xk + b ) Many exponential random graph models are degenerate: They contain mostly almost-empty or almost-full graphs But on average, they produce the correct statistics! Jérôme Kunegis Generating Networks with Arbitrary Properties 10
  • 11.
    Explanation of Degeneracy Considera variable x between 0 and 1 with expected value 0.3. An exponential random model for it is given by: P(x) = exp( ax + b ) P(x) We get Mode[x] = 0 !! 0 Jérôme Kunegis 0 0.3 Generating Networks with Arbitrary Properties 1 x 11
  • 12.
    Idea Require not thatE[x] = c, but that x follow a normal distribution P(x) 0 0 0.3 1 x P(G) = Pnorm (x1, x2, …; μ1, μ2, …, σ1, σ2, …) Jérôme Kunegis Generating Networks with Arbitrary Properties 12
  • 13.
    Real Networks Havea Distribution of Values Anyway P(G) = Pnorm (x1, x2, …) Data from konect.uni-koblenz.de Jérôme Kunegis Generating Networks with Arbitrary Properties 13
  • 14.
    Monte Carlo MarkovChain Methods + Current graphs × Possible next steps Wanted distribution × Random graphs + × x2 × × × P = high × Sampling will be bias towards the distribution of random graphs P = low × × × × × × × × × × x1 Jérôme Kunegis Generating Networks with Arbitrary Properties 14
  • 15.
    Solution: Integral ofMeasure of Voronoi Cells Wanted distribution × × Random graphs × × x2 × × × × × × × × × × × × x1 Jérôme Kunegis Generating Networks with Arbitrary Properties 15
  • 16.
    How To ComputeThe Integral over Voronoi Cells Answer: We don't have to. Sampling strategy: Sample point in statistic-space according to our wanted distribution ● Find nearest possible network (i.e., nearest “×”) ● Claim: This distribution at each step is similar to the underlying measure, giving an unbiased sampling. Jérôme Kunegis Generating Networks with Arbitrary Properties 16
  • 17.
    Result: Close, ButNot Exact Jérôme Kunegis Generating Networks with Arbitrary Properties 17
  • 18.
    Convergence Speed (σ= 3) Edge count 2-star count Triangle count Jérôme Kunegis Generating Networks with Arbitrary Properties 18
  • 19.
    Example: Generate Networkwith Same Properties as Zachary's Karate Club Jérôme Kunegis Generating Networks with Arbitrary Properties 19