1 / 101

Designing Effective Algorithm Visualizations

Sami Khuri Department of Mathematics and Computer Science San José State University www.mathcs.sjsu.edu/faculty/khuri. Designing Effective Algorithm Visualizations. Outline. Definition History Design process: Analysis phase Design phase Evaluation Concluding remarks. 1. Definition.

lweldon
Download Presentation

Designing Effective Algorithm Visualizations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sami Khuri Department of Mathematics and Computer Science San José State University www.mathcs.sjsu.edu/faculty/khuri Designing Effective Algorithm Visualizations

  2. Outline • Definition • History • Design process: • Analysis phase • Design phase • Evaluation • Concluding remarks

  3. 1. Definition Algorithm Visualization • is the process of abstracting a program’s data, operations, and semantics, and creating dynamic views of those abstractions. • is a depiction of an algorithm using an integrated set of multimedia tools, such as graphics, text, color, sound, code, animation and video.

  4. 2. History 1980s: Visualizations can serve as effective learning aid for students. • Balsa (Marc Brown, 1988) • Zeus (Marc Brown, 1991) • Tango (John Stasko, 1990), Xtango, Polka • Later: Leonardo (Crescenzi et al., 1997)

  5. History 1990s: Empirical studies: Do algorithm animations really help? • Results are unsatisfactory... • Badre (1991) • Hundhausen (1997) • Stasko (1998)

  6. History Today: Algorithm visualizations do enhance learning, • if existing visualizations are effectively used • Naps (2000) • Faltin (1999) • Stasko and Lawrence (1998) • if new visualizations are better designed • Hansen, Narayanan, Schrimpsher

  7. 3. Design Process • Good algorithm visualization is not simply a matter of mimicking paper-based tasks or doing what is technically easy. • Even simple tools can improve algorithm understanding, if they are the right ones. • A lot of time and effort can be wasted implementing a system that is not needed or is unusable.

  8. Design Process • We advocate: a user-centered approach (What do we NEED to show?), instead of a designer-centered approach (What CAN we show?) • Start with an analysis of the users, their needs, tasks, information, and resources.

  9. 3.1. Analysis Phase • Users’ analysis • Needs analysis • Task analysis • Information analysis • Domain analysis • Resources analysis

  10. 3.1.1. Users’ Analysis Who are they? • No algorithm visualization will be universally superior across all kinds of users. • Understanding who the users are allows us to determine content, organization, depth, breadth, interaction and presentation methods.

  11. Users’ Analysis Algorithm visualization system might be used by: • Students • Teaching Staff • Researchers • Visualization developers

  12. Users’ Analysis Students • Will watch and interact with algorithm visualizations. • Will need a lot of help information. • Will need a system that is forgiving to their invalid input. • Will need facilities for setting up desired speed and detail level, and for reversing actions.

  13. Users’ Analysis Another possible approach is to divide users into: • Novice users • Expert users

  14. Users’ Analysis Novice users • Need a system that is very easy to use. • For example, if the algorithm visualization system requires the user to annotate his/her program to call animation routines, the novice might not have the skills to do so. • Need clear and detailed help files. • Do not need a system displaying many different views of an algorithm.

  15. Users’ Analysis Expert users • Need a system that complements and supplements their thinking, rather than mimics internal representations. • Need a very flexible system allowing to see different levels of details • if they try to improve performance of an algorithm, for example.

  16. 3.1.2. Needs Analysis Do the users need algorithm visualization? • An assessment should be made as to whether presenting an algorithm by visualizing it is the most effective way to do so. • For example, instructors can use a phonebook to illustrate binary search. • If instructors do not have access to the WWW in class, they cannot use a web-based visualization system.

  17. 3.1.3. Task Analysis What will the users do with the algorithm visualization tool? • Create new animations. • Interact with existing visualization to understand the behavior of an algorithm. • Debug their program. • Each task demands a different kind of visualization tool. It is difficult to build a system that satisfies them all.

  18. Task Analysis How will the algorithm visualization fit into the existing curricula? • Classroom demos • Assignments • Hands-on laboratories • Self-directed work outside of class • Office hours • Distance learning

  19. Task Analysis Classroom demos • Algorithm visualizations should function well as demonstrations. • They will not need a lot of written explanations. • They need a facility for adjusting the speed and reversing previous steps. • They should run smoothly to avoid unpleasant situations where they “freeze”: • Web-based tools are not always the best for this task.

  20. Task Analysis Homework assignments • Algorithm visualizations have to run smoothly on different platforms for everyone. • Better to create Java applications, not applets: • Web-based Java execution is unpredictable at this point. • One has to test all the applications on the actual equipment (under different environments) ahead of time. Impossible to do! • They should be available for download • running them on the web server can be too slow.

  21. 3.1.4. Information Analysis What are we trying to convey? • Do we want to emphasize the data structures rather than the algorithm or vice-versa? • Create a profile of resource utilization. • Search through an execution trace. • Contrast two algorithms.

  22. Information Analysis Which aspects of an algorithm should we illustrate? • Source code • Data • Data structures • Execution • The trend is toward the ability to visualize all aspects of an algorithm.

  23. Information Analysis Source code visualization • View the source code through a flowchart. • View the code by displaying the pseudocode and highlighting lines currently being executed. • Present currently executing portion of the code in a window. Data visualization • Extract and display only scalar variables such as values held in an array.

  24. Information Analysis How should information be represented? • Direct representation • Structural representation • Synthesized representation • Analytical representation • Explanatory representation

  25. Information Analysis Direct representation • At any given instant, the data structure could be constructed from the display, and the display could be constructed from the data structure.

  26. Information Analysis Structural representation • Only the important aspects are represented. • For example, a computation running on a network of processes, where each process is either “active” or “inactive”. All other attributes of the processes are concealed since they are not relevant to the viewer.

  27. Information Analysis Do we display current information or illustrate history of what has happened? • Displaying history: • helps explain the algorithm like a textbook example, • lets users become familiar with the algorithm’s dynamic behavior at their own speed.

  28. Information Analysis How will we move from one display to the next one? • Incremental transition • Discrete transition There is no pedagogical advantage of either technique.

  29. Information Analysis Incremental transition • Transition occurs smoothly. • It is effective when users (especially novice) are examining an algorithm running on a small set of data. • This type of transition is difficult and tedious to implement. • Developers need to decide how slow or fast the transition should occur.

  30. Information Analysis What is the largest data set the algorithm visualization should be able to handle? • Limit the size of input data. • Large input files are allowed.

  31. Information Analysis Limit the size of input data • If visualizations are used to explain steps of algorithms. • For example, viewing visualizations of large trees will require scrolling to see the entire tree and might confuse more than educate. • If visualizations are used by novice users. • If visualizations are used in homework assignments.

  32. Information Analysis Very large size of input data • Is useful for researchers or instructors in classroom when comparing running times and behavior of different algorithms. • Cluttering the screen with information is not a problem. • Data items should be presented in the simplest form, dots, for example.

  33. 3.1.5. Domain Analysis What is the scope of the algorithm visualization? • General-purpose algorithm visualization system • Specialized algorithm visualization system • Single-purpose algorithm visualizations

  34. Domain Analysis General-purpose algorithm visualization systems • Systems that can (ideally) animate any algorithm. • These type of systems should provide a large set of ready-made pieces of visualizations and general tools to create them. • The greater the number of algorithms that can be animated, the more desirable the result.

  35. Domain Analysis General-purpose algorithm visualization systems • Some of the general-purpose systems are BALSA, TANGO and XTango, Zeus. • Although general-purpose algorithm visualization systems are becoming more powerful, the task of using these tools to create visualizations of algorithms still involves a lot of work.

  36. Domain Analysis Specialized algorithm visualization systems • Systems that specialize in visualizing algorithms from a certain field of computer science, such as computational geometry. • Restricting algorithm visualization system to one field only eases the process of creating visualizations, since graphical representation of data structures will be implemented once only.

  37. Domain Analysis Single-purpose algorithm visualizations • Programs that visualize one algorithm or a group of related algorithms in detail. • They are coded from scratch for each algorithm. • They are easier to create, understand and maintain.

  38. Domain Analysis Is there a potential for the domain to enlarge over time? • Design for growth. • Use object-oriented design. • Provide extensive documentation.

  39. 3.1.6. Resources’ Analysis Given the above information, do we have the necessary resources to create the algorithm visualization? • Time. • Human resources. • Computer resources.

  40. Resources’ Analysis Time • Designing and implementing algorithm visualizations takes longer than expected. Human resources • Need a team of developers with skills in context, graphical design, networks, etc.

  41. Resources’ Analysis Computer resources • CPU speed, RAM, monitor size and resolution, audio/video input and output, color display panel and projection. • If the prepared visualization will be available over the internet, it might need large amounts of storage space, and more importantly, high-speed connection to the net.

  42. 3.2. Design Phase • Choosing specification method. • Choosing techniques for visual representation of information.

  43. 3.2.1. Specification Methods Choices available to the developers: • Predefinition (hand-coded visualization) • Annotation • Declaration (animation by demonstration)

  44. 3.2.1. Specification Methods Predefinition (hand-coded visualization) • Mainly used in application-specific visualization. • Fixed or highly constrained mapping of the steps of the algorithm to the graphical views. • The information and its representation cannot be changed after the implementation. • The main advantage is the execution speed. • Can be easily distributed. • Can be very interactive and visually attractive.

  45. Specification Methods Annotation • Important steps of an algorithm are annotated with interesting events. • These events call graphical operations from an existing library. • For example, move rectangles, change colors, etc. • The main advantage of this approach is the animators ability to define events at any suitable level.

  46. Specification Methods Annotation • The most significant shortcoming of this method, is the need to access and modify the code of the program. • The first major system with interesting events was BALSA by Brown. • Other examples: Zeus and Tango.

  47. Specification Methods Declaration • The developer defines mappings from program states to graphical objects. • During program execution, changes in the program state trigger updates to the graphical view of the program. • This paradigm is instantiated in the Pavane animation system by Roman, Cox, Wilcox and Plun.

  48. 3.2.2. Techniques Some techniques for visual representation of information about algorithms. • Selection of default visualizations. • Screen design and multiple views. • Color and Sound. • 3-Dimension. • Interaction .

  49. Selection of Default Visualization Design appropriate default visualizations • How much complexity does the user of algorithm visualization need? • The complexity of visual presentations is generally proportional to the amount of information being conveyed. • Start with relatively small problem instances and gradually introduce larger ones for the users who begin to understand the meaning of the visual patterns.

  50. Selection of Default Visualization Design appropriate default visualizations • For pedagogical purposes, the following input data should be provided as default visualizations: • Pathological input data • Cooked input data

More Related