graph problems
Posted: Fri Sep 01, 2006 6:04 pm
HI!
My first problem is to know if a graph is bipartite in the fastest way.
I don't know any algorithm in particular to do it...and I think I can do it in the best way in O(n), or I hope so, but if someone knows a method or a good algorithm it would be nice to know it.
The second problem is this:
I have 1 graph, and I want to divide it in 2 diferent groups of nodes, in such a way that the amount of conected nodes between the first group and the second is maximum... I hope you understand my bad description.
In another way to see this problem, just think in a group of people where some of them are friends. And I want to divide it in 2 teams such that the amount of pairs of friends between 1 team and another is maximum.
I would appreciate any help!
My first problem is to know if a graph is bipartite in the fastest way.
I don't know any algorithm in particular to do it...and I think I can do it in the best way in O(n), or I hope so, but if someone knows a method or a good algorithm it would be nice to know it.
The second problem is this:
I have 1 graph, and I want to divide it in 2 diferent groups of nodes, in such a way that the amount of conected nodes between the first group and the second is maximum... I hope you understand my bad description.
In another way to see this problem, just think in a group of people where some of them are friends. And I want to divide it in 2 teams such that the amount of pairs of friends between 1 team and another is maximum.
I would appreciate any help!