Mobile Applications for Learning Shortest-Path Graph ...

4 downloads 59907 Views 408KB Size Report
Mobile applications were developed using Adobe Flash and were tested ... The education in the University of Rousse on the course "Synthesis and Analysis of.
International Conference on e-Learning and the Knowledge Society - e-Learning’11

Mobile Applications for Learning Shortest-Path Graph Searching Algorithms Tsvetozar Georgiev Abstract: The report describes one approach to teach students at the University of Ruse in the "Synthesis and Analysis of Algorithms" subject on the “Shortest-Path Graph Searching Algorithms” theme, using mobile multimedia applications. These applications provide the necessary theory as well as ability for students to build their own graphs and to observe the animation of the path searching methods – FloydWarshall and Dijkstra. Mobile applications were developed using Adobe Flash and were tested successfully with mobile devices HP iPAQ hx2790 and HTC Wildfire. Key words: m-Learning, Algorithms, Graphs.

INTRODUCTION Nowadays the mobile devices become more widespread and are increasingly used for many purposes. Fewer consumers use mobile devices only for a single purpose. The modern mobile devices support a growing range of additional applications - recording and playback of audio, video and pictures, connection to social networks, search and obtain data from the Internet and receive GPS information. At the same time the modern information and communication technologies provide an opportunity to use the mobile devices for mobile learning. The education in the University of Rousse on the course "Synthesis and Analysis of Algorithms" shows that students face considerable difficulties in learning the principles of algorithms for searching shortest paths in the graph. Possible solution is to use animation techniques that show how algorithms work step by step. On the other hand these algorithms are the base for the increasingly popular mobile navigational applications which many users use to search routes on a map. This report proposes an approach where mobile multimedia applications are used to reduce these students’ difficulties. Thus the interest of the students to study material will be greatly enhanced because they can use these applications on their own mobile devices and in an interactive way will learn about the algorithms used to search route on a map. The students will be able also to implement these algorithms on the same graph and this way to understand better the existing differences between them. LAYOUT The developed applications aim to help the training of students at the University of Ruse in the subject “Synthesis and Analysis of Algorithms”. They provide the necessary theoretical information about the graph path searching algorithms and ability to user to build own graph and to see the animations of these algorithms. For the purposes of students’ training two algorithms are selected - Floyd-Warshall and Dijkstra: • The Floyd-Warshall algorithm is used for an analysis of a weighted graph to obtain the shortest paths between all pairs of vertices [4, 5, 10]. • The Dijkstra algorithm is used to calculate the shortest path from one vertex to all others in the oriented graph with nonnegative arc weights [8, 9, 11]. It is used in computer science and logistics, where most often the shortest distance between two points is seek. The analysis of the existing solutions shows that for visualization of the algorithms for searching paths in a graph most often are used Java applications for desktop computers. For Floyd-Warshall algorithm such realizations are in the form of Java applets [2, 3]. Both solutions support step by step visualization of the solution. The disadvantage of the first application [2] is that the graphs are preliminary definite and the users can’t create their own graphs. The disadvantages of the second application [3] are worst graphics and non-

International Conference on e-Learning and the Knowledge Society - e-Learning’11

intuitive user interface. For Dijkstra algorithm there are also solutions in the form of Java applets [6, 7]. In these two applications the users can’t create their own graphs also. The common disadvantage of all these solutions is that they can’t be executed on mobile devices. 1. Requirements to the applications The main purpose of these mobile applications is to be used for introduction and training of students about two algorithms for path searching in the graphs. To achieve the desired result the following tasks were fulfilled: • An ability of the applications to work on the mobile platforms with different operating systems – Windows Mobile, Android, Apple OS. • Inclusion of theoretical information about two shortest-path graph searching algorithms – Floyd-Warshall and Dijkstra. • An ability for students to create their own graphs with own set of vertices and arcs and to input the weights of these arcs. • Realization of these two algorithms using the Flash programming language – ActionScript. • Development of an animation which to show step by step the principle of FloydWarshall algorithm. • Development of an animation which to represent step by step the principle of Dijkstra algorithm. • Development of intuitive and interactive graphical user interface. 2. Applications development For the development of the applications Adobe Flash platform and programming language ActionScript are selected. The reasons for this choice are that from one hand this development platform provides great opportunities for creating interactive multimedia projects and from the other hand Flash becomes a standard for creating and transmitting rich multimedia projects for desktop computers and mobile devices [1]. Both applications have identical navigational structure (Fig.1). They contain four sections - Main, Theory, Graph creation and Demonstration. Each section has connections with each of other three sections. This gives more flexibility during the educational process. For example the students can create a graph and after that to return to the Theory section and to remember the algorithm or to see the demonstration of the algorithm and after that to read the theory again.

Fig. 1. Navigational map of two mobile applications 2.1. Main section The first section of the applications gives brief text information about their purposes. It contains navigational buttons to other three sections. If the user goes to this section from Demonstration section, the already created graph is cleared and the user can create a new graph using Graph creation section.

International Conference on e-Learning and the Knowledge Society - e-Learning’11

2.2. Theory section The second section of the applications provides an opportunity for students to learn the theory of two algorithms for searching shortest path in a graph - Floyd-Warshall (Fig.2a) and Dijkstra (Fig.2b).

a)

b)

