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.

161 questions
1203
votes
11 answers

What are the differences between NP, NP-Complete and NP-Hard?

What are the differences between NP, NP-Complete and NP-Hard? I am aware of many resources all over the web. I'd like to read your explanations, and the reason is they might be different from what's out there, or there is something that I'm not…
DarthVader
  • 46,241
  • 67
  • 190
  • 289
60
votes
7 answers

Parabolic knapsack

Lets say I have a parabola. Now I also have a bunch of sticks that are all of the same width (yes my drawing skills are amazing!). How can I stack these sticks within the parabola such that I am minimizing the space it uses as much as possible? I…
rook
  • 62,960
  • 36
  • 149
  • 231
38
votes
6 answers

3 dimensional bin packing algorithms

I'm faced with a 3 dimensional bin packing problem and am currently conducting some preliminary research as to which algorithms/heuristics are currently yielding the best results. Since the problem is NP hard I do not expect to find the optimal…
37
votes
2 answers

What is the problem name for Traveling salesman problem(TSP) without considering going back to starting point?

I would like to know what is the problem name for TSP w/o considering the way of going back to starting point and what is the algorithm to solve this. I looked into Shortest path problem but that is not what I am looking for, the problem only find…
A-letubby
  • 6,440
  • 8
  • 34
  • 46
29
votes
12 answers

Teacher time schedule algorithm

This is a problem I've had on my mind for a long time. Being the son of a teacher and a programmer, it occurred to me early on... but I still haven't found a solution for it. So this is the problem. One needs to create a time schedule for a school,…
Sklivvz
  • 28,698
  • 24
  • 111
  • 164
23
votes
14 answers

Have you used a traveling salesman algorithm to solve a problem?

I studied TSP in college in the context of NP Completeness. I have never actually had a situation where it would apply to a practical problem. A little bit of research shows that it has been used to pick the cheapest path to move a drill…
EvilTeach
  • 26,577
  • 21
  • 79
  • 136
20
votes
2 answers

Minimum number of flips to get adjacent 1's in a matrix

Given a binary matrix (values of 0 or 1), adjacent entries of 1 denote “hills”. Also, given some number k, find the minimum number of 0's you need to “flip” to 1 in order to form a hill of at least size k. Edit: For clarification, adjacent means…
The Monkey
  • 262
  • 1
  • 9
18
votes
14 answers

I need high performance. Will there be a difference if I use C or C++?

I need to write a program (a project for university) that solves (approx) an NP-hard problem. It is a variation of Linear ordering problems. In general, I will have very large inputs (as Graphs) and will try to find the best solution (based on a…
Itsik
  • 3,812
  • 23
  • 37
16
votes
3 answers

Relationship between NP-hard and undecidable problems

Am a bit confused about the relationship between undecidable problems and NP hard problems. Whether NP hard problems are a subset of undecidable problems, or are they just the same and equal, or is it that they are not comparable? For me, I have…
akaHuman
  • 1,262
  • 12
  • 33
11
votes
3 answers

largest possible rectangle of letters

Write a program to find the largest possible rectangle of letters such that every row forms a word (left to right) and every column forms a word (top to bottom). I found this interesting question. It's not homework, though it may sound as such.…
Adrian
  • 5,416
  • 7
  • 45
  • 78
10
votes
4 answers

NP-Hard? Algorithmic complexity of online poker collusion detection?

What's the best way to describe the algorithmic complexity of collusion detection for a ten-million-player online poker site? Assume (I don't think these assumptions make much difference so feel free to ignore them, but just to clarify): That the…
user2189331
10
votes
5 answers

What are the "hardest" problems using polynomial time?

Recently I read a seminar work which says: The matching algorithm [for general graphs] can be extended to the weighted case, which appears to be one of the "hardest" combinatorial optimization problems that can be solved in polynomial time.…
Karussell
  • 16,303
  • 14
  • 88
  • 188
9
votes
2 answers

max-weight k-clique in a complete k-partite graph

My Problem Whether there's an efficient algorithm to find a max-weight (or min-weight) k-clique in a complete k-partite graph (a graph in which vertices are adjacent if and only if they belong to different partite sets according to wikipedia)? More…
linusz
  • 691
  • 1
  • 12
  • 24
8
votes
7 answers

How to find what numbers in a set add up to another given number?

Here's a problem that I seem to be running into working with an accounting system. I have a set of transactions, but their sum does not equal the amount that the accounting department thinks that it should. They are not questioning the math, just…
Even Mien
  • 39,111
  • 41
  • 111
  • 117
7
votes
1 answer

List of problems that are in general NP-hard but have polynomial-time solution in planar graphs?

I encountered many problems that can be formulated as graph problem. It is in general NP-hard but sometimes the graph can be proved to be planar. Hence, I am interested in learning these problems and the algorithms. So far as I know: Max cut in…
Ivan Xiao
  • 1,838
  • 3
  • 19
  • 29
1
2 3
10 11