Ice Cream : NP-complete problem

  • Context: MHB 
  • Thread starter Thread starter mathmari
  • Start date Start date
  • Tags Tags
    Ice
Click For Summary

Discussion Overview

The discussion revolves around the complexity of a problem related to selecting ice cream cups in a shop, framed as an NP-complete problem. Participants explore the relationship between this problem and the Vertex Cover problem, discussing the implications of their proposed reductions and the definitions involved.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant proposes that the problem involves selecting $k$ cups from $n$ available cups, each containing various ice cream flavors, to ensure all $m$ flavors are included.
  • Another participant questions the clarity of the problem description, specifically regarding the terminology used for "card" and "cups," and seeks clarification on whether cups can contain multiple flavors.
  • Clarifications are provided regarding the terminology, confirming that "card" refers to the menu and that cups can contain several flavors.
  • Participants discuss the proof structure for showing the problem is NP-complete, including the need to demonstrate it is in NP and the reduction from the Vertex Cover problem.
  • Concerns are raised about the accuracy of statements regarding polynomial time checks and the relationship between cups and flavors in the context of the reduction.
  • One participant suggests that the time complexity for checking the flavors is not necessarily $m$, prompting further inquiry into the reasoning behind this assertion.
  • There is a discussion about the validity of the conjecture that no polynomial-time algorithm exists for the Vertex Cover problem, with some participants noting that this remains unproven.

Areas of Agreement / Disagreement

Participants express varying levels of understanding and agreement regarding the problem's formulation and the proof structure. There is no consensus on the correctness of the proposed proof or the implications of the conjectures discussed.

Contextual Notes

Participants highlight potential ambiguities in the problem description and the need for precise definitions. There are unresolved questions about the time complexity of the Turing Machine's operations and the implications of the conjecture regarding the Vertex Cover problem.

mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hey! :o

An ice cream shop has $m$ kinds of ice creams $s_1, \dots , s_m$. On the card there are $n$ cups $b_1, \dots , b_n$. Each cup contains some of the ice cream kinds. The budget of Gina suffices for $k$ cups. Gina wants to choose $k$ cups so that each of the $m$ ice cream kinds are occurred. I want to show that Gina has a NP-complete problem.
I have to use reduction of Vertex Cover.

The Vertex Cover problem asks if for a graph $G= (V, E)$ and a $k$ there is a subset $C\subseteq V$ such that for each edge $(u,v)\in E$ it holds that $u\in C$ or $v\in C$.

To reduce the Vertex Cover to the above problem do we see the vertices as the cups and the edges as the ice cream kinds? (Wondering)
 
Physics news on Phys.org
mathmari said:
An ice cream shop has $m$ kinds of ice creams $s_1, \dots , s_m$. On the card there are $n$ cups $b_1, \dots , b_n$.
What card?

mathmari said:
Each cup contains some of the ice cream kinds.
So a cup may contain several ice cream kinds (flavors)?

I am not sure I understand the description.
 
Evgeny.Makarov said:
What card?

So a cup may contain several ice cream kinds (flavors)?

I am not sure I understand the description.

Yes, with kinds I mean flavors and with card I mean the menu. (Blush)

So, it is as follows:
An ice cream shop has $m$ flavors of ice creams $s_1, \dots , s_m$. On the menu there are $n$ cups $b_1, \dots , b_n$. Each cup contains several ice cream flavors. The budget of Gina suffices for $k$ cups. Gina wants to choose $k$ cups so that each of the $m$ ice cream flavors exists. I want to show that Gina has a NP-complete problem.
 
mathmari said:
To reduce the Vertex Cover to the above problem do we see the vertices as the cups and the edges as the ice cream kinds?
Yes.
 
Is the whole proof the following?

First of all, we have to show that the problem is in NP. A non-deterministic Turing Machine guesses $k$ cups and then it checks if each of the $m$ ice cream flavors exists. The Turing Machine needs polynomial time for that, and especially time $m$.

Then to show that the problem is NP-hard we reduce the Vertex Cover Problem to the above one.
We see the vertices as the cups and the edges as the ice cream flavors. Therefore, there is a subset $B$ of the set of the cups such that for each flavor $s_i$ it holds that $s_i\in B$ iff there is a subset $C\subseteq V$ such that for each edge $(u,v)\in E$ it holds that $u\in C$ or $v\in C$.
That means that the above problem has a solution iff the Vertex Cover Problem has a solution.
Since there is no algorithm that solves the Vertex Cover Problem in polynomial time, i.e. the Vertex Cover Problem is NP-complete, we conclude that the ice cream problem is also NP-complete.

Is everything correct? Could I improve something? (Wondering)
 
mathmari said:
First of all, we have to show that the problem is in NP. A non-deterministic Turing Machine guesses $k$ cups and then it checks if each of the $m$ ice cream flavors exists.
Better: "...checks if they contain all $m$ flavors".

mathmari said:
The Turing Machine needs polynomial time for that, and especially time $m$.
It's unlikely the time is precisely $m$.

mathmari said:
Then to show that the problem is NP-hard we reduce the Vertex Cover Problem to the above one.
We see the vertices as the cups and the edges as the ice cream flavors. Therefore, there is a subset $B$ of the set of the cups such that for each flavor $s_i$ it holds that $s_i\in B$ iff ...
$B$ is a set of vertices and $s_i$ is an edge. It's a type error to say that $s_i\in B$.

mathmari said:
there is a subset $C\subseteq V$ such that for each edge $(u,v)\in E$ it holds that $u\in C$ or $v\in C$.
This is the first time $V$ and $E$ are used.

mathmari said:
Since there is no algorithm that solves the Vertex Cover Problem in polynomial time
This conjecture is still unproved.
 
First of all, we have to show that the problem is in NP. A non-deterministic Turing Machine guesses $k$ cups and then it checks if they contain all $m$ flavors. The Turing Machine needs polynomial time for that.
Why is the time not $m$ ? (Wondering)

Then to show that the problem is NP-hard we reduce the Vertex Cover Problem to the above one.
We see the vertices as the cups and the edges as the ice cream flavors.
Therefore, there is a subset $B$ of the set of the cups such that each flavor $s_i$ is in one cup of $B$ iff there is a subset of the set of vertices $C\subseteq V$ such that for each edge $(u,v)\in E$, where $E$ the set of edges, it holds that $u\in C$ or $v\in C$.
That means that the above problem has a solution iff the Vertex Cover Problem has a solution.
Since there is no algorithm that solves the Vertex Cover Problem in polynomial time, i.e. the Vertex Cover Problem is NP-complete, we conclude that the ice cream problem is also NP-complete.

Evgeny.Makarov said:
This conjecture is still unproved.

What do you mean? (Wondering)
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
3
Views
9K