np-complete

Graph partitioning based on nodes and edges weights

风格不统一 提交于 2020-01-06 15:40:10
问题 I have a graph G=(V,E) that both edges and nodes have weights. I want to partition this graph to create equal sized partitions. The definition of the size of partition is sum(vi)-sum(ej) where vi is a node inside that partition and ej is an edge between two nodes in that partition. In my problem the graph is very dense (almost complete). Is there any approximation algorithm for that? This is somehow similar to the problem in bin packing with overlapping objects where bins have the same size.

algorithm to check whether a given graph is subgraph of another graph [closed]

耗尽温柔 提交于 2020-01-02 13:34:56
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . i assume that we have 2 labeled graphs G and T and the algorithm determine if G a subgraph of T and the corresponding vertices in the main graphT and the subgraph G should have same label 回答1: That problem is

algorithm to check whether a given graph is subgraph of another graph [closed]

狂风中的少年 提交于 2020-01-02 13:34:32
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . i assume that we have 2 labeled graphs G and T and the algorithm determine if G a subgraph of T and the corresponding vertices in the main graphT and the subgraph G should have same label 回答1: That problem is

NP-Complete VS NP-Hard

回眸只為那壹抹淺笑 提交于 2020-01-01 11:50:16
问题 I am trying to understand the difference between NP-Complete and NP-Hard. Below is my understanding An NP-Hard problem is one that is not solvable in polynomial time but can be verified in polynomial time. An NP-Complete problem is one that is in NP and is also NP-Hard. Is the above definition correct? If so, What about problems not In NP but NP-Hard. Wouldn't they be harder than NP-Complete problem, say they can only be solved and verified in exponential time? 回答1: A NP problem (not NP-Hard

Class Scheduling to Boolean satisfiability [Polynomial-time reduction] part 2

℡╲_俬逩灬. 提交于 2019-12-28 19:35:09
问题 I asked few days ago, a question about how to transform a University Class Scheduling Problem into a Boolean Satisfiability Problem. (Class Scheduling to Boolean satisfiability [Polynomial-time reduction]) I got an answer by @Amit who was very elegant and easy to code. Basically, his answer was like this : instead of considering courses, he considered time-intervals. So for the i-th course, he just indicted all the possible intervals for this course. And we obtain a solution when there is at

Subset sum solution length

左心房为你撑大大i 提交于 2019-12-25 04:36:22
问题 I'm using the following logic to solve the subset sum problem as described in this question: Total sum from a set (logic). It is working and it will give me one random solution every time, the problem is that I need only the solutions with an specific amount of items. For example: [2,3,4,6,3] //Set of values SUM = 6 The current solutions I can get are: [4,2] [6] [3,3] But what if I need this method to randomly return only a solution with (for example) 2 items? 回答1: Just in case somebody needs

Boolean formula encoding

会有一股神秘感。 提交于 2019-12-23 05:26:02
问题 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 combinations are 2(power4). Is that correct? Should i count OR, NOT, AND to calculate number of bits needed for encoding? I searched a lot but couldn't find anything on this. 回答1: You can always convert your expression into a logically equivalent CNF with

String to string correction problem np-completeness proof

﹥>﹥吖頭↗ 提交于 2019-12-23 05:08:19
问题 I have this assignment to prove that this problem: Finite alphabet £, two strings x,y € £*, and a positive integer K. Is there a way to derive the string y from the string x by a sequence of K or fewer operations of single symbol deletion or adjacent symbol interchange? is np-complete. I already figured out I have to make transformation from decision version of set covering problem, but I have no clue how to do this. Any help would be appreciated. 回答1: It looks like modified Levenshtein

Numberlink/Flow Game: How to spot NP-Complete problems?

一个人想着一个人 提交于 2019-12-23 04:41:18
问题 I was trying to find a way to solve the problem in the famous game Flow. http://moh97.us/flow/ After googling I find out that this is a NP-complete problem. A good solution would make use of heuristics and cuts. How can I spot a NP-complete problem easily? Sometimes when I block, I can't see the obvious solution. When this happens with an NP-complete, it's better to recognise it quickly and move on to the next problem. 回答1: When you have an explosion of objects (say objects whose count grows

Numberlink/Flow Game: How to spot NP-Complete problems?

﹥>﹥吖頭↗ 提交于 2019-12-23 04:41:01
问题 I was trying to find a way to solve the problem in the famous game Flow. http://moh97.us/flow/ After googling I find out that this is a NP-complete problem. A good solution would make use of heuristics and cuts. How can I spot a NP-complete problem easily? Sometimes when I block, I can't see the obvious solution. When this happens with an NP-complete, it's better to recognise it quickly and move on to the next problem. 回答1: When you have an explosion of objects (say objects whose count grows