Is vertex coloring of hypergraph with no uniformity restriction NP-hard? - np-complete

Is vertex coloring of a hypergraph with no uniformity restriction NP-hard? I have seen papers that show vertex coloring for a k-unoform hypergraph is NP-hard. However I could not find any source that explicitly says whether or not a vertex coloring in the general case (not just k-uniform) hypergraph is NP-hard.

Before answering this question, there are many things have to be explained such as coloring and uniformity in hypergraphs. I will use here different notations.
A k-coloring of a hypergraph H = (V, E) is a function assigning colors from {1, 2, . . . , k} to vertices of H in such a way that no edge is monochromatic (no edge has all vertices of the same color - besides singletons).
The chromatic number of a hypergraph H, is the smallest integer k for which H admits a k-coloring.
A hypergraph H=(V,E) is called r-uniform, If all edges have cardinality (size) exactly r. The cardinality of an hyperedge (e) is the number of vertices in (e).
You have already found that a k-coloring for r-uniform hypergraph, r>=3, is NP-hard. If this is true (which is true) then it is NP-hard for general hypergraphs, because this is the smaller problem than general hypergraphs.
To convince you that this is true, let's have a look to the Berg definition of r-uniform hypergraph 1. This is equivalent to the above definition.
Let's denote r(H)=Max|Ei|, and s(H)=min|Ei|. H is r-uniform hypergraph if r(H)=s(H). Now if I can color this in polynomail time, which means I found the smallest integer k for which H admits a k-coloring. Then for general hypergraphs when s(H) could be smaller than r(H), we will be able to color the vertices in polynomial time.
To find the exact value of the chromatic number of a hypergraph is NP-hard.

Related

finding maximum weight subgraph

