280 likes | 344 Vues
Handout # 4: The Science of Networks. SII 199 – Computer Networks and Society. Professor Yashar Ganjali Department of Computer Science University of Toronto yganjali@cs.toronto.edu http://www.cs.toronto.edu/~yganjali. Announcements.
E N D
Handout # 4:The Science of Networks SII 199 – Computer Networks and Society Professor Yashar Ganjali Department of Computer Science University of Toronto yganjali@cs.toronto.edu http://www.cs.toronto.edu/~yganjali
Announcements • Class mailing list: if you haven’t received an e-mail from me, please let me know. • Check out class web page for slides, and lecture notes. • Volunteer for lecture notes? University of Toronto – Fall 2011
The Story So Far … • Last week: Introduction to Computer Networks • Basics concepts and components • An introduction to the mail system • An introduction to the Internet • This week: The Science of Network • Introduction to graphs • Random graphs • Scale-free networks • Six degrees of separation • Diffusion of information University of Toronto – Fall 2011
Konigsberg Bridge Problem • Can one walk cross the 7 bridges and never pass the same bridge twice? • Model as a graph • Nodes: pieces of land • Edges: bridges • Euler proved that … • Such a path does not exist • Why? A B D C University of Toronto – Fall 2011
Science of Networks • Society as a graph • Nodes: people • Edges or links: relationships • Why? • Removes unnecessary details • Easier to focus, and … • To generalize ideas • Use ideas from one domain in another one • Can be applied to other networks • Examples: students in this class, computers at your home, … University of Toronto – Fall 2011
Some Terminology • Edges can be directed or undirected • Examples? • Edges can also have weights • Indication of the strength of the relationship between two nodes • Degree of a node • Number of links connected to that node • A component of a graph is … • Set of nodes that are connected by links • A connected graph has only one component University of Toronto – Fall 2011
Terminology – Cont’d • Path between node a and nodeb • Start at node a. Go through a sequence of nodes (and links) to reach b. • Path Length is the number of links on the path University of Toronto – Fall 2011
Definitions – Cont’d • Shortest path between node a and nodeb • Path with the minimum number of links • We can have more than one shortest path • Distance is the length of shortest path • Diameter is the distance of the two furthest nodes University of Toronto – Fall 2011
Characteristics of Social Networks • What do social networks look like today? • Are they completely random? • Is there a pattern we can find? • Properties of social networks • Average number of friends • Average path length between any two people • How does information propagate? • News, fashion, … • Who are the most influential people? • Fastest to distribute info, best target for advertisement • How can we detect communities? University of Toronto – Fall 2011
Random Graphs • Random graphs are extremely simple ways of modeling networks • How to build a random graph • Consider all pairs of nodes (a, b) • With probability p connect a and b • Question: what is the average degree of each node? • Answer: p(N-1) • Question: what is the average number of links? • Answer: [p(N-1)N]/2 University of Toronto – Fall 2011
Example University of Toronto – Fall 2011
Properties of Random Graphs • All nodes are treated similarly • Is this true in human networks? • What about computer networks? • Normal degree distribution • Sum of multiple coin flips • Let’s try it … University of Toronto – Fall 2011
In Class Exercise • Flip a coin 11 times • Assuming there are 12 students in class • If the i-th flip is heads • You and student number i are friends • Else • You and student number i are not friends • Count the number of friends you have. University of Toronto – Fall 2011
Social Networks vs. Random Graphs • Can we model social networks with random graphs? • There are groups of nodes which are highly connected to each other • But have less connectivity to the outside • Non-uniform probability of friendship • Not all nodes are similar • Few people have many many friends • Degree distribution is not normal Social networks are far from being random University of Toronto – Fall 2011
Hubs in Social Networks • In social networks not all nodes are equal. • Hubs: nodes with extremely larger degrees • People who know a lot of people • They connect different communities to each other • Degree distribution is not normal. • Heavy-tailed University of Toronto – Fall 2011
Examples of Hubs • In the World Wide Web, hubs might be websites such as Google, Facebook. • In Hollywood, the hubs are the actors who have worked with the most people. • In school, hubs are students who take many classes and interact with many classmates. • Membership in different groups • Class representatives • … University of Toronto – Fall 2011
Scale-Free Networks • Small subset of nodes have high degree of connectivity • Node degrees are heavy-tailed • Small number of nodes have very high degrees • Majority of nodes have small degrees • Not normal distribution (like random graphs) University of Toronto – Fall 2011
Barabasi-Albert Networks • Start from a small number of nodes • Add new nodes one after another • Each node will connect to k previous nodes • Preferential attachment • Connect to high node degrees with higher probability • Rich gets richer • This approach creates hubs • Few nodes in the network with very large degree of connectivity University of Toronto – Fall 2011
Example (k = 1) University of Toronto – Fall 2011
Rich Get Richer • In Barabasi-Albert model, incoming node has a higher probability of connecting to a node with a larger degree than a node with a small degree. • In other words, “rich get richer”. • This is what leads to creation of hubs. • Question. If you want to increase the size of your friends network, who is a better target: • Someone who has a similar background? Or, • Someone you know with a completely different background? University of Toronto – Fall 2011
Six Degrees of Separation • Harvard Psychology Professor • Study of obedience • In 1967 performed an experiment • Random people where asked to send a letter (through intermediaries) to someone in Boston. • If they didn’t know the target, they could send it to someone who might know him. • Only send to someone who you know on a first-name basis. • The average path length was six • Among the letters that were received • Many were not Stanley Milgram (1933-1984) Small World University of Toronto – Fall 2011
It Is a Small World • Same “small world” phenomena is seen in other networks • Co-authorship network • Nodes: paper authors • Links: co-authorship relationship • Network of web page • Nodes: web pages • Links: referrals • Hollywood • Nodes: actors and actresses • Links: playing in the same movie University of Toronto – Fall 2011
The Kevin Bacon Game • Consider any actor • You can get to Kevin Bacon in 6 steps or less • By traveling along the links connecting actors • Two actors are connected if they played in the same movie together. University of Toronto – Fall 2011
Separation of Web Pages, Molecules, … • You can get from a given web page to any other in a maximum of 19 clicks • Barabasi et al. • Molecules in a cell • Connected by reactions between molecules • Most pairs can be linked by a path of length three University of Toronto – Fall 2011
Diffusion in Social Networks • Ideas, products, viruses, … can spread in networks • Spreading rate: how fast the number of adopters grows • Depends on how likely people are to adopt Late adopters Early adopters Innovation University of Toronto – Fall 2011
Diffusion in Networks – Cont’d • In random networks • Either the entire network is infected, or • It dies out • Depends on spreading rate • Above a threshold all nodes will be infected • Below that threshold spread will die out • In scale-free networks however • No epidemic threshold • Steady state of small persistence rate • Hubs have an important role in the spread • It is critical to protect or infect the hubs University of Toronto – Fall 2011
Connectivity in Scale-Free Networks • Removing a few nodes randomly in scale-free networks does not make it disconnected. • You need to remove many nodes for that to happen. • Why? • Randomly selecting nodes, chances are you will select one with a small degree. There are very few hubs after all. • In an adversarial attack however, one can remove hubs. • Very few removals can break the system into several parts. • Think in terms of communication networks. University of Toronto – Fall 2011
Summary and Discussion • We model social networks with graphs. • Random graphs capture some properties of social networks, but not all. • Scale-free networks are better ways of modeling social networks. • We have heavy-tailed degree distribution in scale-free networks. • Diffusion of information • Random networks: all nodes infected if rate is above a threshold • Scale-free networks: steady persistence regardless of the rate • Can we take advantage of this? University of Toronto – Fall 2011