NP-hard problems (Non-deterministic Polynomial-time hard problems) are those problems which are not easier than any problem in NP; in other words, an algorithm for an NP-hard problem can be used to solve any problem in NP by transforming the input in polynomial time. Problems which are in both NP-Hard and NP are known as NP-Complete.
Questions tagged [np-hard]
178 questions
1
vote
2 answers
How to solve crossword (NP-Hard)?
I am currently doing an assignment and I'm stuck with the approach.
I have a crossword problem which consists of an empty grid (no solid square as a conventional crossword would), with a varied width and height between 4 and 400 (inclusive).
Rules:…
user4679552
1
vote
3 answers
A packing algorithm ... kind of
Given an array of items, each of which has a value and cost, what's the best algorithm determine the items required to reach a minimum value at the minimum cost? eg:
Item: Value -> Cost
-------------------
A 20 -> 11
B 7 -> 5
C 1 …

nickf
- 537,072
- 198
- 649
- 721
1
vote
1 answer
How Tabu Search is used to solve Travelling Purchaser
It is very often to see that Tabu Search is used to solve the travelling purchaser / travelling salesman, I would like to look into it but always cant figure out the progression and the stop condition, can anyone do a explanation on how this can be…

user2534365
- 215
- 1
- 2
- 10
1
vote
3 answers
How to find the cheapest combinations from a number of products
I am given with a certain table
Stores
[A][B][C]
Products
[P1][P2][P3][P4]
And their prices are listed as below
[ ][A][B][C]
[P1][6][4][2]
[P2][3][5][7]
[P3][1][9][9]
[P4][8][4][9]
Assume the user want to buy all of the things in 2 stores as…

user2534365
- 215
- 1
- 2
- 10
1
vote
2 answers
Build a ranking from a series of transitive relationships that can be noisy, inconsistent, or incomplete
I have a list of ~1000 different assets that I would like to rank by value for a game that I am making.
Players are given the opportunity to select one of two baskets of assets. For instance, they might be asked if they would rather have A + B or…

John Shedletsky
- 7,110
- 12
- 38
- 63
1
vote
1 answer
np-complete and turing reductions
I have some difficulties with a complexity proof :
I work with 3 problems : A, B and C
I know :
A-> B
A-> C
C -> B
A-> B meaning : if I have a "yes answer " for A , then I have a "yes answer" for B.
I know that A belongs to NP,
B and C are…

Gaëlle Hisler
- 21
- 2
1
vote
1 answer
NP Hard Longest Path Acyclic Modified
I got stuck with this problem since the whole day.
When we are finding the longest path in a graph we first do topological sorting and then check the path of adjacent vertices and keep upgrading selecting the maximum of the edge weight or the…
user4058730
1
vote
1 answer
Some inference about NP
this is my first question on this site.
I recently, study on NP. I have some confusion about this Topic, and want to propose my inference and some one verify me.
I) each NP problem can be solved in Exponential Time.
II) if P=NP then…
user4672610
1
vote
1 answer
greedy algorithm for set cover c++
Minimum Set Cover is a question where you must find the minimum number of sets needed to cover every element.
For example, imagine that we have a set of X=array(1,2,3,4,5,6) and 5 another set S, where
S[1] = array(1, 4)
S[2] = array(2, 5) …
user3087559
1
vote
1 answer
Proving approximation for TSP-metric
I got stuck with the following question:
Consider the following heuristic: Start with a tour containing only one vertex. At each step, find the vertex outside the tour with the lesser distance to some vertex of the tour. Let v be the outter vertex…

gcolucci
- 438
- 1
- 5
- 21
1
vote
2 answers
Understanding Polynomial TIme Approximation Scheme
Is an approximation algorithm the same as a Polynomial Time Approximation Algorithm (PTAS)? E.g. It can be shown that A(I) <= 2 * OPT(I) for vertex cover. Does it mean that Vertex Cover has a 2-polynomial time approximation algorithm or a…

acc_so
- 175
- 1
- 1
- 12
1
vote
3 answers
Decision problems that can't even be decided efficiently?
How does these problems fall into the tapestry of the P, NP, NP-Hard, etc... sets? I don't know if any such problems even exists, but what initiated my thought process was thinking of a decidable of the travelling salesman problem:
Given a list…

theQman
- 1,690
- 6
- 29
- 52
1
vote
1 answer
Given a collection of consumers competing for a limited resource, allocate that resource to maximize it's applicability
Sorry the question title isn't very clear, this is a challenging question to ask without providing a more concrete example. Consider the following scenario:
I have a number of friends whose birthdays are coming up on dates (d1..dn), and I've managed…

Evan Senter
- 247
- 1
- 10
1
vote
3 answers
Why Is vertex coloring NP-hard?
I am reading up on vertex coloring algorithm. I see documents explaining how the problem can be solved using BFS (implying the problem can be solved in O(|V|+|E|). But I also see it mentioned that this is an NP-hard problem.
How do these two fit…

Aadith Ramia
- 10,005
- 19
- 67
- 86
1
vote
2 answers
How can some NP-Complete problems be also NP-Hard?
I'm trying wrap my heard around P, NP, NP-Complete and NP-Hard in an intuitive way so that I don't have to remember their definitions.
In the following image (the left hand scenario, P != NP), there's an overlapping area between NP-Complete and…

Srikanth
- 11,780
- 23
- 72
- 92