By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,953 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,953 IT Pros & Developers. It's quick & easy.

Quick implementation of social networking

P: n/a
I need to implement a concept somewhat similar to social networking
sites like orkut/linkedIn etc etc... The story is below......

'A' can send request to any other member say 'B' to join his network.
The B joins his network. Now 'A' can approach the 'B' 's contacts by 2
ways directly or through 'B' and so on. Now suppose there is 'Z'
somewhere in the chain of 'B' , when I search for 'Z' it will display
me that you can reach 'Z' from 'B' using the chain or how can I view
the chain.

My question is "do i need to write/implement graph theory here or is
there any other rapid development approach available for this problem"

Sep 15 '06 #1
Share this Question
Share on Google+
9 Replies


P: n/a
phaedrus wrote:
I need to implement a concept somewhat similar to social networking
sites like orkut/linkedIn etc etc... The story is below......

'A' can send request to any other member say 'B' to join his network.
The B joins his network. Now 'A' can approach the 'B' 's contacts by 2
ways directly or through 'B' and so on. Now suppose there is 'Z'
somewhere in the chain of 'B' , when I search for 'Z' it will display
me that you can reach 'Z' from 'B' using the chain or how can I view
the chain.

My question is "do i need to write/implement graph theory here or is
there any other rapid development approach available for this problem"
The path thru B to Z is just "minimum cost spanning tree", which is one of
the simplest graph theory algorithms available. Look that up, and you might
even find an implementation in C++ (the topic of this newsgroup).

Don't fear doing it the right way!

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Sep 15 '06 #2

P: n/a
On Fri, 15 Sep 2006 12:08:12 GMT in comp.lang.c++, "Phlip"
<ph******@yahoo.comwrote,
>
The path thru B to Z is just "minimum cost spanning tree", which is one of
the simplest graph theory algorithms available. Look that up, and you might
even find an implementation in C++
Sounds like it might be related to
http://www.boost.org/libs/graph/doc/..._contents.html

Sep 15 '06 #3

P: n/a
Can you explain with example and how do we extract data from the
database.

David Harmon wrote:
On Fri, 15 Sep 2006 12:08:12 GMT in comp.lang.c++, "Phlip"
<ph******@yahoo.comwrote,

The path thru B to Z is just "minimum cost spanning tree", which is one of
the simplest graph theory algorithms available. Look that up, and you might
even find an implementation in C++

Sounds like it might be related to
http://www.boost.org/libs/graph/doc/..._contents.html
Sep 18 '06 #4

P: n/a
David Harmon wrote:
On Fri, 15 Sep 2006 12:08:12 GMT in comp.lang.c++, "Phlip"
<ph******@yahoo.comwrote,
>
>The path thru B to Z is just "minimum cost spanning tree", which is one of
>the simplest graph theory algorithms available. Look that up, and you might
>even find an implementation in C++
Sounds like it might be related to
http://www.boost.org/libs/graph/doc/..._contents.html

sg********@gmail.com wrote:
Can you explain with example and how do we extract data from the
database.
Buy the book! Boost::Graph is documented very well. It comes with CD.

ISBN: 0201729148

HTH,
Michiel Salters

Sep 18 '06 #5

P: n/a
Hi,
I dont think we exactly need Graph theory or "Minimum cost" Algos here
as in this case all the edges of the graph carry the same weightage.
We just need to detect the relation at minimum number of nodes/degrees.
If there is more than one path available to end contact with same
degree - we do not need to calulate anything based on "minumum cost" or
any other criteria as there is no different weightages of friendship.

As per my understanding, a sql query in the form of stored proc can be
enough which iteratively looks up friends at 1..n th level.

Your comments please...

Mi*************@tomtom.com wrote:
David Harmon wrote:
On Fri, 15 Sep 2006 12:08:12 GMT in comp.lang.c++, "Phlip"
<ph******@yahoo.comwrote,

The path thru B to Z is just "minimum cost spanning tree", which is one of
the simplest graph theory algorithms available. Look that up, and you might
even find an implementation in C++
>
Sounds like it might be related to
http://www.boost.org/libs/graph/doc/..._contents.html


sg********@gmail.com wrote:
Can you explain with example and how do we extract data from the
database.

Buy the book! Boost::Graph is documented very well. It comes with CD.

ISBN: 0201729148

HTH,
Michiel Salters
Sep 19 '06 #6

P: n/a

aa******@gmail.com wrote:
Hi,
I dont think we exactly need Graph theory or "Minimum cost" Algos here
as in this case all the edges of the graph carry the same weightage.
We just need to detect the relation at minimum number of nodes/degrees.
If there is more than one path available to end contact with same
degree - we do not need to calulate anything based on "minumum cost" or
any other criteria as there is no different weightages of friendship.

As per my understanding, a sql query in the form of stored proc can be
enough which iteratively looks up friends at 1..n th level.

Your comments please...
[snip]

You are off-topic here where standard C++ is discussed. So find a forum
where you are topical or rephrase your question so that it is about
standard C++.

/Peter

Sep 19 '06 #7

P: n/a
aa******@gmail.com wrote:
>I dont think we exactly need Graph theory or "Minimum cost" Algos here
as in this case all the edges of the graph carry the same weightage.
It's still "minimum cost spanning tree", because that finds the minimum cost
path, even when each edge is the same cost.

To solve this problem, you need graph theory (and a topical newsgroup);
there are no shortcuts.

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Sep 19 '06 #8

P: n/a
Thanx Peter but i am not the questioner - I am just replying to the
question that is already posted in this group.

peter koch wrote:
aa******@gmail.com wrote:
Hi,
I dont think we exactly need Graph theory or "Minimum cost" Algos here
as in this case all the edges of the graph carry the same weightage.
We just need to detect the relation at minimum number of nodes/degrees.
If there is more than one path available to end contact with same
degree - we do not need to calulate anything based on "minumum cost" or
any other criteria as there is no different weightages of friendship.

As per my understanding, a sql query in the form of stored proc can be
enough which iteratively looks up friends at 1..n th level.

Your comments please...
[snip]

You are off-topic here where standard C++ is discussed. So find a forum
where you are topical or rephrase your question so that it is about
standard C++.

/Peter
Sep 20 '06 #9

P: n/a
aa******@gmail.com wrote:
Thanx Peter but i am not the questioner - I am just replying to the
question that is already posted in this group.


Please don't top-post. Your replies belong following or interspersed
with properly trimmed quotes. See the majority of other posts in the
newsgroup, or the group FAQ list:
<http://www.parashift.com/c++-faq-lite/how-to-post.html>
Sep 20 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.