My graph is as follows:
I need to find a maximum weight subgraph.
The problem is as follows:
There are n Vectex clusters, and in every Vextex cluster, there are some vertexes. For two vertexes in different Vertex cluster, there is a weighted edge, and in the same Vextex cluster, there is no edge among vertexes. Now I
want to find a maximum weight subgraph by finding only one vertex in each
Vertex cluster. And the total weight is computed by adding all weights of the edges between the selected vertex. I add a picture to explain the problem. Now I know how to model this problem by ILP method. However, I do not know how to solve it by an approximation algorithm and how to get its approximation ratio.
Could you give some solutions and suggestions?
Thank you very much. If any unclear points in this description,
please feel free to ask.
I do not think you can find an alpha-approx for this problem, for any alpha. That is because if such an approximation exists, then it would also prove that the unique games conjecture(UGC) is false. And disproving (or proving) the UGC is a rather big feat :-)
(and I'm actually among the UGC believers, so I'd say it's impossible :p)
The reduction is quite straightforward, since any UGC instance can be described as your problem, with weights of 0 or 1 on edges.
What I can see as polynomial approximation is a 1/k-approx (k the number of clusters), using a maximum weight perfect matching (PM) algorithm (we suppose the number of clusters is even, if it's odd just add a 'useless' one with 1 vertex, 0 weights everywhere).
First, you need to build a new graph. One vertex per cluster. The weight of the edge u, v has the weight max w(e) for e edge from cluster u to cluster v. Run a max weight PM on this graph.
You then can select one vertex per cluster, the one that corresponds to the edge selected in the PM.
The total weight of the solution extracted from the PM is at least as big as the weight of the PM (since it contains the edges of the PM + other edges).
And then you can conclude that this is a 1/k approx, because if there exists a solution to the problem that is more than k times bigger than the PM weight, then the PM was not maximal.
The explanation is quite short (lapidaire I'd say), tell me if there is one part you don't catch/disagree with.
Edit: Equivalence with UGC: unique label cover explained.
Think of a UGC instance. Then, every node in the UGC instance will be represented by a cluster, with as many nodes in the cluster as there are colors in the UGC instance. Then, create edge with weight 0 if they do not correspond to an edge in the UGC, or if it correspond to a 'bad color match'. If they correspond to a good color match, then give it the weight 1.
Then, if you find the optimal solution to an instance of your problem, it means it corresponds to an optimal solution to the corresponding UGC instance.
So, if UGC holds, it means it is NP-hard to approximate your problem.
Introduce a new graph G'=(V',E') as follows and then solve (or approximate) the maximum stable set problem on G'.
Corresponding to each edge a-b in E(G), introduce a vertex v_ab in V'(G') where its weight is equal to the weight of the edge a-b.
Connect all of vertices of V'(G') to each other except for the following ones.
The vertex v_ab is not connected to the vertex v_ac, where vertices b and c are in different clusters in G. In this manner, we can select both of these vertices in an stable set of G' (Hence, we can select both of the corresponding edges in G)
The vertex v_ab is not connected to the vertex v_cd, where vertices a, b, c and d are in different clusters in G. In this manner, we can select both of these vertices in an stable set of G' (Hence, we can select both of the corresponding edges in G)
Finally, I think you can find an alpha-approximation for this problem. In other words, in my opinion the Unique Games Conjecture is wrong due to the 1.999999-approximation algorithm which I proposed for the vertex cover problem.

Pathfinding through graph with special vertices

Heyo!
So I've got this directed and/or undirected graph with a bunch of vertices and edges. In this graph there is a start vertex and an end vertex. There's also a subset of vertices which are coloured red (this subset can include the start and end vertices). Also, no pair of vertices can have more than one edge between them.
What I have to do is to find:
A) The shortest path that passes no red vertices
B) If there is a path that passes at least one red vertex
C) The path with the greatest amount of red vertices
D) The path with the fewest amount of red vertices
For A I use a breadth first search ignoring red branches. For B I simply brute force it with a depth first search of the graph. And for C and D I use dynamic programming, memoizing the number of red vertices I find in all paths, using the same DFS as in B.
I am moderately happy with all the solutions and I would very much appreciate any suggestions! Thanks!!
For A I use a breadth first search ignoring red branches
A) is a Typical pathfinding problem happening in the sub-graph that contains no red edges. So your solution is good (could be improved with heuristics if you can come up with one, then use A*)
For B I simply brute force it with a depth first search of the graph
Well here's the thing. Every optimal path A->C can be split at an arbitrary intermediate point B. A Nice property of optimal paths, is that every sub-path is optimal. So A->B and B->C are optimal.
This means if you know you must travel from some start to some end through an intermediary red vertex, you can do the following:
Perform a BFS from the start vertex
Perform a BFS from the endvertex backwards (If your edges are directed - as I think - you'll have to take them in reverse, here)
Alternate expanding both BFS so that both their 'edge' (or open lists, as they are called) have the same distance to their respective start.
Stop when:
One BFS hits a red vertex encountered by (or in the 'closed' list of) the other one. In this case, Each BFS can construct the optimal path to that commen vertex. Stitch both semi-paths, and you have your optimal path with at least a red vertex.
One BFS is stuck ('open' list is empty). In this case, there is no solution.
C) The path with the greatest amount of red vertices
This is a combinatorial problem. the first thing I would do is make a matrix of reachability of [start node + red nodes + end nodes] where:
reachability[i, j] = 1 iff there is a path from node i to node j
To compute this matrix, simply perform one BFS search starting at the start node and at every red node. If the BFS reaches a red node, put a 1 in the corresponding line/column.
This will abstract away the underlying complexity of the graph, and make an order of magnitude speedup on the combinatorial search.
The problem is now a longest path problem through that connectivity matrix. dynamic programming would be the way to go indeed.
D) The path with the fewest amount of red vertices
Simply perform a Dijkstra search, but use the following metric when sorting the nodes in the 'open' list:
dist(start, a) < dist(start, b) if:
numRedNodesInPath(start -> a) < numRedNodesInPath(start -> b)
OR (
numRedNodesInPath(start -> a) == numRedNodesInPath(start -> b)
AND
numNodesInPath(start -> a) < numNodesInPath(start -> a)
)
For this, when discovering new vertices, you'll have to store the path leading up to them (well, just the nb of nodes in the path, as well as the nb of red nodes, separately) in a dedicated map to be fetched. I mention this because usually, the length of the path is stored implicitly as the position of the verrtex in the array. You'll have to enforce it explicitely in your case.
Note on length optimality:
Even though you stated you did not care about length optimality outside of problem A), the algorithm I provided will produce shortest-length solutions. In many cases (like in D) it helps Dijkstra converge better I believe.

