np-complete

Question about NP-Completeness of the Independent Set Problem

别等时光非礼了梦想. 提交于 2019-12-23 04:29:12
问题 I thought that, when proving that a problem P is NP-Complete, we were supposed to reduce a known NPC problem to P. But, looking at the solution to the Independent Set problem, it seems to not go this way. To prove that Independent Set is NP-Complete, you take a graph G, find its inverse G', and then compute CLIQUE(G'). But, this is doing the other way around: it's taking a problem P I DON'T know if it's NPC and then reduces it to a know NPC problem. Here's an example of the solution. What am

Graph Coloring with using Simulated Annealing

浪尽此生 提交于 2019-12-22 13:58:51
问题 I am trying to come up with the algorithm for a Graph Coloring problem using Simulated Annealing. There is the general algorithm online, but when i look at it, I couldn't understand how can apply this algorithm on this problem. Each node in graph must had diffrent color from it's neibours. How can I use the Simulated annealing algorithm for this. What is the "temperature", "schedule" in this problem? Please help me understand this. Thanks 回答1: Setting the starting temperature and cooling

Is minimization of boolean expressions NP-Complete?

守給你的承諾、 提交于 2019-12-22 05:10:28
问题 I know that boolean satisfiability is NP-Complete, but is the minimization/simplification of a boolean expression, by which I mean taking a given expression in symbolic form and producing an equivalent but simplified expression in symbolic form, NP-Complete? I'm not sure that there's a reduction from satisfiability to minimization, but I feel like there probably is. Does anyone know for sure? 回答1: Well, look at it this way: using a minimizing algorithm, you can compact any non-satisfiable

bin packing with overlapping objects

杀马特。学长 韩版系。学妹 提交于 2019-12-21 02:59:08
问题 I have some bins with different capacities and some objects with specified size. The goal is to pack these objects in the bins. Until now it is similar to the bin-packing problem. But the twist is that each object has a partial overlap with another. So while object 1 and 2 has sizes s1 and s2, when I put them in the same bin the filled space is less than s1+s2. Supposing that I know this overlapping value for each pair of objects, is there any approximation algorithm like the ones for

Reduction to Clique prob

眉间皱痕 提交于 2019-12-19 10:42:49
问题 Subgraph isomorphism We have the graphs G_1=(V_1,E_1), G_2=(V_2,E_2). Question : Is the graph G_1 isomorphic to a subgraph of G_2 ? (i.e. is there a subset of vertices of G_2, V ⊆ V_2 and subset of the edges of G_2, E ⊆ E_2 such that |V|=|V_1| and |E|=|E_1| and is there a one-to-one matching of the vertices of G_1 at the subset of vertices V of G_2, f:V_1 -> V such that {u,v} ∈ E_1 <=> { f(u),f(v) } ∈ E) Show that the problem Subgraph isomorphism belongs to NP. Show that the problem is NP

Reduction to Clique prob

爱⌒轻易说出口 提交于 2019-12-19 10:42:11
问题 Subgraph isomorphism We have the graphs G_1=(V_1,E_1), G_2=(V_2,E_2). Question : Is the graph G_1 isomorphic to a subgraph of G_2 ? (i.e. is there a subset of vertices of G_2, V ⊆ V_2 and subset of the edges of G_2, E ⊆ E_2 such that |V|=|V_1| and |E|=|E_1| and is there a one-to-one matching of the vertices of G_1 at the subset of vertices V of G_2, f:V_1 -> V such that {u,v} ∈ E_1 <=> { f(u),f(v) } ∈ E) Show that the problem Subgraph isomorphism belongs to NP. Show that the problem is NP

Solving the NP-complete problem in XKCD

前提是你 提交于 2019-12-18 10:06:31
问题 Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions. The problem/comic in question: http://xkcd.com/287/ I'm not sure this is the best way to do it, but here's what I've come up with so far. I'm using CFML, but it should be readable by anyone. <cffunction name="testCombo" returntype="boolean"> <cfargument name="currentCombo" type="string" required="true" /> <cfargument

What is an NP-complete in computer science?

百般思念 提交于 2019-12-17 15:05:25
问题 What is an NP-complete problem? Why is it such an important topic in computer science? 回答1: NP stands for Non-deterministic Polynomial time. This means that the problem can be solved in Polynomial time using a Non-deterministic Turing machine (like a regular Turing machine but also including a non-deterministic "choice" function). Basically, a solution has to be testable in poly time. If that's the case, and a known NP problem can be solved using the given problem with modified input (an NP

graph coloring and NP completeness

安稳与你 提交于 2019-12-12 05:57:27
问题 I am having trouble understanding the NP completeness of graph coloring. If I assume a greedy coloring strategy (http://en.wikipedia.org/wiki/Graph_coloring#Greedy_coloring) with DFS, then I seem to be able to color graphs optimally. Could anyone help me with a counter example? To be clear, let all nodes be colored -1. Color the start node 1. Proceed in a DFS traversal coloring every node with the minimum integer that is not already assigned to its neighbors. When would this fail to optimally

Array search NP complete [closed]

不羁岁月 提交于 2019-12-11 14:48:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . Given an unsorted array of size n, it's obvious that finding whether an element exists in the array takes O(n) time. If we let m = log n then it takes O(2^m) time. Notice that if the array is sorted, a binary search actually takes O(m) time (which is polynomial) but the binary search cannot apply to an unsorted