-1

enter image description here

I'm trying to solve this exercise for this algorithm.

I've tried to research on multithreading but I couldn't come up with a solution.

Nàdia
  • 1
  • 1
  • You should show your research effort and say what did you tried. You should also not post this as an image. Please read https://stackoverflow.com/help/how-to-ask – Jérôme Richard Nov 05 '22 at 16:33
  • I only have this as an image. Ive been understanding the algorithm and then I thought of dividing the problem so that some parts of itcould be run at the same time by different processors. Im totally lost and I dont even know if that's the correct way to go through the problem, but my idea was trying to divide the "tasks" and then see how the complexity improved. I dont know how many processors I can use but since we are dividing the LCS matrix into 4 quadrants I thought of 4. I dont know how that would reduce the complexity though cause I dont know how many tasks can be done at the same time. – Nàdia Nov 05 '22 at 16:55
  • The image belongs to the paper "Cache-oblivious dynamic programming", though. – Nàdia Nov 05 '22 at 16:57

1 Answers1

0

Cache-oblivious traversal is not about complexity, it is about efficient use of the CPU cache.

The performance when traversing matrices is very dependent on the CPU cache. There can be orders of magnitude difference between two algorithms with identical complexity but with different cache access patterns.

It is a technique that can be used both in a single-threaded and a multi-threaded implementation.

It's basic idea is that you do not traverse the matrix line by line but quadrant by quadrant allowing the CPU to bring in the data from memory in its cache. Experiment with the size of your quadrant and you will see a huge improvement.

mmomtchev
  • 2,497
  • 1
  • 8
  • 23