Algorithm Explorer: Visualizing Algorithms in a 3D Multimedia Environment

Algorithm Explorer: Visualizing Algorithms in a 3D Multimedia Environment

Algorithm Explorer: Visualizing Algorithms in a 3D Multimedia Environment [Extended Abstract] Erik Carson Ian Parberry Bradley Jensen Department of Computer Department of Computer Department of Information Science & Engineering Science & Engineering Technology & Decision University of North Texas University of North Texas Sciences Denton, TX, USA Denton, TX, USA University of North Texas [email protected] [email protected] Denton, TX, USA [email protected] ABSTRACT API and simplifies the development process. The visual- Computer science courses have increasingly made use of vi- izations themselves are rich multimedia presentations im- sualization tools to illustrate common algorithms. This pa- plemented using DirectX 9.0 and feature three-dimensional per describes Algorithm Explorer, an educational tool de- representations of common data structures, animation of signed for use by instructors and students to examine algo- common operations, context-sensitive tracing of source code rithms in a rich environment composed of 3D data represen- or pseudocode, and support for sound effects that reinforce tations, 3D audio cues, and easy-to-use controls. Instructors the animation. Algorithm Explorer is highly customizable and students can easily add calls to Algorithm Explorer’s on both the user and developer levels. Developers can set C++ API to their programs to quickly develop engaging vi- parameters for the colors, textures, lighting, and sound ef- sualizations, and every detail of the scene can be customized fects for various structures, operations, and events. Users as the developer desires. can view these scenes as developed or override these with their own customizations at runtime. Instructors can use Algorithm Explorer as a primary tool Categories and Subject Descriptors for presenting algorithms or as a supplement to textbooks, K.3.2 [Computing Mileux]: Computers and Education- slide shows, and other traditional forms of presentation. Computer and Information Science Education[Computer sci- Students can use Algorithm Explorer’s graphical interface ence Education] to view visualizations provided by their instructor. They can also use the C++ API as a comprehensive aid and a General Terms debugging tool when developing or working with C++ im- plementations of common algorithms. Design, Experimentation The main part of this paper is divided into three sections. Section 2 describes prior work and compares and contrasts Keywords it with Algorithm Explorer. Section 3 describes Algorithm Explorer in more detail from the user and programmer per- Algorithm animation, visualization spectives. Section 4 contains two examples of algorithm vi- sualization code using Algorithm Explorer. 1. INTRODUCTION Algorithm Explorer is an educational tool designed to 2. PRIOR WORK help computer science students visualize many common al- Several systems already exist for visualizing algorithms, gorithms used in a standard computer science curriculum. each with its own philosophy and range of application. This The tool consists of a Microsoft Windows application for section briefly examines several systems and reflects on their viewing and manipulating visualizations, a C++ API for merits, drawbacks, and influences on Algorithm Explorer. developing visualizations in Microsoft Visual Studio, and an add-in for Microsoft Visual Studio that supplements the 2.1 Tango, XTango, Polka, and Samba Stasko developed the Tango framework for algorithm ani- mation in 1990 [8]. In XTango (the X11 Window implemen- Permission to make digital or hard copies of all or part of this work for tation of Tango), animations consist of a control file that personal or classroom use is granted without fee provided that copies are contains graphics instructions grouped into events that cor- not made or distributed for profit or commercial advantage and that copies respond to key parts of the algorithm [9]. The developer bear this notice and the full citation on the first page. To copy otherwise, to interleaves XTango API calls into a C implementation of republish, to post on servers or to redistribute to lists, requires prior specific the algorithm. With enough effort, an animation designer permission and/or a fee. SIGCSE’07, March 7–10, 2007, Covington, Kentucky, USA. can create almost any imaginable 2D or 2.5D representation Copyright 2007 ACM 1-59593-259-3/06/0003 ...$5.00. using primitive drawing and animation operations. How- ever, such animations require explicit placement and low- ating stack frames for method calls. Arrays are visualized in level setup of every component of the animation. Stasko their own panel, and array indices are visualized as arrows later developed Polka to visualize parallel algorithms and pointing to the appropriate element. Jeliot 2000 seems more Samba to allow designers to build animations via text scripts suited to an introductory programming course; an under- [10, 11]. graduate algorithms course usually views data structures on a more abstract level. Jeliot 2000 works with most of Java’s 2.2 Animal language elements, but it cannot visualize objects other than In R¨oßling’s Animal system, animations are built using a strings, making it unsuitable for viewing, for example, high graphical editor [7]. The interface generates a text script level graph operations. Jeliot provides few options for cus- which can then be modified by hand. Like Tango, Animal tomizing the animation apart from play speed and fonts. can be used to visualize many representations; however, like Tango, it does so through the composition of low-level draw- 2.6 BlueJ ing and animation operations rather than operations on the BlueJ is a visual programming environment designed for abstract data types represented in the animation; in fact, introductory courses in object-oriented programming using Animal animations can be generated without actually im- Java [2]. While not specifically an algorithm visualization plementing the algorithm in code. Animal has specialized system, BlueJ does visually represent all of the classes and support for displaying code or pseudocode in the animation. instances that make up a Java application, including Java Finally, Animal has a sizable online repository of animations API classes. Rather than developing linear programs that that can be retrieved through the interface itself [6]. run from a static main function, users of BlueJ write func- tions that can be called at will from the interface. Like 2.3 MatrixPro Jeliot, the visualization is too low-level to visualize abstract The MatrixPro system by Karavirta et al. takes another data types such as graphs and trees without considerable approach to algorithm visualization [1]. The user builds an- coding. However, the system is excellent for visualizing ob- imations in a graphical interface by choosing from a menu jects at the class level. of data structures. The user can then use drag-and-drop operations to manipulate the data structures interactively. 3. DESCRIPTION The data structures update themselves according to their Algorithm Explorer addresses a number of problems with expected behavior. All operations on the scene are recorded previous efforts at visualization: and can be saved to a file for later review. Furthermore, • Developers can create visualizations for algorithms in operations can be layered at different levels of granularity less time than they spent implementing the algorithms and played back at any given level, skipping finer steps as themselves, though further effort can refine a visual- desired. MatrixPro’s primary advantage is that its users can ization’s audio-visual aspects. alter the visualization without the need to recompile or re- • Visualizations are high-level, on par with the data load an animation. However, MatrixPro has no support for structure itself (e.g., heap) or the underlying imple- source tracing, and creating new data structures is compli- mentation (e.g., array used to implement a heap) as cated and requires extensive Java coding on the part of the desired. designer [5]. • Any algorithm that can be represented by a combina- 2.4 CS Teaching Aids for Visual J# .NET tion of blocks, arrays, call stacks, and graphs can be visualized with Algorithm Explorer. Microsoft has released visualizations of sorting and recur- • Visualizations support source tracing, and the add-in sive algorithms using Visual J# .NET [4]. Visual Studio for Visual Studio .NET 2005 automates much of the .NET is required to build these teaching aids. source-tracing process. The sorting visualization compares two of three basic al- • The visualizations are very media-rich. 3D graph- gorithms for sorting arrays—insertion sort, merge sort, and ics, 3D audio, and smooth animation all combine to selection sort—in parallel using a bar graph representation make a more immersive visualization experience for of the arrays. The algorithms are compared based on elapsed the learner. time and number of comparisons. While the visualization includes a description of each algorithm along with source Algorithm Explorer is used on two levels—by the user code, the visualization does not trace the source code as interacting with the visualizations and by the programmer the program progresses. The recursion visualization demon- creating visualizations. The user sets different visualization strates several recursive functions by stepping through each parameters using the GUI controls and plays visualizations. function call and return. The steps are visualized as boxes The programmer uses Algorithm Explorer’s C++ API calls on the right

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    5 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us