Parallel and distributed algorithms for matrix multiplication

The problem occurs when I look at the Wikipedia page. Matrix Multiplication Algorithm

It says:

This algorithm has a critical path of step length , that is, it takes a lot of time on an ideal machine with an infinite number of processors; therefore, it has the highest possible acceleration on any real computer. Θ((log n)^2) Θ(n3/((log n)^2))

(Quote from the section "Parallel and Distributed Algorithms / Shared memory parallelism.")

Since it is assumed that there are infinite processors, the multiplication operation must be performed in O(1). And then just add all the elements up, and that will be constant time too. Therefore, the longest critical path should be O (1) instead of Θ ((log n) ^ 2).

I was wondering if there is a difference between O and Θ and where am I mistaken?


The problem is resolved thanks to @Chris Beck. The answer should be divided into two parts.

Firstly, a low error - I do not count the summation time. Summation takes O(log(N))in operations (think about binary addition) .

Secondly, as Chris points out, non-trivial problems take up time O(log(N))on the processor. First of all, the longest critical path should be O(log(N)^2)instead O(1).

O Θ Big_O_Notation_Wikipedia.

Big O - , Big O Big Theta Θ .


. O(log(N)^2) , . @displayName, . , - . !

+4
3

, .

  • O (1), ?
  • Θ (log 2 n)?

.


, : .

  • - , . , - .
  • - , , . , , . , .

, A, B, C, D, D C, C B B A, , 2 , , 4 , , .

.


  • n X n [n/2] X [n/2] , , ( 1 X 1), O (log (n)).
  • , , , n, , O (log 2 n).
  • O (log 2 n), Θ (log 2 n).

, :

M (n) = 8 * M (n/2) + Θ (Log n)

- 2 Θ (log 2 n).

Big O Theta , Big O , , Big O, Theta , , , Theta. , , , , , , :

enter image description here

: http://xlinux.nist.gov/dads/Images/thetaGraph.gif

, , , "" .


...

Parallelism. ( work) . , wikipedia, , - O (n 3). - O (log 2 n).

, = O (n 3/log 2 n).

, - , .


a - , 1, b - , 1. c - d - . -

T (n) = a * T (n/b) + n c n > 1

n - b,

  • b a < c, T (n) = Θ (n c);
  • Log b a = c, T (n) = Θ (n c * Log n);
  • b a > c, T (n) = Θ (n log b a).
+3

" ", , .

, : ", , , ".

- , , , O (1).

, . , , , , "", , .

"1", , ..

, (, ) O(log n) , "" .

, O(log n) , . , . , P , , .

+1

O(logn) n^3. :

: N x N M1 M2. M3 .

N M3[i][j]. M3[i][j] Sum(M1[i][k] * M2[k][j]), k = 1..N. . M1[i][1] * M2[1][j], - M1[i][2] * M2[2][j],.... . . O(logn) , :

     4         Stage 3
   /   \
  2     2      Stage 2
 / \   / \
1   1 1   1    Stage 1

(i, j) n^3.

+1

Source: https://habr.com/ru/post/1607678/


All Articles