Homepage of the Algorithm Animation Library

How to install the Algorithm Animation Library

Requirements - Linux

To install the Algorithm Animation Library, just unpack the downloaded archive.

tar -xf aal.tar

The new directory aal will be created. Then, from inside this directory, a simple make command will build the library and the provided example.

Things to watch for

Requirements - Windows

Things to watch for

How to use the Algorithm Animation Library

The Algorithm Animation Library is bundled with an example of it's use. This example is an executable, which could be run by command ./aa. The simple usage information, which will provide a brief list of command line options will show up:

Algorithm Animation Library demonstration Usage: ./aa <example> [options] <example> : The number of the example to show. [1,2,3,4] Options: -pdf <filename> : Generate also a Portable Document Format (PDF) file <filename> containing all the key frames of the animation. -ps <filename> : Generate also a PostScript (PS) file <filename> containing all the key frames of the animation. -svgk <filename_base> : Generate also a Scalable Vector Graphics (SVG) files <{/path/}filename_base%03d.svg> with all the key frames of the animation. -pngk <filename_base> : Generate also a Portable Network Graphics (PNG) files <{/path/}filename_base%03d.png> with all the key frames of the animation. -svg <filename_base> : Generate also a Scalable Vector Graphics (SVG) files <{/path/}filename_base%04d.svg> with all the frames of the animation. -png <filename_base> : Generate also a Portable Network Graphics (PNG) files <{/path/}filename_base%04d.png> with all the frames of the animation. -in <filename> : Do not generate random values. Instead, read the input values from the file <filename>. This file has to exist. -out <filename> : Write the used input values to a file <filename>. If this file exists, it's content will be overwritten. -dbg <level> : Change the default debug level to <level>. Possible values are 0 - 5, where 0 is the lowest nad 5 is the highest level of debugging. The default value is 2. A video note : If you have mencoder, you can generate a video file containing ============== the animation from the previously generated PNG images like this mencoder mf://*.png -mf fps=30:type=png -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -o output.avi

There are four algorithm animations prepared in this example:

  1. The sorting using quicksort
  2. The insertions into the AVL tree
  3. The breadth-first search in a graph
  4. The depth-first search in a graph

The sample pictures and videos from these prepared presentations could be found in Example section.

If the program is run with wrong or incomplete parameters, it will show an error and will not continue. Once a program has started, a window will appear and you can start controlling the animation. For a start, if you are not familiar with controls, press h and the program will print this help:

Algorithm Animation Library Usage: h : This help text. Escape : Quit. i : Dump the brief information about objects in the current frame. a : Dump information and attributes of the objects in the current frame. s : Dump brief information about the scenes. w : Hide / show the scene and frame information. r : Force redraw. f : Attempt to make the window fullscreen. Space : Start / Stop the animation. Home : Go to the first Scene. End : Go to the last Scene. [ / ] : Animate to the previous / next scene. PageDown / PageUp : Move to the previous / next scene. Left / Right arrows : Animate to the previous / next key frame. Down / Up arrows : Move to the previous / next key frame ,(comma) / .(period) : Move to the previous / next frame.

If you just want to see the animation in progress, run the program will some the example number and just press space - the animation will begin.

How to create an animation using the Algorithm Animation Library

The process of creating custom animations using the Algorithm Animation Library is not complicated, but it requires some programming. Basically, it consists of the following steps:

  1. Having an own implementation of the algorithm you want to animate.
  2. Adding appropriate visualization components to your implementation and define all the required parts of the animation.
  3. Compile and link the resulting program to the Algorithm Animation Library and start using it.

The more detailed description of this process is part of the bachelor's thesis of Peter BaĊĦista, which is also available here (in Slovak language).

There is also a source code of a very simple program which uses the Algorithm Animation Library available.