Quick implementation of social networking

P

phaedrus

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"
 
P

Phlip

phaedrus said:
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!
 
M

Michiel.Salters

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
 
A

aasingla

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

peter koch

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
 
P

Phlip

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

aasingla

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

peter said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top