Keywords

1 Introduction

Graph is the most common “abstract” structure encountered in computer science. Any system that consists of discrete states (or sites) and connections between them can be modeled by a graph. Graphs are used almost everywhere in computer science and are routinely included in many courses in undergraduate and graduate programs.

Intricate nature of software systems and computer education systems can, and in our opinion should, be represented by graph models. Their wide applicability is due to the fact that graphs are a very natural way of explaining complex situations on an intuitive level. We are entirely convinced the future is “visual”, and the graph models are the best formalism for visual presentation of information of complex and intricate nature. The visualization of conceptual structure is a key component of support tools for complex applications in science and engineering [13]. Moreover, the information that is interested us in computer science and computer education is nonquantitative, but rather, of structural and relational nature. For this reason many graph visualization systems, graph editors and libraries of graph algorithms have been developed in recent years. Examples of these tools include VCG, daVinci, Graphlet, GLT&GET, yEd and aiSee.

Graph drawing is a useful way of representation of graph models, and visualization of graphs is used in many applications for the design and analysis of communication networks, related documents, as well as static and dynamic structures of programs. However, systems of related objects frequently are dynamic. For example, relations between objects or properties of objects can be changed. If transformation processes can be formalized and presented in the algorithmic form then it is useful to create a graphical representation of transformations. Animating an algorithm allows for better understanding of the inner workings of the algorithm, furthermore it makes apparent its deficiencies and advantages thus allowing for further optimization [4].

The size of the graph model to view is a key issue in graph visualization [2, 3]. Large graphs pose several difficult problems. If the number of graph elements is large it can compromise performance or even reach the limits of the viewing platform. Even if it is possible to layout and display all the graph elements, the issue of viewability or usability arises, because it will become impossible to discern between nodes and edges of graph model.

Academic research and engineering challenge both require high performance computing, which can be achieved through parallel programming. The existing curricula of most universities do not properly address the major transition from single-core to multicore systems and sequential to parallel programming. They focus on applying application program interface (API) libraries and open multiprocessing (OpenMP), message passing interface (MPI), and compute unified device architecture (CUDA)/GPU techniques. This approach misses the goal of developing students’ long-term ability to solve real-life problems by “thinking in parallel”.

We see that the history of computing has shown shifts from explicit to implicit programming. In the early days, computers were programmed in assembly language, mostly with the purpose of utilizing the available memory space as effectively as possible. This came at the cost of obscure, machine-dependent, hard to maintain programs, which were designed with high programming effort. High-level languages were introduced to make programming more implicit, portable and less machine-dependent. With the advent of massively parallel computers and their promise of hundreds of gigaflops, we have seen a return to the explicit programming paradigm. Using these languages with explicit message passing library routines as “machine languages”, people attempt to utilize the available processing power to the largest extent, again at the cost of high programming effort, machine-dependent, and hard to maintain code. A compiler for an implicitly parallel programming language alleviates the programmer from the task of partitioning program and data over the massively parallel machine.

Functional programming [5] is a programming paradigm, which is entirely different from the conventional model: a functional program can be recursively defined as a composition of functions where each function can itself be another composition of functions or a primitive operator (such as arithmetic operators, etc.). The programmer need not be concerned with explicit specification of parallel processes since independent functions are activated by the predecessor functions and the data dependencies of the program. This also means that control can be distributed. Further, no central memory system is inherent to the model since data is not “written” in by any instruction but is “passed from” one function to the next.

In the paper, we describe the graph- and cloud-based tools being under development at Institute of Informatics Systems and aimed at supporting of computer science education. The Web-systems Wiki GRAPP and WEGA intended to help in teaching and research in graph theory, graph algorithms and their applications to computer science are described. The visual systems Higres and Visual Graph for graph algorithms and graph models are presented. The CSS system based on hierarchical graph representations of functional and parallel programs and aimed at supporting of cloud supercomputing is considered.

2 Systems for Supporting of Graph Models and Methods

2.1 The Wiki GRAPP System

The problem of terminology is one of the main problems in application of graph methods to programming and computer science.

In 1999 our dictionary [6] was published, which covered main graph-related terms from monographs in Russian. It was the first dictionary of graphs in computing and it aroused a great interest of readers.

