当前在线人数12081
首页 - 分类讨论区 - 电脑网络 - 数据库版 -阅读文章
未名交友
[更多]
[更多]
文章阅读:Re: How to design a database model related to six degree
[同主题阅读] [版面: 数据库] [作者:tailang] , 2007年07月31日16:33:31
tailang
进入未名形象秀
我的博客
[上篇] [下篇] [同主题上篇] [同主题下篇]

发信人: tailang (西瓜太郎), 信区: Database
标  题: Re: How to design a database model related to  six degree of se
发信站: BBS 未名空间站 (Tue Jul 31 16:33:31 2007)

If the only concern is the efficiency of these two queries, just create a
table as simple as

id1, id2, degree
where id1 and id2 are the user ids and degree is from 1 to 6

Well, insert/update/delete would be disastrous, but that's not what you are
concerned, right? (assume this is an academic project)


【 在 tennisalways (tennisforever) 的大作中提到: 】
: I am trying to design a database model related to the small world (or six
: degree of separation) phenomenon.
: With this design, I should be able to write two queries efficiently:
: a)      How many degrees of separation are there between two people.
: (assuming they are connected). You may assume that you do not have to
check
: for more than 6 degrees.
: b)      Who are all the people that have x degrees of separation from a
: given person.
: If anybody has any idea on how to do this, or any references, please let
me
: know.
: ...................



--

※ 来源:·WWW 未名空间站 海外: mitbbs.com 中国: mitbbs.cn·[FROM: 216.113.]

[上篇] [下篇] [同主题上篇] [同主题下篇]
[转寄] [转贴] [回信给作者] [修改文章] [删除文章] [同主题阅读] [从此处展开] [返回版面] [快速返回] [收藏] [举报]
 
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996