Sample Header Ad - 728x90

How do I store time-varying follower-following relationship?

2 votes
1 answer
30 views
Assume we have a small social media app, containing only 4 people, whos UID = 11, 22, 33, 44 respectively. These people would follow and unfollow each other over time, and say, I want to take note of their follower relationship on a weekly basis. In other words, I want to store temporal network relationship. Week 1, their follower network looks like: enter image description here | primary serial | user own UID | followed UID | |---| --- | ---| | 1 | 11 | 22 | | 2 | 11 | 33 | | 3 | 22 | 33 | | 4 | 11 | 44 | Week 2, the change being that user 11 unfollowed 22, and user 44 followed 22: enter image description here | primary serial | user own UID | followed UID | |---| --- | ---| | 1 | 11 | 33 | | 2 | 22 | 33 | | 3 | 11 | 44 | | 4 | 44 | 22 | Finally, now in Week 3, user 11 re-followed user 22: enter image description here | primary serial | user own UID | followed UID | |---| --- | ---| | 1 | 11 | 22 | | 2 | 11 | 33 | | 3 | 22 | 33 | | 4 | 11 | 44 | | 5 | 44 | 22 | The 3 tables under each week's network are only for that specific week, but storing these week-tables creates redundancy, since some relations remain unchanged across time: | primary serial | user own UID | followed UID | |---| --- | ---| | ... | 11 | 33 | | ... | 22 | 33 | | ... | 11 | 44 | - So I wonder if there is a good way of keeping record of time-varying follower-following relationship across time, in 1 table rather than 3? - And given such a new (less-redundant) table, can I replicate the follower network structure of a given week directly (that is, I can get Week N network without needing to compute from Week 1 to Week N-1 networks)? - Should I add a column of week-specific labels? Should I add a boolean column to indicate whether or not the row's relation still exist? Any help would be highly appreciated! Thank you so much in advance!
Asked by Greenhill (121 rep)
Oct 9, 2024, 08:49 PM
Last activity: Oct 10, 2024, 06:21 AM