A variant of the minimum vertex cover

In my research I confront a variant of the vertex cover problem as follows:
Given a graph G, a vertex v and a number k, to decide whether G has a vertex cover of size k
that contain v.
I have search all over literature and could not find a similar problem. I am interested in the complexity of this problem ( I have proved that it complete for $P^NP[long]$ ).
The question is have you ever seen such variant of vertex cover problem? How do you call this problem ?
Given a graph G and a integer K, to decide whether G has a vertex cover of size K is the decision problem of minimal vertex cover problem. And it is NP-complete.
If fact, the problem you described is no difference with that one. That is because if you have contained vertex v, you can remove v and all edges having v as an end-point. What you should do next is to decide whether you can cover the left sub-graph with k-1 vertices.

Adjusting a MST to account for O(1) changes to edge weights

Let G = (V,E) be an undirected graph. Let w(e) be a weighting function with positive weights. Let T be a minimum spanning tree of G with respect to w.
Given a set of edges S, where S is a subset of E(G), define a new weighting function Q as Q(e) = w(e) if e is not in S, and Q(e) = w(e)+100 if e is in S. Design an algorithm that accepts as input, G, T, w and a set S, |S| = 10 and outputs a minimum spanning tree w.r.t. Q. Make it run in O(V+E) time.
Ok: what I've learned since I originally asked this question is that partitioning an MST is to "break apart" a single edge, which makes two separate components, each MST's of the vertices in their own components. So, in this problem, the edges in S might break up the MST into smaller MST's (11, right?). I have to find the lightest edges that connect one component to another.
My plan is to start at one vertex and expand with BFS until I cover an entire one of these components. For every u in the component, u.color = black. Then, I go back and cover the component again with BFS, this time finding all the edges that connect to vertices that are not colored black, therefore not contained within the component, and crossing the existing cut. The vertices opposite of these edges are placed in a Queue R. Once I am done, I u = RemoveMin(R), which is runs O(lgE). Since it will only be called every time I cover a component, it will run overall at a max of 10*O(lgE), which is still O(lgE). So once I remove u, I perform BFS on the new component, so that all u.color = black in that component. I go through all the black vertices again so that I may queue all the white vertices with updated keys into R. I do u = RemoveMin(R).
So I really think that this works and is proveable. Can anyone suggest something similar?
Any help, however small, would be appreciado.

Dominating Set Greedy Approximation Worst-Case Example

To find a minimum Dominating Set of an undirected Graph G you can use a greedy algorithm like this:
Start with an empty set D. Until D is a dominating Set, add a vertex v with maximum number of uncovered neighbours.
The algorithm generally does not find the optimal solution, it is a ln(Delta)-approximation. (If Delta is the maximum degree of a vertex in G)
Now I am looking for a simple example where the greedy algorithm does not find the optimal solution. The only one I found is a related instance of the set cover problem. (http://en.wikipedia.org/wiki/Set_cover_problem#Greedy_algorithm picture on the right)
Translating this one to a graph would cause a minimum of 14 vertices and a lot of edges.
Does anyone know a small example?
Thanks in advance
Consider the following graph:
A greedy approach will choose B then D and G. Meanwhile, E and F form a dominating set.

Resources