Introduction
We study how links are formed in social networks. In particular, we focus on investigating how a reciprocal (two-way) link, the basic relationship in social networks, is developed from a parasocial (one-way) relationship and how the relationships further develop into triadic closure, one of the fundamental processes of link formation.
Employing Twitter as a source for our experimental data, we propose a learning framework to formulate the problems of predicting reciprocity and triadic closure into a graphical model. The framework incorporates social theories into a machine learning model. We demonstrate that it is possible to accurately infer
90% of reciprocal relationships in a dynamic network. For predicting the triadic closure formation, the proposed model also achieves better performance (+20-30% in terms of F1) than several alternative methods. The study also presents several interesting phenomena. For example, it provides strong evidence of the existence of the structural balance among reciprocal relationships.
Data sets
We aim to find a large set of users and a continuously updated network among these users, so that we can use the data set as the gold-standard to evaluate different approaches for our prediction. To begin the collection process, we selected the most popular user on Twitter, i.e., “Lady Gaga”, and randomly collected 10,000 of her followers. We took these users as seed users and used a crawler to collect all followers of these users by traversing following edges. We continue the traversing process, which produced in total 13,442,659 users and 56,893,234 following links, with an average of 728,509 new links per day. The crawler monitored the change of the network structure from 10/12/2010 to 12/23/2010. We also extracted all tweets posted by these users and in total there are 35,746,366 tweets.
In our analysis, we consider the geographic location of each user. Specifically, we first extracted the location from the profile of each user2, and then fed the location information to the Google Map API to fetch its corresponding longitude and latitude values. In this way, we obtained the longitude and latitude of about 59% of users in our data set.
The dataset can be downloaded here.
Obvervations
We first engage in some high-level investigation of how different factors influence the formation of reciprocity and triadic closure, since a major motivation of our work is to find the underlying factors and their influence to this task. In particular, we study the interplay of the following factors with the formation of follow-backs (or triadic closure):
Geographic distance:
Do users have a higher probability to follow each other when they are located in the same region?

X-axis: time zone difference (0 indicates that users are located in the same time zone); Y-axis: (a) probability that one user follows back another user, conditioned on the time zone difference of the two users. (b) number of reciprocal relationships among users from the same time zone or different time zones.
Geographic distance has a pronounced effect on the number of reciprocal relationships created between users, but little effect on the likelihood of users following back each other.
Homophily:
Do similar users tend to follow each other? We make the analysis for both follow-back and triadic closure predictions.

Y-axis: probability that two users follow back each other, conditioned on the number of common neighbors of two-way (reciprocal) relationships or one-way (parasocial) relationships.
Y-axis: probability that two users follow back each other, conditioned on whether the two users are from the same group of elite/ordinary users or from different groups. #Degree, PageRank, and (alpha, beta) are three algorithms to distinguish elite users from ordinary users.
Users with common friends (reciprocal relationships) tend to follow each other. Elite users have a much stronger tendency (status homophily) to follow each other than ordinary users.
Implicit network:
How does the following network on Twitter correlate with other implicit networks, e.g., retweet and reply network?

Y-axis: probability that user B follows user A back, conditioned on one user (A or B) retweets or replies the other user's tweet.
The implicit networks of retweet or reply links have a strong correlation with the formation of two-way (reciprocal) relationships.
Social balance:
Does the reciprocal relationship network on Twitter satisfy the social balance theory? To which extent?

Y-axis: probability that a triad creates two-way (reciprocal) relationships, conditioned on whether the resultant structure is balanced or not.
The network of reciprocal relationships on Twitter is balanced (88% of triads satisfying the structural balance property), while the network of parasocial elationships is unbalanced (71% are unbalanced)
Models
We propose a Triad Factor Graph (TriFG) model to incorporate all the information within a single entity for better modeling and predicting the formation of reciprocal relationships and triadic closure.

To quantitatively evaluate the effectiveness of the proposed model and compare with other alternative methods, we carefully select a sub network, consists of all users which has a completely historic log of link formation among all users, i.e., each user is associated with a complete list of followers and users they are following at each time stamp. The sub network is comprised of 112,044 users, 468,238 following links among them, and 2,409,768 tweets. On average, there are 40,943 new follow links and 3,337 new follow-back links per day. We divide the sub network into 13 time stamps by viewing every four days as a time stamp.
For reciprocity prediction, in terms of F1-Measure, TriFG achieves a +27% improvement compared with the (SVM). Comparing with the other three graph-based methods, TriFG also results in an improvement of 22-25%
For triadic closure prediction, even the best performance of the baseline methods on the first test case is only 10% by F1 and 22% on the second test case. Our proposed TriFG significantly improves the performance (+18.6% in term of F1-score). The situation is similar on the second test case.
Prototype System
We have developed and deployed a web application for reciprocal prediction based on the proposed TriFG model. The system trained a TriFG model offline using all the follow and follow-back relationships in our data set. When a user wants to know how likely another user will follow him back, he first inputs his Twitter ID and the other user's ID. Then the system analyzes his social circle and the other user's social circle, and extracts features defined in our approach. Next, it makes the prediction based on the trained TriFG model.

Code [Download]