Cascades II
Dr. Aron Culotta
Illinois Institute of Technology
With some figures from Networks and Markets: Reasoning about a highly connected world, David Easley and Jon Kleinberg
Last time...
This made several assumptions:
Today:
Consider the following scenario:
$w$ | |||
$v$ | $A$ | $B$ | |
$A$ | a,a | 0,0 | |
$B$ | 0,0 | b,b |
Each node plays this game with all neighbors.
Suppose some of $v$'s neighbors choose $A$ and some choose $B$
Which should $v$ choose?
Suppose some of $v$'s neighbors choose $A$ and some choose $B$
Which should $v$ choose?
equivalently
$$ p \ge \frac{b}{a+b} $$Let $q=\frac{b}{a+b}$
E.g.,
$q = \frac{b}{a+b} = \frac{4}{10}$
$p = \frac{2}{10}$
if $p \ge q$, choose Facebook
How many of my friends have to switch to Facebook before I will switch?
These decisions are made in a network, which means that order matters.
What if half my friends switch to Facebook?
When does this stop?
import warnings
warnings.filterwarnings("ignore")
import networkx as nx
graph = nx.Graph()
graph.add_edges_from([('v', 'w'), ('v', 'r'), ('v', 't'),
('w', 'r'), ('w', 's'), ('w', 'u'),
('w', 't'), ('r', 's'), ('t', 'u'), ('s', 'u')])
# Initialize every node to choice 'B'
nx.set_node_attributes(graph, 'choice', 'B')
graph.node
{'r': {'choice': 'B'}, 's': {'choice': 'B'}, 't': {'choice': 'B'}, 'u': {'choice': 'B'}, 'v': {'choice': 'B'}, 'w': {'choice': 'B'}}
import matplotlib.pyplot as plt
%matplotlib inline
layout = nx.spring_layout(graph)
def draw_graph(graph):
plt.figure()
nodes = graph.nodes()
colors = ['r' if graph.node[n]['choice'] == 'A' else 'b'
for n in graph]
plt.axis('off')
nx.draw_networkx(graph, nodelist=nodes, with_labels=True,
width=1, node_color=colors,alpha=.5,
pos=layout)
draw_graph(graph)
# Make v, w "early adopters"
graph.node['w']['choice'] = 'A'
graph.node['v']['choice'] = 'A'
draw_graph(graph)
[v for v in graph]
['v', 'w', 'r', 't', 's', 'u']
def simulate(graph, a, b, verbose=False):
""" For each node, set new choice based on payoffs a/b and
choices of neighbors. """
for v in graph:
if graph.node[v]['choice'] == 'B': # see if v wants to switch to action 'A'
a_neighbors = [w for w in graph.neighbors(v)
if graph.node[w]['choice'] == 'A']
b_neighbors = [w for w in graph.neighbors(v)
if graph.node[w]['choice'] == 'B']
p = len(a_neighbors) / (len(a_neighbors) + len(b_neighbors))
q = b / (a + b)
if verbose:
print('node %s p=%.3f q=%.3f' % (v, p, q))
if p >= q:
graph.node[v]['choice'] = 'A'
else:
graph.node[v]['choice'] = 'B'
# Make first step of simulation.
simulate(graph, 3, 2, verbose=True)
draw_graph(graph)
node r p=0.667 q=0.400 node t p=0.667 q=0.400 node s p=0.667 q=0.400 node u p=1.000 q=0.400
# Make second step of simulation.
simulate(graph, 3, 2, verbose=True)
draw_graph(graph)
So, all adopt $A$ after 2 steps.
# Consider a larger network. (Fig 19.4 in book)
def create_large_graph():
graph = nx.Graph()
graph.add_edges_from([(1,2), (1,3), (2,3), (2,6),
(6,4), (6,9), (4,7), (4,5),
(9,7), (5,7), (9,11), (5,8),
(7,8), (7,10), (9,10), (8,10),
(11,12), (11,15), (10,12), (8,14),
(15,16), (12,16), (14,13), (12,13),
(14,17), (13,16), (15,16), (17,16)])
nx.set_node_attributes(graph, 'choice', 'B')
return graph
graph = create_large_graph()
# Initialize every node to choice 'B'
layout = nx.spring_layout(graph)
draw_graph(graph)
# Make 7, 8 "early adopters"
graph.node[7]['choice'] = 'A'
graph.node[8]['choice'] = 'A'
draw_graph(graph)
[n for n in graph]
[1, 2, 3, 6, 4, 9, 7, 5, 11, 8, 10, 12, 15, 14, 16, 13, 17]
# Simulation, step 1
simulate(graph, 3, 2)
draw_graph(graph)
# Simulation, step 2
simulate(graph, 3, 2)
draw_graph(graph)
# Simulation, step 3
simulate(graph, 3, 2)
draw_graph(graph)
# No changes after 3 steps.
Cascade: a sequence of adoptions of a behavior
Two possible outcomes of a cascade:
The choice of initial adopters can cause a complete cascade or an incomplete cascade.
# Let's increase payoff a from 3->4
graph = create_large_graph()
# Make 7, 8 "early adopters"
graph.node[7]['choice'] = 'A'
graph.node[8]['choice'] = 'A'
draw_graph(graph)
# Simulation, step 1
simulate(graph, 4, 2)
draw_graph(graph)
# Simulation, step 2
simulate(graph, 4, 2)
draw_graph(graph)
# Simulation, step 3
simulate(graph, 4, 2)
draw_graph(graph)
# All adopt A after 4 steps.
# Next, let's go back to 3/2 payoffs,
# but convince 12 to adopt.
graph = create_large_graph()
# Make 7, 8 "early adopters"
graph.node[7]['choice'] = 'A'
graph.node[8]['choice'] = 'A'
draw_graph(graph)
simulate(graph, 3, 2)
draw_graph(graph)
simulate(graph, 3, 2)
draw_graph(graph)
simulate(graph, 3, 2)
draw_graph(graph)
# Convince 12 to adopt 'A'
graph.node[12]['choice'] = 'A'
simulate(graph, 3, 2)
draw_graph(graph)
# Cascade continues...
simulate(graph, 3, 2)
draw_graph(graph)
# Cascade stops.
simulate(graph, 3, 2)
draw_graph(graph)
** What prevents cascade from affecting nodes 1,2,3?**
A cluster of density $p$ is a set of nodes such that each node has at least a $p$ fraction of its neighbors in the set.
What cluster has density 1?
Conjectures:
(i) A cascade halts at dense clusters;
(ii) This is the only thing that halts a cascade.
More formally:
Consider a set of initial adopters of behavior $A$, with a threshold of $q$ for nodes in the remaining network to adopt behavior $A$.
(i) If the remaining network contains a cluster of density greater than $(1 − q)$, then the set of initial adopters will not cause a complete cascade.
(ii) Moreover, whenever a set of initial adopters does not cause a complete cascade with threshold $q$, the remaining network must contain a cluster of density greater than $(1 − q)$.
Proof of Claim 1: A cascade halts at dense clusters
By contradiction:
contradition $\Box$
draw_graph(graph)
so $$ q = \frac{2}{5} $$
Proof of Claim 2: Dense clusters are the only things that halt cascades.
A set of initial adopters can cause a complete cascade at threshold $q$ if and only if the remaining network contains no cluster of density greater than $(1 − q)$.
"Although a world-spanning system of weak ties in the global friendship network is able to spread awareness of a joke or an on-line video with remarkable speed, political mobilization moves more sluggishly, needing to gain momentum within neighborhoods and small communities."
$w$ | |||
$v$ | $A$ | $B$ | |
$A$ | $a_v$,$a_w$ | 0,0 | |
$B$ | 0,0 | $b_v$,$b_w$ |
equivalently
$$ p \ge \frac{b_v}{a_v+b_v} $$Let $$q_v = \frac{b_v}{a_v+b_v}$$
$q_v$ is a personal threshold. $v$ chooses $A$ iff a $q_v$ fraction of neighbors do.
How does diversity of $q_v$ affect cascade?
Influenceable people? (susceptibility)
Edge $e_{u,v} \in [0,1]$ specify the influence $u$ has on $v$
Let $A_v$ be the neighbors of $v$ that adopt $A$
$v$ adopts $A$ if:
Linear Threshold Model (See Watts 2002)