810 likes | 1.76k Views
Algorithm Visualization (AV). Pei-Chia Chang Supervised by: Dr. Jan Stelovsky Nov 19, 2004. Algorithm. A set of instructions or procedures for solving a problem.[1] A rule, set of rules or a formula for solving a problem. A set of computer statements for doing a particular job [2].
E N D
Algorithm Visualization(AV) Pei-Chia Chang Supervised by: Dr. Jan Stelovsky Nov 19, 2004
Algorithm • A set of instructions or procedures for solving a problem.[1] • A rule, set of rules or a formula for solving a problem. A set of computer statements for doing a particular job [2]
Algorithm Visualization (AV) • AV is the use of computer graphics and animations to help illustrate and present algorithms. [3] • So why use AV?
Motivation • Algorithm – the method to tell computer to do things for you. • Is there any better visual interface for programmers and students to trace codes? • What utility can help programmers develop programs faster? • How the abstract ideas work? • Collaborative visualization?
What makes programming hard? • An experiment carried out by S. A. Curtis, Oxford Brookes University[4] • For learning basic programming skills: • Some people have difficulties getting problem solution out of their head and into code.
What makes programming hard? • The learning gap ? Problem statements Program codes
What makes programming hard? • The Challenge: • when a student can solve it subconsciously but not consciously.
Mental Models and Programming • Two types of mental model: • Functional models (how to use the system) • Structural mental models (how a certain system works ) • http://www.cs.umd.edu/class/fall2002/cmsc838s/tichi/knowledge.html • Initially, students have a functional mental model of what computers/programs do ...but a poor structural mental model • Ultimately, we want students to have a good structural model of programming • being able to program necessitates understanding of structure
Solution • Examples!
But graph not • http://functions.wolfram.com/ElementaryFunctions/Sinh/visualizations/15.html http://www.codeguru.com/Cpp/Cpp/algorithms/article.php/c5129/
Visualization Effectiveness • Provide a reasonable, visual interface to the underlying theories. • Provide program understanding. • Can be used in teaching to help students understand how algorithms work, and they can be used in program development as a way to help programmers understand their code better.
Information visualization • Visualization technique • Interaction and distortion technique
Visualization technique • Standard 2D/3D displays, such as bar charts and x-y plots. • Geometrically transformed displays • Icon-based displays • Dense pixel displays • Stacked displays
Stacked displaysTreemaps[http://www.cs.umd.edu/hcil/academics/courses/fall1999/cmsc838s/presentations/johnson.ppt]
Stacked displaysDimensional stacking[http://davis.wpi.edu/~xmdv/vis_dimstack.html]
Interaction and distortion technique • Interactive projection • Interactive filtering • Interactive zooming • Interactive distortion • Interactive linking and brushing
Interactive projection[http://www.jstatsoft.org/v02/i06/paper.pdf]
AV examples • A 3D View of Heap sort • A 2D view with interactions
A 3D View of Heap sort [http://www.research.compaq.com/SRC/zeus/heapsort3D.html]
AV: Heap sort • Visualization technique used: 2D, 3D display • Interaction and distortion technique used: zooming, distortion
Reviews • Not adaptive. • Have to create a new visualization effect for each algorithm. • Not modularization
Thoughts • Take advantage of the OOP! • The magic XML tags. • How JAVA become successful! – modularization, reuse ability • The power of collaborative programming. • Extendable Algorithm Visualization. (EAV)
EAV Framework Controller Utility Interface View1 Parser View2 UserCodes Database View n
Hit the road • Start with education: • ICS311 is not difficult anymore. • The cognitive process can now be validated.
Extendable Algorithm Visualization How? • Create visual packages. • Use tags • Embedded in IDE/compiler
Visual packages • Extend existing Java packages and add visual effects. • Need a “stage/platform/container” to perform the animation • Pros: extensibility, can be customerized • Cons: need good API, documents and must be easy to use, otherwise, programmers won’t bother to use it.
Tags • Use tags to specify the purpose and location of a given code section. • Use attributes in the tags to indicate the visualization effect. • Pros: extensibility, can be customerized • Cons: need a parser, programmers need to learn another language (for tags).
Embedded in IDE/compiler • Provide user interface for programmers to specify the visual effects. • Embedded all the annoying work in IDE/compiler • Pros: less work for programmers, easy to use with good UI. • Cons: Huge tasks! Infeasible. Need to write a parser, and produce the result.
However, studies reveals.. • AV is good for beginner but several studies discovered that AV is not that powerful if there’s no interactions. • Also, for advanced students, there’s no significant differences.
Scenarios.. • Algorithm animation for CS beginner. • Visualized Debugger for advanced programmers!
Extendable Algorithm Visualization • Create your own algorithm!!
Evaluations • Experiments with beginners. • Experiments with senior students. • Visual Debugger scenarios
References • [1]www.davcomuk.co.uk/files/tech/glossary.htm • [2] www.oznet.ksu.edu/ed_asi490/Glossary/cgw.htm • [3] Algorithm Animation http://www.research.compaq.com/SRC/zeus/home.html • [4] http://wwwcms.brookes.ac.uk/ltg/docs/seminars/DiffLearnProg.ppt • [5] Software Visualization Arne Frickhttp://www.info.uni-karlsruhe.de/~frick/SoftVis/ • [6] Daniel A. Keim, Information Visualization and Visual Data Mining, IEEE TRANSACTIONS ON VISUALIZATION AND COMPUTER GRAPHICS, VOL. 7, NO. 1, JANUARY-MARCH 2002
References • [7] CHRISTOPHER D. HUNDHAUSEN, SARAH A. DOUGLAS ANDJOHN T. STASKOz, “AMeta-Study of AlgorithmVisualization E¡ectiveness”, • [8] D. Tang C. Stolte and P. Hanrahan, “Polaris: A system for query, analysis and visualization of multi-dimensional relational databases,” Transactions on Visualization and Computer Graphics, 2001. • [9] J. Abello and J. Korn, “Mgv: A system for visualizing massive multi-digraphs,” Transactions on Visualization and Computer Graphics, 2001. • [10] N. Lopez M. Kreuseler and H. Schumann, “A scalable framework for information visualization,” Transactions on Visualization and Computer Graphics, 2001.
Appendix • More AVs • http://www.research.compaq.com/SRC/JCAT/
Structural and Functional mental models • In the early 1980's, two basic mental models were identified, which are Structural and functional models. Structural models define facts the user has about how a certain system works. Its basic advantage is that the knowledge of how a device or system works can predict the effect of any possible sequence of actions, meanwhile constructing such a model in mind involves a great deal of effort .On the other hand, functional models, also called task-action mapping models, are procedural knowledge about how to use the system. The main advantage of functional models is that they can be constructed from existing knowledge about a similar domain or system. Structural models are context free while functional models are context sensitive. • http://www.cs.umd.edu/class/fall2002/cmsc838s/tichi/knowledge.html