3. Motivation
Determine the appropriate person to recommend in
Social Media (Mainly Undirected here)
Help calculate the Betweeness Centrality of A Person
in a Social Network
(Weighted Graph) Best Route on Google Map
3
4. Algorithms – Breath-first Search
• Determine Root Node (starting Node)
• Initial Settings for all Nodes:
EdgeList, Distance From Root(initially all
Infinite), Status(not visited, being visited,
already visited), Parent Node
• Iteration of looking for neighbors and change
settings of nodes
4
5. Iteration
• Traverse all records (node ID and node setting),
find “BEINGVISITED” nodes (for example: A)
• Find their neighbors (B, C …..), apply new settings:
for B, C, …
Parent: null A
Status: TOBEVISITED BEINGVISITED
Distance: null A’s distance + 1
for A:
Status: BEINGVISITED VISITED
• Next Traversal would apply on these neighbors
(BEINGVISITED)
5
7. Map Reduce Structure
7
Preprocessing
Map & Reduce:
put data into
format
<nodeId,
nodeInformation>
Reduce:
Delete
old rows
of
neighbors
Map:
Create
new rows
for
neighbors
Postprocessing
Map & Reduce:
Collect all the
distances and get
the average
13. 13
Create an enum variable to represent counter
The counter increments by 1 when a node turns “BEINGVISITED”
Show the counter value on screen to show # of changes
17. Result – average distance
17
• The average distance from all nodes to source
node (0) is about 2.829
• For random person, Person 0 has to go across
about 2.8 immediate persons to find him.
18. Future Work
• Calculate all the average distance to each nodes
• Determine betweeness centrality based on
results of all nodes
• Visualization of Network (lower average distance
nodes have bigger radius)
18