Our new dictionary [7] is an extended dictionary of 1999 and it includes more than 1000 new terms from journal articles whose abstracts were published in Abstract Journal “Mathematics” in section “Graph Theory”, as well as from volumes of annual conferences “Graph-Theoretic Concepts in Computer Science” and book series “Graph Theory Notes of New York”. The dictionary contains more than 2500 graph-related terms with their clear and succinct definitions.

We are developing the Wiki GRAPP system [8] as an on-line “edition” of the dictionaries of graph-theory and its applications to computer science and programming (See Fig. 1).

Fig. 1.
figure 1

The Wiki GRAPP system.

Like Wikipedia the Wiki GRAPP system runs on the MediaWiki system, but now only certain editors are able to modify it. At present it includes definitions of about 4500 terms and covers all terms from our dictionaries.

2.2 The WEGA System

The Web-Encyclopedia of Graph Algorithms (WEGA) [8] being under development on the basis of the books [9, 10] and the MediaWiki system is aimed to be not only a reference manual on graph algorithms but also an introduction to the graph theory and its applications to computer science.

In contrast to Donald Knuth who used the assembly language of the so-called MIX computer in his fundamental books “The art of computer programming”, we decided to use a high-level and language-independent representation of graph algorithms in our books and system (See Fig. 2).

Fig. 2.
figure 2

General algorithm for arc-based traversals of graph

In our view, such an approach is preferential, as it allows us to describe algorithms in a form that admits direct analysis of their correctness and complexity, as well as a simple translation of algorithms to high-level programming languages without disturbance of their correctness and complexity. Besides, the described approach allows the readers to understand an algorithm at the informative level, to evaluate its applicability to a specific problem, and to make all its modifications needed for correct application of the algorithm.

We also believe that visualization could be very helpful for readers in understanding graph algorithms, and we are embedding capabilities of interactive animation of graph algorithms into the WEGA system.

For constructing of graph algorithm visualizations we use the Higres system (see below) and a subsystem ALVIS.

The ALVIS system has been created on the base of a model of interactive visualization of graph algorithms, providing the capability to build the algorithm visualization with the help of a flexible system of visual effects and using the algorithm as an input parameter [11].

The ALVIS system implements visualization in following two steps.

First, the algorithm text is transformed into a program ready for execution; after that the program is executed with the given graph as a parameter. The result is a log of items, each of which contains information about changes in the graph model state.

Second, the visualizer receives the input graph, the original algorithm text, the log of execution and visual effects settings. As a result, the visualization system works out a sequence of images corresponding to the graph model of intermediate states of the algorithm.

2.3 The Higres System

The Higres system was developed as a visualization tool and an editor for graphs and as a platform for execution and animation of graph algorithms implemented via so-called external modules [12].

The Higres system can be used for the run-time visualization of graph algorithm (See Fig. 3). It also caches samples for the repeated and backward animation. A set of parameters can be defined inside a module. These parameters can be changed by the user at any execution step. The module can ask user to input strings and numbers. It can also send any textual information to the protocol that is shown in the process window. The animation feature can be used for algorithm debugging, educational purposes and exploration of iteration processes such as force methods in graph drawing.

Fig. 3.
figure 3

The Higres system: finite automaton emulation.

We provide a special API that can be used to create external modules. The API includes functions for graph modification and functions that provide interaction with the Higres system. It is unnecessary for programmer, who uses this API, to know the details of the internal representation of graphs and system/module communication interface. Hence, the creation of new modules is a rather simple work.

At present we have external modules for animation of various kinds of graph algorithms: from graph layout methods, that deal only with drawing of a graph in a plane, to complex semantic processing of graph models such as Petri net simulation or block-scheme program execution (See Fig. 4).

Fig. 4.
figure 4

The Higres system: block-scheme program execution.

2.4 The Visual Graph System

The Visual Graph system is intended to visualize and explore large and complex abstract forms of information represented by large graphs, e.g. graphs automatically generated by optimizing compilers or other applications.

