Questions tagged [np-hard]

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.

178 questions
2
votes
1 answer

Shortest Path from Node A to B by going through all other Nodes (NP-Hard?)

My problem: Find the shortest path from node A to node B that passes through all other nodes of the unweighted, direct graph. I know that there exists such a path. I believe this is NP-Hard, but I can't explain it. My Prof. likes to have the…
EvenDance
  • 83
  • 1
  • 1
  • 9
2
votes
3 answers

who knows algorithm about stones and backpack?

maybe somebody knows algorithm, or just what name it has, for putting stones (different weight) into different size backpacks? I should do it in Prolog. I give weights of stones and capacities of backpacks. Program should give me an answer how can I…
Mario
  • 335
  • 7
  • 20
2
votes
1 answer

Is it NP complete?

A decision problem: For a given graph G and numbers 'a','b' it is required to be answered whether there is a set of 'a' vertices which have a cumulative neighborhood of size at least 'b'. How do we show that this problem is NPC?
2
votes
2 answers

Is it possible to have a DecisionProblme in NP but not in NPC and NPH?

I just started learning Complexity theory. And I am searching from the last four five days, only one thing. Is there any problem which is in NP but not a NPC and NPH. Look in this diagram (Considered P is not equal to NP). Ther is space outside of…
2
votes
2 answers

np-complete but not "hard"

Is there some language that is NP-complete but for which we know some "quick" algorithm? I don't mean like the ones for knapsack where we can do well on average, I mean that even in the worst case the runtime is something like 2^n^epsilon, where…
lisa
  • 21
  • 1
2
votes
1 answer

Deterministic Annealing Code

I would like to find an open source example of a code for deterministic annealing. It can be in almost any language: C, C++, MatLab/Octave, Fortran. I have already found a MatLab code for simulated annealing, so MatLab would be best. Here is a paper…
wade
  • 21
  • 2
2
votes
1 answer

NP-Hardness proof for constrained scheduling with staircase cost

I am working on a problem that appears like a variant of the assignment problem. There are tasks that need to be assigned to servers. The sum of costs over servers needs to be minimized. The following conditions hold: Each task has a unit size. A…
2
votes
3 answers

Where to find a set of hard Traveling Salesman Problems (with known solutions/approximations)?

I want to try my hand at finding heuristics/approximations for solving the Traveling Salesman Problem, and in order to do that, I'm looking for some "hard" TSP instances (along with their best known solutions) so that I can try solving them and see…
user541686
  • 205,094
  • 128
  • 528
  • 886
2
votes
0 answers

Is this NP-Complete

My problem is similar to the problem here https://cs.stackexchange.com/questions/2244/need-a-np-complete-proof-on-an-example , but it is a little different. Here is my problem: There are three islands, A, B and C, and a lot of fan-shaped rafts. We…
wzb5210
  • 735
  • 2
  • 9
  • 16
1
vote
1 answer

Pick subset of items minimizing the count of the most frequent of the selected item's labels

Problem I want to pick a subset of fixed size from a list of items such that the count of the most frequent occurrence of the labels of the selected items is minimized. In English, I have a DataFrame consisting of a list of 10000 items, generated…
Everyone_Else
  • 3,206
  • 4
  • 32
  • 55
1
vote
0 answers

Is there an optimization problem that is NP-Complete?

Is there such a thing as an NP-complete optimization (not decision) problem? What is an example of an NP-complete optimization problem? The decision versions of optimization problems are the ones in NP-complete. I can't think of any NP-hard…
terra
  • 11
  • 1
1
vote
1 answer

Strategy for reducing CNF-SAT to this problem

Suppose there is a satisfiability problem (call it oscillating-CNF) where the input is a list of CNF clauses and we want to show that this problem is indeed NP-complete (by reducing CNF-SAT to oscillating-CNF). A satisfied oscillating-CNF instance…
Danny Agir
  • 13
  • 3
1
vote
1 answer

NP-hardness. Is it average case or worst-case?

Do we measure the NP-hardness in terms of average-case hardness or worst-case hardness? I've found this here: "However, NP-completeness is defined in terms of worst-case complexity". Does it remain true to NP-hardness? I don't know what the term…
C.S.
  • 105
  • 4
1
vote
0 answers

how to show movie problem is also a NP hard Problem

I am working on an NP hard problem, here is the problem: " We need to either watch the movie or speak to friend and hear their recommendations about the movie. We only have t hours. " For this I need to design a polynomial-time algorithm for…
sow
  • 11
  • 1
1
vote
0 answers

Does solving a NP-hard problem in polynomial time make it NP-complete?

I am trying to understand the process so that P = NP. Consider a problem L which is reducible to a problem that is NP-Complete, meaning L is NP-hard. Now, if we solve L in polynomial time, will it be NP-complete? Making P = NP to be true. Am I…