what is the cardinality of minimum vertex cover in the complete graph? - algorithm

I have a complete graph with n vertex. The MinimumVertexCover of the complete graph is n-1.Can I take less then n-1 as a MinimumVertexCover? If the answer is No please Explain it with the proof?

The answer is No.
I think the easiest way to prove it is by Gallai’s result. Recall that an independent set of vertices is one in which two vertices share an edge. Now Gallai’s theorem says that:
α(G)+β(G)=n
where,
α(G)=
size of largest independent set,
β(G)=size of minimum vertex cover, and
n=
number of vertices in G.
Now clearly α(Kn)=1
since a set of two vertices in Kn is not independent. It follows therefore that β(G)=n−1, as required.

Related

Variation on the minimum clique cover problem (NP Hard)

I have a variation of the NP-hard minimum clique cover problem. My problem reduces to that problem, so is also NP-hard.
We have n sets of vertices. Each set has between 1 and k vertices. Let's assume that n is at most 210 and k is at most 10.
There are edges between some but not all pairs of vertices that belong to different sets, and no edges between vertices in the same set. I don't yet know how likely any given pair of vertices in different sets is to have an edge between them, but we can assume many but not all of these potential edges exist.
We need to find the minimum collection of cliques such that each of our n sets of vertices has a vertex in at least one clique. Assuming this is effectively impossible given the NP-hard nature of the problem and the size of n and k, can we find a reasonable approximation?
For clarity, I expect that exactly one vertex from each set will be in the solution, and that we'll have either the minimum number of cliques that covers that set, or some approximation of it.
My best idea so far is to pick n vertices that form a relatively dense graph, and then apply existing techniques for minimum clique covers/approximations to that. I could pick the vertices by greedily choosing the highest degree in succession, where for latter picks I exclude edges to vertices that have been eliminated because some other vertex in the same set has been chosen.

Size of Special Vertex Set on DAG

In Singapore, this year's (2016) NOI (National Olympiad in Informatics) included the following problem "ROCKCLIMBING" (I was unable to solve it during the contest.) :
Abridged Problem Statement
Given a DAG with N <= 500 vertices, find the maximum number of vertices in a subset of the original vertices such that there is no path from 1 vertex in the set to another vertex in the same set, directly or indirectly.
Solution
The solution was to use transitive closure algorithm, and then to form a bipartite graph by duplicating each vertex i to form i' such that if vertex j can be reached from vertex i directly or indirectly in the original graph, then there is a directed edge from i to j' in the new graph.
However, during the solution presentation, the presenters did not explain how or why N - MCBM (MCBM being the Maximum Cardinality Bipartite Matching) of the new bipartite graph is also the maximum size of the set of vertices that cannot reach each other directly or indirectly in the original DAG.
I looked up other problems related to DAGs and bipartite graphs, such as the Minimum Path Cover problem on DAGs, but I could not find anything that explains this.
Does anyone know a way in which to prove this equality?
The problem statement can be found here: ROCKCLIMBING
Thank you in advance.
There are two things going on here:
A set is independent if and only if its complement is a vertex cover (see wikipedia). This means that the size of a max independent set is equal to the size of a minimum vertex cover.
Konig's theorem proves that
In any bipartite graph, the number of edges in a maximum matching equals the number of vertices in a minimum vertex cover.
Therefore to find the size of the max independent set we first compute the size MCBM of the max matching, and then compute its complement which equals N-MCBM.
An alternative viewpoint is as follows:
If we use A<B to mean we can climb from A to B, we have defined a partially ordered set
There is a result called Dilworth's theorem that says the maximum number of incomparable elements is equal to the minimum number of chains
The proof shows how to construct the minimum number of chains by constructing a maximum matching in your bipartite graph.

How can we prove there will be at least a vertex with in-degree of zero in Directed Acyclic graph?

I can see the hypothesis true intuitively but, mathematically I am not able to prove. Any help would be appreciated.
Let this graph have n vertices.
Suppose we reverse all the edges, then we are trying to prove there is a vertex with an out-degree of zero.
If not, then simply start anywhere and travel along n edges (always possible as every vertex as non-zero out-degree). Therefore we have visited n+1 vertices - so at least 2 of them must be the same (pigeon hole principle), and therefore we have found a cycle in your acyclic graph.

Partially coloring a graph with 1 color

