This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS 2110: Assignment 5 Graph Theory Abstract Today’s Web 2.0 environment is all about bringing people and machines together to interact in new ways. From this explosion of “social media” has sprung forth the concept of “social media analysis.” In this assignment we’re go- ing to walk you through some basic analysis on real-world data sets derived from common social networks, including LiveJournal and Twitter. This assignment is the last one of the semester, and as such we’ve decided to give you room to stretch your legs. The first half of the assignment will count for 80% of your grade, and will consist of your implementation of several graph property calculations for both adjacency lists and adjacency matrices. The second half of the assignment is open ended, and will account for 20% of your grade with a large opportunity for bonus credit. 1 Graph Properties When analyzing a new social network, scientists often ask questions like, “How many connected components exist in this graph?”, “How often do users communicate with each other?”, “Where does most communication tend to happen?”, and “How tightly-nit are the communities within this graph?” In this section we will examine each of these properties in detail. For each of these properties, you should consider the vertices to represent users and weighted, directed edges to represent the magnitude of the communication between the users. 1.1 How many connected components exist in this graph? (12 points) Believe it or not, the old saying “six degrees of separation” does not apply to all networks. Some networks form graphs which have many connected components . Users from one connected component have no connection to users in another connected component. Finding connected components is easy. To sketch the algorithm implementation: for v ∈ V do v.number = 0 ; end i ← 1 ; for v ∈ V do if v.number == 0 then DFS( v , i ) ; i ← i + 1 ; end end DFS will traverse each connected component and should label every vertex with the value i . The end result will be that each encountered connected component will be given a unique identifier. The number attribute of each vertex will hold the number of the connected component to which the vertex belongs. Notice that we don’t show how to actually implement this on the graph. We ask that you look in the Java collections framework to find a suitably fast collection which will provide O ( | V | + | E | ) runtime for the entire connected component procedure....
View Full Document
This note was uploaded on 11/08/2011 for the course CS 2110 taught by Professor Francis during the Spring '07 term at Cornell.
- Spring '07