Connecting Tech Pros Worldwide Forums | Help | Site Map

Quick implementation of social networking

phaedrus
Guest
 
Posts: n/a
#1: Sep 15 '06
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"

Phlip
Guest
 
Posts: n/a
#2: Sep 15 '06

re: Quick implementation of social networking


phaedrus wrote:
Quote:
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!!!


David Harmon
Guest
 
Posts: n/a
#3: Sep 15 '06

re: Quick implementation of social networking


On Fri, 15 Sep 2006 12:08:12 GMT in comp.lang.c++, "Phlip"
<phlipcpp@yahoo.comwrote,
Quote:
>
>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

sgupta1221@gmail.com
Guest
 
Posts: n/a
#4: Sep 18 '06

re: Quick implementation of social networking


Can you explain with example and how do we extract data from the
database.

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

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
Michiel.Salters@tomtom.com
Guest
 
Posts: n/a
#5: Sep 18 '06

re: Quick implementation of social networking


David Harmon wrote:
Quote:
Quote:
On Fri, 15 Sep 2006 12:08:12 GMT in comp.lang.c++, "Phlip"
<phlipcpp@yahoo.comwrote,
Quote:
>
>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

sgupta1221@gmail.com wrote:
Quote:
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

aasingla@gmail.com
Guest
 
Posts: n/a
#6: Sep 19 '06

re: Quick implementation of social networking


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...



Michiel.Salters@tomtom.com wrote:
Quote:
Quote:
David Harmon wrote:
Quote:
On Fri, 15 Sep 2006 12:08:12 GMT in comp.lang.c++, "Phlip"
<phlipcpp@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
>
>
sgupta1221@gmail.com wrote:
Quote:
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
peter koch
Guest
 
Posts: n/a
#7: Sep 19 '06

re: Quick implementation of social networking



aasingla@gmail.com wrote:
Quote:
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

Phlip
Guest
 
Posts: n/a
#8: Sep 19 '06

re: Quick implementation of social networking


aasingla@gmail.com wrote:
Quote:
Quote:
>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!!!


aasingla@gmail.com
Guest
 
Posts: n/a
#9: Sep 20 '06

re: Quick implementation of social networking


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:
Quote:
aasingla@gmail.com wrote:
Quote:
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
Default User
Guest
 
Posts: n/a
#10: Sep 20 '06

re: Quick implementation of social networking


aasingla@gmail.com wrote:
Quote:
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>
Closed Thread