The system reads a textual and human-readable GraphML-specification [13] of an attributed hierarchical graph [11, 14] and automatically calculates its customizable multi-aspect layout (drawing). This layout is then displayed, and can be interactively explored, extended and analyzed by user.

Visual Graph was designed to visualize and explore large graphs that consist of many hundreds of thousands of elements. In order to reduce time for work with a graph, it is possible to avoid computing the layout of its parts that are currently not of interest. Interactive exploring of a graph is based on step by step construction of its multi-aspect layout being a set of drawings of some its subgraphs. For presentation of multi-aspects layout a set of windows which includes a separate window for visualization of each considered subgraph is used. At each step of layout algorithm it is applied to a subgraph being interested to user at this step. Multi-aspect layout of a graph makes every visible part of the graph smaller, thus enabling the layout to be calculated faster and the quality of the layout to be improved.

Visual Graph offers several tools for navigating through a graph model: minimap, navigator, attribute panel, filter, search panel, notebook (See Fig. 5). It provides also tools for analyzing graph structures. This analysis means solving advanced questions that relate to a graph structure, for instance, determining for a graph all its beconnected components or dominance relation between its nodes.

Fig. 5.
figure 5

The Visual Graph system.

Simple possibilities to extend the functionality of Visual Graph (e. g. to add a new layout, search, analysis or navigating algorithm, a new tool for processing information associated with elements of graph models and so on) are provided.

3 Cloud System for Supporting of Functional and Parallel Programming

3.1 The CSS System

The advancement of computer technology and the increasing complexity of research problems are creating the need to teach parallel programming in higher education more effectively. Programming massively-parallel machine is a daunting task for any human programmer and parallelization may even be impossible for any compiler. Instead, the functional programming paradigm may prove to be an ideal solution by providing an implicitly parallel interface to the programmer.

The CSS system is based on hierarchical graph representations of functional and parallel programs and is intended to provide a general-purpose user interface for a wide range of parallel processing platforms (See Fig. 6). In our conception, cloud interface gives transparent ability to execute programs on arbitrary environment. JavaScript client does not demand installation; small educational programs can be executed on client devices (computers or smart phones). V8 server allows the language parser and some optimizations to be used at both client and server sides.

Fig. 6.
figure 6

Cloud service structure: 1, 2 and 3 – clients, 4 – cloud access server, 5 – execution environment

The CSS system uses a functional language Cloud Sisal and includes five big parts: interface, interpreter, graphic visualization/debugging subsystem, optimizing cross compiler, cluster runtime. The interpreter is available on web via browser; it translates Cloud-Sisal-program to the first internal representation (IR1) and runs it without making actual low-level code. It is useful because in this case a user can get any debugging information in visual forms of hierarchical graphs [11, 14].

Web interface also contain some usual parts like syntax highlighting, persistent storage for program code, authorization and so on.

The CSS system provides means to write and debug Cloud-Sisal-programs on low-cost devices as well as to translate and execute them in clouds. The CSS system can open the world of parallel and functional programming to all students and scientists without requiring a large investment in new, top-end computer systems.

3.2 Cloud Sisal

Functional language Sisal (Steams and Iterations in a Single Assignment Language) is considered as an alternative to FORTRAN language for supercomputers [15, 16]. Compared with imperative languages (like FORTRAN), functional languages, such as Sisal, simplifies programmer’s work. He has only to specify a result of calculations and it is a compiler that is responsible for mapping an algorithm to certain calculator architecture. In contrast with other functional languages, Sisal supports data types and operators typical for scientific calculations (See Fig. 7).

Fig. 7.
figure 7

Sisal-program for matrix multiplication.

At present, there are implementations of the Sisal 1.2 language [17] for many supercomputers (e. g., SGI, Sequent, Encore Multimax, Cray X-MP, Cray 2, etc.). The Sisal 90 language definition [18] increases the language’s utility for scientific programming. It includes language level support for complex values, array and vector operations, higher order functions, rectangular arrays, and an explicit interface to other languages like FORTRAN and C.

The Sisal 3.2 language [19, 20] is a version of Sisal which integrates features of Sisal 90 and Sisal 2.0 [21] and includes language level support for module design, mixed language programming, preprocessing. The Sisal 3.2 language supports also so-called annotated programming [22] and includes optimizing annotations in the form of formalized comments being predicate constraints on admissible properties of program fragments or states of computations.

