The limits of parallelism (interview question)

Is it possible to solve the problem of complexity O (n!) Within a reasonable time, given the infinite number of processing blocks and the infinite space?

A typical example of O (n!) Problem is brute force search: attempting all permutations (ordered combinations).

+5
source share
10 answers

Of course. Consider the traveling salesman problem in this strict NP form: given this list of travel expenses from each point to another point, can you combine a tour with a cost less than K? With Intel's new processor with an infinite core, you simply assign one core to every possible permutation and add costs (it's fast) and see if any of the main flags are successful.

More generally, the NP problem is a solution problem, so a potential solution can be tested in polynomial time (i.e. efficiently), and therefore (since potential solutions are enumerable) any such problem can be effectively solved with enough many processors.

+6
source

, , O (n!) O (n ^ a) ; , -P = NP. - , -P, NP. , ( , n ).

+6

.

, CPU, , , .

. () , .. O (log (n!)). , , O (log (n!)) , , .

+2

/ O (n!), , , .

, ( , , ) .

" ", . , (, ), , log (n!) .

, . .

: .

+1

, N! NP. parallelism NP , "" , N! - , .

+1

"" , ? , , , , , O (n!) concurrency, ? O (n!), , . - O (n ^ 4), .

, concurrency - , , . - , , . , , : http://view.eecs.berkeley.edu/wiki/Dwarf_Mine. FWIW O (n ^ 4), , FSM.

: , , 10% MPI, (, , ).

+1

, , , , ; . , . ""; . Software Engineering (Software Engineering, Computer Science) , , . , , ! .

+1

: " ?" .

- , . , , , .

, , O (n!), O (n) * O ((n-1)!) . , ( O (n) ), ( O ((n-1)!) ).

, /. , , , "" . , " " .

, , , ( ), , O (1), N, "" .

+1

( ... , ), . , , .

, , - , .

0

, ? , , , , .

0

All Articles