Fig. 2. Theory section a) for Floyd-Warshall algorithm; b) for Dijkstra algorithm As the text of the theoretical information is larger than the size of the text field the students must use a vertical scroll bar to view the other part of the information. 2.3. Graph creation section This section enables the user to select nodes of the graph, and then to input in a square matrix values of the weights of arcs between them (Fig.3a and Fig.3b). When the interface is designed the following limitations are taken into account: the small screen size of mobile devices in which all information can be visualized and the limited number of data input methods (stylus or fingers). After a lot of experiments is determined that most appropriate number of the vertices is ten. These vertices are arranged on preliminarily definite places forming an ellipse. This way the re-covering of the arcs from the vertices is avoided. The table for data input for the weight of the arcs is positioned in the bottom part of the screen. The name of the row and the name of the column in the table show the vertices which can be connected with an arc. This guarantees a comfortable work of the users with the applications.

a)

b)

Fig. 3. Graph creation section a) for Floyd-Warshall algorithm; b) for Dijkstra algorithm Initially, the user must choose the vertices. For this purpose he/she should click on them. In the table the relevant input fields become active and the user must enter a positive integer number or leave them blank. This number is the weight for a specific arc.

International Conference on e-Learning and the Knowledge Society - e-Learning’11

When a value is entered and the key Enter is pressed an arc between the relevant vertices is drown on the screen. If the input field takes a focus and after that the key Enter is pressed, the applications automatically display value 1 because they work only with positive integer numbers. If the input field is leaved blank an arc between relevant vertices is not drown on the screen, which means that there is no direct connection between them. After the creation of the weighted graph, the user can move to the next section Demonstration. 2.4. Demonstration section In this section only vertices selected by the user in previous section are displayed. On the screen the weight for each arc is also visualized. Based on the given values of the arcs and using the algorithm of Floyd-Warshall in one application and the algorithm of Dijkstra in other, the shortest path in the graph is searched.

a)

b) c) d) Fig. 4. Demonstration section a) and b) for Floyd-Warshall algorithm; c) and d) for Dijkstra algorithm

In the algorithm of Floyd-Warshall this section shows the graph and the state matrix (Fig.4a). In this matrix all data for the weight of arcs entered in the previous section is shown. The student must choose the start and the end vertices between which the shortest path to be calculated. Once the selection is made the user must click on the button "Step" repeatedly until all the shortest routes are calculated. In the algorithm of Dijkstra, using the button "Step", the user can go to the next vertex of the chosen path until he/she reach the final vertex (Fig.4b). For each vertex information for its parents, successors and level is displayed on the screen. Тhe student has an ability to move to the Graph creation section and to change some vertices and/or values of the weight of some arcs if it is necessary. After that the user can see the demonstration of the algorithm using new graph. 3. APPLICATIONS TESTING The developed applications are tested with embedded in the Flash mobile device emulator, as well as with real mobile devices – HP iPAQ hx2790 with an operating system Windows Mobile and installed Flash Lite 2.0 Player and HTC Wildfire with an operating system Android and installed Flash Lite 3.1 Player. The trials made with students confirm that the user interface of the applications is appropriate. During the testing there were no problems with the applications and in the logic of the algorithms. When a mobile device HP iPAQ hx2790 is used there are some difficulties to input information for weight of the arcs in the table because of small screen size (240x320 pixels). When a modern mobile device (like HTC Wildfire) with a larger screen size (320x480 pixels) is used there is no such problem.

International Conference on e-Learning and the Knowledge Society - e-Learning’11

CONCLUSIONS AND FUTURE WORK The developed mobile applications operate normally on mobile devices and on desktop computers. The preliminary tests, conducted using two different mobile devices, show that two searching algorithms developed on ActionScript programming language work properly and their animation is done correctly. The applications meet the requirements of interactivity allowing users to create their own graphs, to input weight values for the arcs and to monitor step by step the implementation of the algorithms. The developed applications will be used to support teaching process in the University of Ruse on the course "Synthesis and Analysis of Algorithms". The future work will include the applications trials with a wide group of students and an analysis how these applications increase the students’ knowledge. REFERENCES [1] Leggett, R., Boer, W., Janousek, S. (2006) Foundation Flash Applications for Mobile Devices, USA, Friendsoft. [2] All Pairs Minimum Routes Problem, http://students.ceid.upatras.gr/~papagel/ project/kef5_7_2.htm [3] All Pairs Shortest Paths, http://www.cs.man.ac.uk/~graham/cs2022/dynamic/ floydwarshall/ [4] All-Pairs Shortest Paths, http://compgeom.cs.uiuc.edu/~jeffe/teaching/algorithms/ notes/14-apsp.pdf [5] All-Pairs Shortest Path with Floyd-Warshall, http://www.cs.cornell.edu/~wdtseng/ icpc/notes/graph_part3.pdf [6] Dijkstra Algorithm, http://students.ceid.upatras.gr/~papagel/project/kef5_7_1.htm. [7] Dijkstra's Algorithm, http://www.cs.auckland.ac.nz/software/AlgAnim/dijkstra.html. [8] Dijkstra’s Algorithm, http://www.cse.ust.hk/~dekai/271/notes/L10/L10.pdf [9] Dijkstra's Algorithm as a Dynamic Programming Strategy, http://www.intag.org/ downloads/ds_006.pdf [10] Floyd’s Algorithm, www.cs.binghamton.edu/~dima/cs333/floyd.ppt [11] Solving Shortest Path Problem: Dijkstra’s Algorithm, https://netfiles.uiuc.edu/ angelia/www/ge330fall09_dijkstra_l18.pdf ABOUT THE AUTHOR Assoc. Prof. Tsvetozar Georgiev, PhD, Department of Computing, University of Ruse, Phone: +359 82 888 827, Е-mail: [email protected]

Suggest Documents