The Cloud Sisal language that has been designed as the input language of the CSS system is based on the Sisal 3.2 and increases the language’s utility for supporting of cloud scientific computations and cloud parallel programming.

3.3 Internal Representations

The CSS system uses three internal representations of Cloud-Sisal-programs: IR1, IR2 and IR3.

IR1 is a language of hierarchical graphs [11, 14] made up simple and compound computation nodes, edges, ports and types (See Fig. 8). Nodes correspond to computations. Simple nodes are vertices and denote operations such as add or divide. Compound nodes are subgraphs and represent compound constructions such as structured expressions and loops. Ports are vertices that are used for input values and results of compound nodes. Edges show the transmission of data between simple nodes and ports; types are associated with the data transmitted on edges. IR1-program represents data dependencies, with control left implicit; e. g. iteration is represented as a compound node with subgraphs describing generation of index values, the body of the loop, and the packaging of results.

Fig. 8.
figure 8

A function foo and its IR1-representation.

IR2 is an extension of IR1 but is not applicative. It introduces operations that explicitly allocate and manipulate memory and also introduces a new class of operations, which are similar to IR1 nodes except that they are told where in memory to construct their results. Also, artificial dependence edges are added to define additional synchronization constraints where they may be useful. Finally, data edges can be decorated with pragmas to specify access rights to the data they transmit and to allow operations to modify their inputs.

IR3 is a classical three-address code representation with hierarchical blocks.

3.4 Compiler

The compiler of the CSS system consists of two main parts: front-end and back-end compilers (See Fig. 9).

Fig. 9.
figure 9

The Cloud-Sisal-compiler and run time support.

The front-end compiler translates Cloud-Sisal-modules into a monolithic IR1-program which is used also by the interpreter and the graphic visualization/debugging subsystem.

The back-end compiler begins with R2Gen which produces a semantically equivalent program in IR2. Then the IR2Opt subsystem performs many machine-independent optimizations on the monolith to produce a semantically equivalent, but faster program. After completion of the machine-independent optimizations, the IR3Gen subsystem preallocates array storage where compile time analysis or compiler generated expressions executed at run time can calculate the final size of an array. The result of this phase is the production of a semantically equivalent program in IR3. The next phase (IR3Opt) performs update-in-place analysis and restructures some graphs to help identify at compile tune those operations that can execute in-place and to improve chances for in-place operation at run time when analysis fails. It performs also some machine-dependent optimizations and defines the desired granularity of parallelism based on an estimate of computational cost and various parameters that tune analysis. After parallelization, CodeGen generates C ++ or C# code, and the compilation can be completed using the target machine’s C ++ or C# compiler.

The current target platform for the Cloud-Sisal-compiler is .NET. The compiler generates the C# code. It allows the users to perform the experimental execution of Cloud-Sisal-programs and examine the effectiveness of optimizing transformations applied by the compiler.

4 Conclusion

The graph- and cloud-based tools being under development at Institute of Informatics Systems in Novosibirsk for supporting of computer science education were presented.

The Web-systems WikiGRAPP and WEGA intended to help in teaching and research in graph theory, graph algorithms and their applications to computer science were described. The WikiGRAPP system is a wiki-dictionary of graphs in computer science. The WEGA system is a wiki-encyclopedia of graph algorithms which is aimed to be not only a reference manual on graph algorithms but also an introduction to the graph theory and its applications to computer science.

The visual systems Higres and Visual Graph for graph models and graph algorithms were presented. The Higres system is a graph editor and a platform for execution and animation of graph algorithms. The Visual Graph system is intended to visualize and explore large and complex abstract forms of information represented by large attributed hierarchical graphs automatically generated by compilers and other applications.

The cloud system CSS aimed at supporting of functional and parallel programming for scientific computations was considered. The CSS system provides means to write and debug functional programs regardless target architectures on low-cost devices as well as to translate them into optimized parallel programs, appropriate to the target execution platforms, and then execute on high performance parallel computers without extensive rewriting and debugging.