Idea : A library for animated algorthms demonstration

edited March 2018 in Summer of Code 2018

Hello processing,

I would like to make a library that have animated demonstration for sevel commonly-used algorithms, to help people have a direct understanding on some classic algorithms, to name a few, selection sort, quick sort, k-means clustering, binary search, Huffman coding and so on.

Here I implement a simple demo on k-means clustering: k-means-demo

If possible, I would re-write this one together with other algorithms into a library for processing. While importing, one could use it like this :

Algorithm algo = new KMeansClustering(); void draw() { algo.demo(); }

Please leave your comment if my thought is naive.

Tagged:

Comments

  • @joinhow -- it sounds like you are talking about a collection of demos.

    In what sense would this be used as a library -- that is, what would people use your library for? For example, people use minim to include audio in their sketches, grafica to draw their own graphs, peasycam to add 3D camera control to their objects, et cetera. Would your code help people create Processing sketches somehow -- sorting and clustering etc. their own things -- or would it be illustrative material for a general computer science course?

  • edited March 2018

    @jeremydouglass Thank you for your comment!

    Considering there would be little chance to use these algorithms directly in ones's sketches, I thinks it's better to regard this idea as the second scenario-- a collections of illustrative material and people use it for CS courses. But this makes it a little different from a conventional "library".

    Maybe I should include both -- it not only illustrate algorithm, but also provide interfaces to use these algos in a simple way to make ones's sketch brief.

  • @joinhow -- I can't speak for the core developers, but that might be a reason to refocus your proposal. My impression is that the focus is not on making things using Processing / p5.js -- instead, it is on improving or extending core functionality for users of Processing.

    Check this out for many examples and ideas:

  • Thanks for your interest! Proposals for new libraries are encouraged for GSoC. I think a library that includes useful algorithms would be best paired with examples of applications of these algorithms. You might look through all of the Processing examples and consider -- how could my library serve these examples and/or unlock new creative potential for Processing users?

  • glad to have your replay.

    I suppose that such a library would help people a lot in making their coding more efficient. And also I would add examples of animated illustrations to make clear these algorithms, which is helpful for teachers and students in computer science courses.

  • I would love to see your library!

    At the same time I can emphasize what jeremy said.

    When you propose a library with different visualizations of algorithms that’s more a collection of visualizations and not a library. A library would not be a collection of visualizations but more a tool box to write your own sketch like minim. In your case it would be a tool box to facilitate the writing of visualizations of different algorithms as such. Even algorithms you haven’t thought of. So the library would not have the command show bubble sort but instead commands like show a changing array visually over time. And the user can then write a bubble sort visual in his own sketch much easier using this tool - or he writes a visual for another algorithms. So he has much more freedom in what he does with the library (than in your approach with fixed algorithm visuals) but he gets powerful tools to facilitate his ideas for visualizing algorithms.

    So in my opinion a library is not a collection of ready sketches but a tool box. Do you understand the difference I try to describe?

    But also I would be interested in your library. Include recursive backtracking algorithm please - it’s so cool.

    Regards Chrisir

  • @Chrisir
    Thank you for your great opinions. But I'm sorry that I'm a little confused.

    You are saying that, I should provide something like a monitor to a data structure and show its real-time change visually, so that the user could implement their own algorithms more efficiently;

    Or, my library should be an already implemented template that only gives the users the freedom to make their own visual options, just like Box2D for Processing, which manages how things act when moving and colliding, but not responsible for what they look like.

    Please tell me that which case do you refer to. Personally I prefer the second scenario.

Sign In or Register to comment.