I am not sure if this is really a "coloring" problem as much as it is an assignment/linear-programming problem. I have zero expertise in either, so pardon any noob-ness that might follow. But I get the feeling that this problem must have almost definitely been solved/investigated before, I just couldnt find anything after looking through many of the graph algorithms on http://en.wikipedia.org/wiki/Category:Graph_algorithms . I was hoping to get some pointers in the right direction.
The "problem-statement" effectively boils down to :
There are two types of vertices in the graph : routers and cores.
Cores are connected to routers ONLY. Each core is connected only to a SINGLE router. And each has a user-inputed/defined "color". (In my specific problem the color is limited to one of say 4/5 possible colors). Their color cannot be changed, it is an input parameter. (Cores are the squares in the image below)
Routers are connected to cores as well as other routers. They do not have a "color" assigned to them. Assigning a color is part of the objective of the program/algorithm. (Routers are the circular vertices in the image below.)
The objective of the program is to assign colors to each router in the graph such that the number of "crossings"/edges between vertices of a different colors are minimized.
(An alternative view : In essence you are given a graph where some vertices are colored, others are not. The objective is to color the ones that are not such that the number of edges between vertices of different color is minimized.)
I was able to formulate this (quite poorly I am sure) as an Integer-Linear-Program and have setup a solution/approach using LP-Solve. I also have a heuristic of my own. I would love to know the "proper"/known/other approaches towards solving this?!
Many Thanks!
Definition 16 (Chromatic Number). The chromatic number of a graph is the minimum number of colors in a proper coloring of that graph.
Painting all the vertices of a graph with colors such that no two adjacent vertices have the same color is called the proper coloring(or sometimes simply coloring) of a graph and a coloring using at most k colors is called a (proper) k-vertex coloring of a graph.
The smallest number of colors needed to color a graph G is called its chromatic number, and is often denoted χ(G).
How many unique colors will be required for proper vertex coloring of an empty graph having n vertices? Explanation: An empty graph is a graph without any edges. So the number of unique colors required for proper coloring of the graph will be 1.
Graph coloring is the procedure of assignment of colors to each vertex of a graph G such that no adjacent vertices get same color. The objective is to minimize the number of colors while coloring a graph. The smallest number of colors required to color a graph G is called its chromatic number of that graph.
Let's start by focusing on the case with two colors. We can turn this into an instance of s-t min cut. The idea is that we have designated an s node and a t node in a graph, and that we want to divide the remaining nodes into either the s group or the t group, such that the sum of the edge weights between the two groups is minimized. For your version, we have a master yellow node s and master red node t, and we place a high weighted edge exceeding the count of all edges in your original graph between each of the cores and their corresponding master color node, with all the original edges intact having weight 1 each. The high cost edges ensure that we will never illegally recolor any of the cores as it will be cheaper to move all of the routers. This problem can be solved in polynomial time using standard max flow algorithms via the Max flow-Min cut theorem. The best choice depends on your edge and vertex count.
In the case of multiple colors, you are trying to solve the "multiterminal cut" problem. This is related to the minimum k-cut problem, but the standard reference for this problem is the paper The Complexity of Multiterminal Cuts (which the k-cut article links to indirectly). For more than 2 colors, apparently if the graph is planar, the problem is still solvable in polynomial time; otherwise, it is NP-hard, so you might as well use your integer programming solver as this is another NP-hard problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With