basics and random graphs - the university of edinburgh · basics and random graphs social and...

38
Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017.

Upload: others

Post on 15-Aug-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

BasicsandRandomGraphs

SocialandTechnologicalNetworks

RikSarkar

UniversityofEdinburgh,2017.

Page 2: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Webpage

•  Checkitregularly•  Announcements•  Lectureslides,readingmaterial•  Doexercises1.

Page 3: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Today

•  Somebasicsofgraphtheory– Wikipediaisagoodresourceforbasics

•  Typicaltypesofgraphs&networks•  Whatarerandomgraphs?– Howcanwedefine“randomgraphs”?

•  SomeproperResofrandomgraphs

Page 4: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Graph

•  V:setofnodes•  n=|V|:Numberofnodes

•  E:setofedges•  m=|E|:Numberofedges

•  Ifedgea-bexists,thenaandbarecalledneighbors

Page 5: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Walks

•  AsequenceofverRces•  WheresuccessiveverRcesareneighbors

v1, v2, v3, . . .

vi, vi+1, (vi, vi+1) 2 E

Page 6: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Paths

•  Walkswithoutanyrepeatedvertex

Page 7: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Exercises

•  Atmosthowmanywalkstherecanbeonagraph?

•  Atmosthowmanypathscantherebeonagraph?

Page 8: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Cycle

•  Awalkwiththesamestartandendvertex

Page 9: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

SubgraphofG

•  AgraphHwithasubsetofverRcesandedgesofG– Ofcourse,foranyedge(a,b)inH,verRcesaandbmustalsobeinH

•  SubgraphinducedbyasubsetofverRces– GraphwithverRcesXandedgesbetweennodesinX

X ✓ V

Page 10: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Connectedcomponent

•  Asubgraphwhere– AnytwoverRcesareconnectedbyapath

•  Aconnectedgraph– Only1connectedcomponent

Page 11: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Graph

•  Howmanyedgescanagraphhave?

Page 12: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Graph

•  Howmanyedgescanagraphhave?

•  InbigO?

✓n

2

◆OR

n(n� 1)

2

Page 13: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Graph

•  Howmanyedgescanagraphhave?

✓n

2

◆OR

n(n� 1)

2

O(n2)

Page 14: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Sometypicalgraphs

•  Completegraph– Allpossibleedgesexist

•  Treegraphs– Connectedgraphs– Donotcontaincycles

Page 15: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Typicalgraphs

•  Stargraphs

•  BiparRtegraphs– VerRcesin2parRRons– NoedgeinthesameparRRon

Page 16: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Typicalgraphs

•  Grids(finite)– 1Dgrid(orchain,orpath)

– 2Dgrid

– 3Dgrid

Page 17: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Randomgraphs

•  Mostbasic,mostunstructuredgraphs•  Formsabaseline– Whathappensinabsenceofanyinfluences

•  Socialandtechnologicalforces

•  Manyrealnetworkshavearandomcomponent– Manythingshappenwithoutclearreason

Page 18: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Erdos–RenyiRandomgraphs

Page 19: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Erdos–RenyiRandomgraphs

•  n:numberofverRces•  p:probabilitythatanyparRcularedgeexists

•  TakeVwithnverRces•  Considereachpossibleedge.AddittoEwithprobabilityp

G(n, p)

Page 20: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Expectednumberofedges

•  Expectedtotalnumberofedges

•  Expectednumberofedgesatanyvertex

Page 21: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Expectednumberofedges

•  Expectedtotalnumberofedges

•  Expectednumberofedgesatanyvertex

�n2

�p

(n� 1)p

Page 22: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Expectednumberofedges

•  For

•  Theexpecteddegreeofanodeis:?

p =c

n� 1

Page 23: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

IsolatedverRces

•  HowlikelyisitthatthegraphhasisolatedverRces?

Page 24: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

IsolatedverRces

•  HowlikelyisitthatthegraphhasisolatedverRces?

•  WhathappenstothenumberofisolatedverRcesaspincreases?

Page 25: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

ProbabilityofIsolatedverRces

•  IsolatedverRcesare

•  Likelywhen:

•  Unlikelywhen:

•  Let’sdeduce

p < lnnn

p > lnnn

Page 26: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

UsefulinequaliRes

✓1 +

1

x

◆x

e

✓1� 1

x

◆x

1

e

Page 27: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Unionbound

•  ForeventsA,B,C…

•  Pr[AorBorC...]≤Pr[A]+Pr[B]+Pr[C]+...

Page 28: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

•  Theorem1:•  If

•  Thentheprobabilitythatthereexistsanisolatedvertex

p = (1 + ✏)lnn

n� 1

1

n✏

Page 29: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Terminologyofhighprobability

•  Somethinghappenswithhighprobabilityif

•  Wherepoly(n)meansapolynomialinn•  Apolynomialinnisconsideredreasonably‘large’– Whereassomethinglikelognisconsidered‘small’

•  Thusforlargen,w.h.pthereisnoisolatedvertex•  ExpectednumberofisolatedverRcesisminiscule

Pr[event] �✓1� 1

poly(n)

Page 30: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

•  Theorem2•  For

•  Probabilitythatvertexvisisolated

p = (1� ✏)lnn

n� 1

� 1

(2n)1�✏

Page 31: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

•  Theorem2•  For

•  Probabilitythatvertexvisisolated

•  ExpectednumberofisolatedverRces:

p = (1� ✏)lnn

n� 1

� 1

(2n)1�✏

� n

(2n)1�✏=

n✏

2Polynomialinn

Page 32: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Thresholdphenomenon:ProbabilityornumberofisolatedverRces

•  TheRppingpoint,phasetransiRon

•  Commoninmanyrealsystems

Page 33: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Clusteringinsocialnetworks•  Peoplewithmutualfriendsareokenfriends

•  IfAandChaveacommonfriendB–  EdgesABandBCexist

•  ThenABCissaidtoformaTriad–  Closedtriad:EdgeACalsoexists– Opentriad:EdgeACdoesnotexist

•  Exercise:Provethatanyconnectedgraphhasatleastntriads(consideringbothopenandclosed).

Page 34: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Clusteringcoefficient(cc)

•  MeasureshowRghtthefriendneighborhoodsare:frequencyofclosedtriads

•  cc(A)fracRonsofpairsofA’sneighborsthatarefriends

•  Averagecc:averageofccofallnodes•  Globalcc:raRo #closedtriads

#alltriads

Page 35: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

GlobalCCinERgraphs

•  Whathappenswhenpisverysmall(almost0)?

•  Whathappenswhenpisverylarge(almost1)?

Page 36: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

GlobalCCinERgraphs

•  WhathappensattheRppingpoint?

Page 37: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

Theorem

•  For

•  GlobalccinERgraphsisvanishinglysmall

p = clnn

n

lim

n!1cc(G) = lim

n!1

# closed triads

# all triads

= 0

Page 38: Basics and Random Graphs - The University of Edinburgh · Basics and Random Graphs Social and Technological Networks Rik Sarkar University of Edinburgh, 2017. Webpage • Check it

AvgCCInrealnetworks

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

•  Googlewebgraph~0.5•  hpps://snap.stanford.edu/data/web-Google.html

•  Ingeneral,ccof~0.2or0.3isconsidered‘high’–  thatthenetworkhassignificantclustering/communitystructure