I just started reading graph theory and was reading about graph coloring. This problem popped in my mind:
We have to color our undirected graph(not completely) with only 1 color so that number of colored nodes are maximized. We need to find this maximum number. I was able to formulate an approach for non cyclic graphs :
My approach : First we divide graph into isolated components and do this for each component. We make a dfs tree and make 2 dp arrays while traversing it so that root comes last :
dp[0][u]=sum(dp[1][visited children])
dp[1][u]=sum(dp[0][visited children])
ans=max(dp[1][root],dp[0][root])
dp[0][i] , dp[1][i] are initialized to 0,1 respectively.
Here 0 signifies uncolored and 1 signifies colored.
But this does not work for cyclic graphs as I have assumed that no visited children are connected.
Can someone guide me in the right direction on how to solve this problem for cyclic graphs(not by brute force)? Is it possible to modify my approach or do we need to come up with a different approach? Would a greedy approach like coloring a nodes with least edges work?
This problem is NP-Hard as well, and is known as maximum independent set problem.
A set S<=V is said to be Independent Set in a graph if for each two vertices u,v in S, there is no edge (u,v).
The maximum size of S (which is the number you are seeking) is called the independence number of the graph, and unfortunately finding it is NP-Hard.
So, unless P=NP, your algorithm fails for general purposes graphs.
Proving it is fairly simple, given a graph G=(V,E), create the complementary graph G'=(V,E') where (u,v) is in E' if and only if (u,v) is NOT in E.
Now, given a graph G, there is a clique of size k if and only if there is an independent set of size k in G', using the same vertices (since if (u,v) are two vertices the independent set, there is no edge (u,v) in E', and by definition there is an edge in E. Repeat for all vertices in the independent set, and you got a clique in G).
Since clique problem is NP-Hard, this makes this one such as well.

Graph theory questions from my Algorithms quiz today that I'd like help understanding

Today I had my algorithms quiz for the semester and I can't figure out these two questions and they've been bugging me all day. I've gone through my notes and the lecture notes and I'm still unsure. I would appreciate it if someone could take a look and provide some insight into these questions. These are not homework and I've already sat the quiz.
True or False questions
1) [Paraphrased] The maximum number of edges in a bipartite graph with n vertices is n(n-1)/2.
I put this down as False, my logic is that n verticies means we have two n/2 rows. The first node has n/2 connections to the second row, the second row has n/2 connections to the second row... etc...
Hence, I calculated the maximum number of edges in a bipartite graph with n vertices to be (n^2/4).
2) [Paraphrased] Is it possible to take a cut, that is not necessarily the minimum s-t cut in a graph with directed flows (Ford–Fulkerson algorithm) such that the flow capacity is greater than the s-t cut capacity?
I put down false, but I don't understand the question... Is it possible to take an s-t cut such that the flow capacity is greater? I know the weak duality theorem and 'max flow = min cut' so I put down false, but I have no idea.
Short answer question:
1) Explain an efficient way to test weather a graph is connected.
I suggested doing a breadth first search and if there were nodes that were not found by the BFS algorithm in the graph, then it was not connected. I wrote down the running time was O(m+n) hence it was an efficient algorithm to use. It was worth two marks and it was the final question but I'm now worried it was a trick question.
2) In the graph:
List the sets of vertices which demonstrate minimum vertex cover [paraphrased]
My answer was {A, D}, {A, E}, {B, C}, {B, D}, {C, E}, but now I'm worried it was just {A}, {B}, {C}, {D}, {E}...
Thanks for taking the time to read! :)
I only have the answer to the first graph right now, but you are correct.
In a bipartite graph, there have to be two sets of nodes - say x in the first group and (n - x) in the second.
The maximum number of edges in this graph will then be x(n-x), or nx - x^2.
The maximum value of nx - x^2 is x = (n/2)
So the maximum number of edges in the graph is (n/2) * (n - (n/2)) = (n^2)/4, as you pointed out.
Graph Connectivity:
You are right about using BFS. After one iteration of BFS, if all the nodes are visited then we can conclude that the graph is connected.
Alternatively, this can be also done using DFS. Approach remains the same.
1) has been answered, and I agree that you were right.
2): The question seems ambiguous as stated.
such that the flow capacity is greater than the s-t cut capacity
the flow capacity of what? of the whole network? or of the cut?
If the latter, it seems to be asking can A > A, which is obviously false.
If the former, again it's clear that the answer is false. If it were possible to find such a cut, then max-flow=min-cut would not be true: the max flow of the network would be greater than the minimum capacity of an s-t cut.
However it is possible to take a cut such that the flow capacity of the cut is greater than the minimum s-t cut capacity of the network. You don't suppose that's what they meant? For example, in the example at the top of this article, if you cut between s and the rest of the network, the capacity of the cut is greater than the minimum s-t cut capacity of the network.
But even that interpretation seems unlikely because it's pretty trivial... the implication of a "minimum" is that there may be greater values.
Maybe it would help to see the exact original wording.
Short answer:
1) has been answered, although I don't understand what m is (in O(m+n)), unless you're talking about a bipartite graph?
2) I agree with #glebm that you got it wrong... sorry. "Vertex cover of a graph is a set of vertices", but you seem to have written a list of edges? followed by a list of singleton sets of vertices?
Vertex cover of a graph is a set
of vertices such that each edge of the
graph is incident to at least one
vertex of the set.
Since this is a complete graph, all vertices are interchangeable. So we don't really care which vertices, but only how many vertices we need in order to touch all the edges. The answer is not hard to find. If we pick any three vertices, the edge connecting the other two vertices is not "covered". QED.
In fact we can prove that for any complete graph of n vertices, the minimum vertex cover requires n-1 vertices.

Resources