Questions tagged [np]

NP ("nondeterministic polynomial") is a complexity class of decision problems that can be solved by a nondeterministic Turing machine in polynomial time. Equivalently, it is the set of decision problems for which an answer can be verified in polynomial time by a deterministic Turing machine.

NP (nondeterministic polynomial-time) is a complexity class of decision problems that can be solved by a nondeterministic Turing machine in polynomial time. Equivalently, it is the set of decision problems for which an answer can be verified in polynomial time by a deterministic Turing machine.

For example:

  • 3-Colorability: Given a graph, can each vertex be colored red, green, or blue so that no two neighboring vertices have the same color?
  • Hamiltonian Cycle: Given a graph, is there a cycle that visits each vertex exactly once?
  • Traveling Salesperson: Given a set of n cities, and the distance between each pair of cities, is there a route that visits each city exactly once before returning to the starting city, and has length at most T?
  • Maximum Clique: Given a graph, are there k vertices all of which are neighbors of each other?
  • Subset Sum: Given a collection of integers, is there a subset of the integers that sums to exactly

References

492 questions
0
votes
1 answer

Is Computationally-hard is same as NP-hard?

I want to know that is there any difference between NP- hard problems and Computationally hard problems or are these two terms used for the same thing? I have tried to search the solution but cannot get some reasonable answer. Can anybody please…
0
votes
1 answer

Is this brute-force algorithm NP-hard?

Here's a brute-force algorithm we're using in a project management system for extracting keywords from abstracts. What is the time complexity of that brute force algorithm? Is it NP-hard, NP-complete, in NP, or in P? This is the algorithm: public…
poo
  • 1
  • 1
0
votes
4 answers

Shortest cost path

I have to find the shortest path from point D to R. These are fixed points. This is an example of a situation: The box also contains walls, through which you cannot pass across them, unless you break them. Each wall break costs you, let's say "a"…
Robert Lucian Chiriac
  • 686
  • 2
  • 15
  • 24
0
votes
1 answer

Find representative vertices in a graph

For some project in computer vision I have N points in high-dimensional space. I want to select k of them that will be "the most distinguishable" from each other. For example, it can translate to sum of distances between chosen points is maximum.…
Sergey Ivanov
  • 3,719
  • 7
  • 34
  • 59
0
votes
1 answer

Is 3-SAT polynomially equivalent to INDEPENDENT-SET

I know that 3-SAT is polynomially reducable to INDEPENDENT-SET problem. Now is an INDEPENDENT-SET problem polynomially reducable to 3-SAT problem ? Thus are these problems polynomially equivalent? I think it is, as every instance of INDEPENDENT-SET…
Ravindra
  • 95
  • 2
  • 10
0
votes
1 answer

Optimizing the Layout of Arbitrary Shapes in a Plane

I am trying to create an algorithm that can take a set of objects and organize them in a given area such that a box bounding all of the shapes is optimized (either by area used, or by maximizing the span along one of the dimensions, etc.). All of…
Hari
  • 157
  • 2
  • 12
0
votes
1 answer

Why we cant have FPTAS for Strong NP complete problems

I understood that we can apply FPTAS to the weak NP problems like 0-1 knapsack. But why we cant apply the same principal to the strong NP problems like bin packing.I also checked wiki page about the same but understood very less.
0
votes
1 answer

Traveling salesman TSP: Brute algorithm improvement

According to wiki it will take (N-1)! to calculate a tour with N cities. I found a better way to do it but I can't do the math to calculate just how much I improved it. I can tell you that on my home pc I been able to solve 20 cities map in less…
Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
0
votes
1 answer

class NP, polynomial-time verification CLIQUE

The CLIQUE problem-- problem of finding the maximum clique in a graph is NP-complete. That is, CLIQUE is a.) in NP and b.) there is an NP complete problem, 3-SAT for one, that reduces to CLIQUE in polynomial time. Part (b) above is fine-- all…
Roam
  • 4,831
  • 9
  • 43
  • 72
0
votes
1 answer

Using NP Reductions

I have been having some difficulty understanding reductions using NP problems and would like clarification. Consider the following problem: Show that the following problem is NP-Complete by designing a polynomial-time reduction algorithm from an…
Dan Brenner
  • 880
  • 10
  • 23
0
votes
1 answer

Is it NP hard to find a minimum dominating set containing some desired vertices?

For a connected undirected graph, G = (V, E) And a desired vertex set D, D is a subset of V (i.e. D \in V) Is it NP-hard to find a minimum dominating set, containing the desired vertex set D?
0
votes
2 answers

Boolean formula encoding

i am wondering how many bits required to encode a boolean formula like @(x1,x2,x3,x4) = (x1 OR x2 OR NOT(x3) OR x4) AND ((NOT)x2 OR x3) AND (x1 OR (NOT)x4) @ is an instance of SAT. I think it is 4 bits since total number of possible…
Justin Carrey
  • 3,563
  • 8
  • 32
  • 45
0
votes
1 answer

What was the first algorithm to be branded as NP Complete?

There should have been an initial problem to start building the set of NPC problems. Only then could problems be added to the set NPC , from the set NP by showing that the problem in NP is reducible to that first problem in NPC. So, what was the…
asudhak
  • 2,929
  • 4
  • 22
  • 27
0
votes
1 answer

When NP complete becomes NP hard

Generally, assuming we have a NPC problem. Adding more constraint to it (making it more difficult), is it possible that problem become NPH? I know the difference between NPC and NPH but I don't know how to show that adding new constraints to…
Sara
  • 2,308
  • 11
  • 50
  • 76
0
votes
1 answer

Np completeness - Need some clarification in reduction

I wanted some clarification in a concept. For proving that a problem is NP complete, we use reductions. Now suppose I have L<=L'. has the reduction to be from L to L' or can I do it it the reverse way also? i.e Can I show that if L can be solved…
Aakash Anuj
  • 3,773
  • 7
  • 35
  • 47