Using a greedy randomized algorithm to create art

The greedy randomized adaptive search procedure (also known as GRASP) is a metaheuristic algorithm commonly applied to combinatorial optimization problems in which each iteration consists basically of two phases: construction and local search. The cons…


This content originally appeared on DEV Community and was authored by Daniel Dominguez

The greedy randomized adaptive search procedure (also known as GRASP) is a metaheuristic algorithm commonly applied to combinatorial optimization problems in which each iteration consists basically of two phases: construction and local search. The construction phase builds a feasible solution, whose neighborhood is investigated until a local minimum is found during the local search phase.

First, the darkest pixel is found. Then a number of random lines are drawn through that point, and the pixel values along each line are added together. The line with the darkest average is chosen, and the value of that line is subtracted from the image. Then the whole process is started over again for however many lines we are drawing.

By the nature of the algorithm, the optimal line drawing configuration is probably not achieved, but performance is far superior to the naive method of checking every line.


This content originally appeared on DEV Community and was authored by Daniel Dominguez


Print Share Comment Cite Upload Translate Updates
APA

Daniel Dominguez | Sciencx (2021-09-16T00:27:34+00:00) Using a greedy randomized algorithm to create art. Retrieved from https://www.scien.cx/2021/09/16/using-a-greedy-randomized-algorithm-to-create-art/

MLA
" » Using a greedy randomized algorithm to create art." Daniel Dominguez | Sciencx - Thursday September 16, 2021, https://www.scien.cx/2021/09/16/using-a-greedy-randomized-algorithm-to-create-art/
HARVARD
Daniel Dominguez | Sciencx Thursday September 16, 2021 » Using a greedy randomized algorithm to create art., viewed ,<https://www.scien.cx/2021/09/16/using-a-greedy-randomized-algorithm-to-create-art/>
VANCOUVER
Daniel Dominguez | Sciencx - » Using a greedy randomized algorithm to create art. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/09/16/using-a-greedy-randomized-algorithm-to-create-art/
CHICAGO
" » Using a greedy randomized algorithm to create art." Daniel Dominguez | Sciencx - Accessed . https://www.scien.cx/2021/09/16/using-a-greedy-randomized-algorithm-to-create-art/
IEEE
" » Using a greedy randomized algorithm to create art." Daniel Dominguez | Sciencx [Online]. Available: https://www.scien.cx/2021/09/16/using-a-greedy-randomized-algorithm-to-create-art/. [Accessed: ]
rf:citation
» Using a greedy randomized algorithm to create art | Daniel Dominguez | Sciencx | https://www.scien.cx/2021/09/16/using-a-greedy-randomized-algorithm-to-create-art/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.