I am working on a problem which could be reduced to a graph optimization problem as below.
A set of colored nodes is given. They are all unconnected i.e. th
Just an idea, didn't have much time to verify it.
How about starting with a weighted graph G=(V,E) where V is your set of nodes and the weight E is the profit from your table. Let O be a empty set that will be our output.
Then use a matching algorithm(Blossom algorithm) on G. Add these edges to O.
Repeat the algorithm with input G'=(V,E\O). Again add these edges to O.
Repeat another two times. Return O.
Running time:
Blossom algorithm's running time is O(E*V^(1/2)) according to wikipedia. Since the algorithm is used 4 times the overall running time would also be O(E*V^(1/2)).