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
0 answers
Finding the Big-O Complexity of a Randomized Search + Simulated Annealing Algorithm for solving a Movie Scenes Scheduling Problem
I have developed an algorithm that combines randomized search and Simulated Annealing for solving the Movie Scenes Scheduling problem, a problem that consists of proposing the best shooting sequence for minimizing the costs (actor wages per take),…

Lucas Lafranconi
- 11
- 5
1
vote
1 answer
When asked if two graphs are the same, is the problem P, NP, NP-hard, NP-complete?
I was given a question where two graphs are given and the questions asks if the two graphs are the same and whether the problem was a P, NP, NP-hard or NP-complete. By looking at the two graph, the graphs are not the same. However, I don't know what…

heyy_blue
- 31
- 2
1
vote
0 answers
Every np-complete problem reduces to the Halting problem. Is this true?
I guess that every np-complete problem reduces to the np-hard problem, so the given statement is true. But don't know how to prove it.

Romil
- 55
- 3
1
vote
1 answer
Is Shortest Hamiltonian path NP-hard?
Hamiltonian Path is a path that connects all nodes without repeat and it is an NP-complete problem.
Is the Shortest Hamiltonian Path (SHP) NP-hard?
What is the difference between travelling salesman problem with SHP?

Dr.PB
- 959
- 1
- 13
- 34
1
vote
0 answers
The Subset Sum Problem: Input: a finite subset S of integers, and an integer t
The Subset Sum Problem: Input: a finite subset S of integers, and an integer t. Question:
does there exist a subset A ⊆ S such that the members of A sum to t? Suppose you have access
to an oracle that answers queries about instances of Subset Sum.…

Joy
- 11
- 1
1
vote
1 answer
When L2 is NP complete, and L1 can be reduced to L2
If L2 is NP complete and L1 ≤p L2, I can see that L1 is NP at any time. And I believe L1 could possibly be NP hard (though not all the time). Now my question is, it seems like at some cases NP hard are reducible to NP. I'm just not sure if my…

HeyMate
- 303
- 1
- 6
- 18
1
vote
0 answers
Assign people to optimal groups given preferences of who each person wants to be in a group with
Create groups of size 6 given 100 individuals, each of whom has specified their top 10 other people they would desire to be in a group with.
Ideally I would like to do this in Python.
I have looked around online and encountered terms I wasn't aware…

yt2008
- 11
- 1
1
vote
1 answer
NP-complete vs NP-hard (why are they unequal?)
Why is NP-hard unequal to NP-complete?
My informal understanding of definitions being used:
NP - all problems that can be verified in polynomial time
NP-complete - all problems that are NP and NP-hard
NP-hard - at least as hard as the hardest…

NickHZ
- 25
- 2
- 5
1
vote
0 answers
Create two sub-lists from given list of integers with equal sum and maximize this sum
You are given a list S of positive integers. You are to create two sub-lists S1 and S2 taking elements from S, such that
sum of S1 is equal to sum of S2
maximize this sum and output it
no need to put all elements of S into S1 or S2, you can ignore…

Sushil Verma
- 659
- 9
- 23
1
vote
1 answer
DCOS cluster resource allocation is np-hard
Here in the DCOS documents it is stated that
"Deciding where to run processes to best utilize cluster resources is
hard, NP-hard in-fact."
I don't deny that that sounds right, but is there a proof somewhere?

nobody
- 7,803
- 11
- 56
- 91
1
vote
2 answers
If Y is reducible to X in polynomial time, then how is it true that X is at least as hard as Y?
I am having difficulty understanding the relationship between the complexity of two classes of problems, say NP-hard and NP-complete problems.
The answer at https://stackoverflow.com/a/1857342/ states:
NP Hard
Intuitively, these are the problems…

Lone Learner
- 18,088
- 20
- 102
- 200
1
vote
2 answers
Interesting variation to the subset sum problem
An interesting variation of the subset sum problem was presented to me by a friend from work:
Given a set S of positive integers, of size n, and integers a and K, is there a subset R (of the set S) that contains exactly a elements, whose sum is…

ntsue
- 2,325
- 8
- 34
- 53
1
vote
1 answer
NP-complete or NP-hard?
Given a list of n positive integers (n even), divide the list into two sublists such that the difference between the sums of the integers in the two sublists is minimized. Would this be a NP-complete problem or a NP-hard problem?

ACE
- 41
- 1
1
vote
2 answers
Proving NP-Completeness
Given m shortest paths between any two vertices of a graph. Determining whether we can pick k shortest paths such that their union covers all edges.
I am sure that reduction has to be from set cover but I am not getting a way how to reduce it to…

sv_jan5
- 1,543
- 16
- 42
1
vote
1 answer
Is an NP-complete pr0blem also an NP-hard?
We can say that an NP-complete problem is one which is in NP and in NP-hard, but can we argue exclusively that a problem is NP-hard solely due to the fact that it is NP-complete.
Example: I reduce an NP-complete problem a to a problem b. Therefore,…

bibliobibuli
- 13
- 2