Basics and Random Graphs Social and Technological Networks Rik - - PowerPoint PPT Presentation

basics and random graphs
SMART_READER_LITE
LIVE PREVIEW

Basics and Random Graphs Social and Technological Networks Rik - - PowerPoint PPT Presentation

Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage Check it regularly Announcements Lecture slides, reading material Do exercises 1. Today Some basics of graph theory


slide-1
SLIDE 1

Basics and Random Graphs

Social and Technological Networks

Rik Sarkar

University of Edinburgh, 2017.

slide-2
SLIDE 2

Webpage

  • Check it regularly
  • Announcements
  • Lecture slides, reading material
  • Do exercises 1.
slide-3
SLIDE 3

Today

  • Some basics of graph theory

– Wikipedia is a good resource for basics

  • Typical types of graphs & networks
  • What are random graphs?

– How can we define “random graphs”?

  • Some properRes of random graphs
slide-4
SLIDE 4

Graph

  • V: set of nodes
  • n = |V| : Number of nodes
  • E: set of edges
  • m=|E| : Number of edges
  • If edge a-b exists, then a and b are called

neighbors

slide-5
SLIDE 5

Walks

  • A sequence of verRces
  • Where successive verRces are neighbors

v1, v2, v3, . . . vi, vi+1, (vi, vi+1) ∈ E

slide-6
SLIDE 6

Paths

  • Walks without any repeated vertex
slide-7
SLIDE 7

Exercises

  • At most how many walks there can be on a

graph?

  • At most how many paths can there be on a

graph?

slide-8
SLIDE 8

Cycle

  • A walk with the same start and end vertex
slide-9
SLIDE 9

Subgraph of G

  • A graph H with a subset of verRces and edges
  • f G

– Of course, for any edge (a,b) in H, verRces a and b must also be in H

  • Subgraph induced by a subset of verRces

– Graph with verRces X and edges between nodes in X

X ⊆ V

slide-10
SLIDE 10

Connected component

  • A subgraph where

– Any two verRces are connected by a path

  • A connected graph

– Only 1 connected component

slide-11
SLIDE 11

Graph

  • How many edges can a graph have?
slide-12
SLIDE 12

Graph

  • How many edges can a graph have?
  • In big O?

✓n 2 ◆ OR n(n − 1) 2

slide-13
SLIDE 13

Graph

  • How many edges can a graph have?

✓n 2 ◆ OR n(n − 1) 2 O(n2)

slide-14
SLIDE 14

Some typical graphs

  • Complete graph

– All possible edges exist

  • Tree graphs

– Connected graphs – Do not contain cycles

slide-15
SLIDE 15

Typical graphs

  • Star graphs
  • BiparRte graphs

– VerRces in 2 parRRons – No edge in the same parRRon

slide-16
SLIDE 16

Typical graphs

  • Grids (finite)

– 1D grid (or chain, or path) – 2D grid – 3D grid

slide-17
SLIDE 17

Random graphs

  • Most basic, most unstructured graphs
  • Forms a baseline

– What happens in absence of any influences

  • Social and technological forces
  • Many real networks have a random

component

– Many things happen without clear reason

slide-18
SLIDE 18

Erdos – Renyi Random graphs

slide-19
SLIDE 19

Erdos – Renyi Random graphs

  • n: number of verRces
  • p: probability that any parRcular edge exists
  • Take V with n verRces
  • Consider each possible edge. Add it to E with

probability p

G(n, p)

slide-20
SLIDE 20

Expected number of edges

  • Expected total number of edges
  • Expected number of edges at any vertex
slide-21
SLIDE 21

Expected number of edges

  • Expected total number of edges
  • Expected number of edges at any vertex

n

2

  • p

(n − 1)p

slide-22
SLIDE 22

Expected number of edges

  • For
  • The expected degree of a node is : ?

p = c n − 1

slide-23
SLIDE 23

Isolated verRces

  • How likely is it that the graph has isolated

verRces?

slide-24
SLIDE 24

Isolated verRces

  • How likely is it that the graph has isolated

verRces?

  • What happens to the number of isolated

verRces as p increases?

slide-25
SLIDE 25

Probability of Isolated verRces

  • Isolated verRces are
  • Likely when:
  • Unlikely when:
  • Let’s deduce

p < ln n

n

p > ln n

n

slide-26
SLIDE 26

Useful inequaliRes

✓ 1 + 1 x ◆x ≤ e ✓ 1 − 1 x ◆x ≤ 1 e

slide-27
SLIDE 27

Union bound

  • For events A, B, C …
  • Pr[A or B or C ...] ≤ Pr[A] + Pr[B] + Pr[C] + ...
slide-28
SLIDE 28
  • Theorem 1:
  • If
  • Then the probability that there exists an

isolated vertex

p = (1 + ✏) ln n n − 1 ≤ 1 n✏

slide-29
SLIDE 29

Terminology of high probability

  • Something happens with high probability if
  • Where poly(n) means a polynomial in n
  • A polynomial in n is considered reasonably ‘large’

– Whereas something like log n is considered ‘small’

  • Thus for large n, w.h.p there is no isolated vertex
  • Expected number of isolated verRces is miniscule

Pr[event] ≥ ✓ 1 − 1 poly(n) ◆

slide-30
SLIDE 30
  • Theorem 2
  • For
  • Probability that vertex v is isolated

p = (1 − ✏) ln n n − 1 ≥ 1 (2n)1−✏

slide-31
SLIDE 31
  • Theorem 2
  • For
  • Probability that vertex v is isolated
  • Expected number of isolated verRces:

p = (1 − ✏) ln n n − 1 ≥ 1 (2n)1−✏ ≥ n (2n)1−✏ = n✏ 2

Polynomial in n

slide-32
SLIDE 32

Threshold phenomenon: Probability or number of isolated verRces

  • The Rpping point, phase transiRon
  • Common in many real systems
slide-33
SLIDE 33

Clustering in social networks

  • People with mutual friends are oken friends
  • If A and C have a common friend B

– Edges AB and BC exist

  • Then ABC is said to form a Triad

– Closed triad : Edge AC also exists – Open triad: Edge AC does not exist

  • Exercise: Prove that any connected graph has at

least n triads (considering both open and closed).

slide-34
SLIDE 34

Clustering coefficient (cc)

  • Measures how Rght the friend neighborhoods

are: frequency of closed triads

  • cc(A) fracRons of pairs of A’s neighbors that

are friends

  • Average cc : average of cc of all nodes
  • Global cc : raRo

# closed triads # all triads

slide-35
SLIDE 35

Global CC in ER graphs

  • What happens when p is very

small (almost 0)?

  • What happens when p is very

large (almost 1)?

slide-36
SLIDE 36

Global CC in ER graphs

  • What happens at the Rpping point?
slide-37
SLIDE 37

Theorem

  • For
  • Global cc in ER graphs is vanishingly small

p = cln n n lim

n→∞ cc(G) = lim n→∞

# closed triads # all triads = 0

slide-38
SLIDE 38

Avg CC In real networks

  • Facebook (old data) ~ 0.6
  • hpps://snap.stanford.edu/data/egonets-

Facebook.html

  • Google web graph ~0.5
  • hpps://snap.stanford.edu/data/web-Google.html
  • In general, cc of ~ 0.2 or 0.3 is considered

‘high’

– that the network has significant clustering/ community structure