开发者

What are some examples of problems that are processor intensive but do not require a lot of data? [closed]

开发者 https://www.devze.com 2023-02-16 03:31 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 9 years ago.

开发者_JAVA百科 Improve this question

I'd like to experiment with using a crude "grid" made from web browsers executing javascript and returning the results to a server, where they would be assembled into something useful. My experience is mostly with data-intensive applications, and those problems don't respond well to being sent out over a network.

What are some problems that might be easy to split into discrete units of work and executed asynchronously on multiple computers? Javascript versions of the solutions would be especially useful.


What about something simple and visually appealing like computing the Mandelbrot set or other fractals? That is a common example for parallel computing because it requires minimal communication, has linear scalability, and looks nice for pictures.


Something easy: brute search attempt at finding a "secret" string; check all possibilities.


I have two examples of CPU-intensive JavaScript calculations:

http://apps.mathieu-rodic.com/Beautiful/Growing-Tree-Animation

http://apps.mathieu-rodic.com/Beautiful/Mandelbrot-Fractal


The following code can be used to generate images like these on a Cartesian coordinate system. The detail of the images scales with size. If you want a really big image, you need to plot a really high number of dots. Plotting a trillion dots on a single processor and it will run for hours or days.

This works on a Cartesian coordinate grid:

x = 0.1; y = 0.1; /* starting point */
DO 10 Trillion Times
    xnew = sin(y*b) + c*sin(x*b);
    ynew = sin(x*a) + d*sin(y*a);
    x = xnew; y = ynew;
    PlotDotAt(x, y);
END

This can be done in parallel by randomizing the input X and Y values, which settle into a pattern after a few hundred iterations anyway.

As a side note, this is also a very good exercise for CUDA or other GPU programming.

Taken from Chaos in Wonderland by Clifford A. Pickover.


  • Factoring a big number
  • Packing a bin
  • Generating a plan
  • Winning at chess ....
0

精彩评论

暂无评论...
验证码 换一张
取 消