Exploring the dynamics of graph algorithms
J Vis
https://doi.org/10.1007/s12650-022-00885-0
R E G UL A R P A P E R
Michael Burch
•
Huub van de Wetering • Günter Wallner • Freek Rooks • Olof Morra
Exploring the dynamics of graph algorithms
Received: 7 February 2022 / Revised: 23 July 2022 / Accepted: 31 August 2022
The Author(s) 2022
Abstract In this paper, we describe an interactive visualization tool for representing the dynamics of graph
algorithms. To reach this goal, we designed a web-based framework which illustrates the dynamics as timeto-space mappings of dynamic graphs. Such static diagrams of dynamic data have the benefit of being able
to display longer time spans in one view, hence supporting the observer with comparison tasks which is
challenging or even impossible for graph algorithm animations. Our tool can show details about how an
algorithm traverses a graph step-by-step in a static and animated fashion, for graph algorithm exploration as
well as educational purposes. The animation together with the time-to-space mapping hence forms an
overview-and-detail approach. We also allow changing of speed, replaying, stopping, storing intermediate
stages with parameter configurations, as well as measuring and monitoring performance and memory
consumption to eventually identify bottlenecks in a graph algorithm. By using flight carrier data from the
United States Department of Transportation and a network of autonomous systems we demonstrate how we
used the tool to explore two standard graph-theoretic algorithms. Finally, we discuss scalability issues and
limitations.
Keywords Algorithm animation Algorithm dynamics Graph visualization
1 Introduction
Algorithms are useful mechanisms in nearly any discipline of computer science to transform data. Graph
algorithms (Euler 1741) are a special type thereof that process relational data, for example, to find an
efficient or suitable solution to a graph-theoretic problem that is typically linked to a real-world application
M. Burch (&)
Center for Data Analytics, Visualization, and Simulation, University of Applied Sciences, Ringstrasse 40, 7000 Chur,
Graubünden, Switzerland
E-mail:
H. van de Wetering F. Rooks O. Morra
Department of Mathematics and Computer Science, Technische Universiteit Eindhoven, PO Box 513, 5600MB
Eindhoven, The Netherlands
E-mail:
F. Rooks
E-mail:
O. Morra
E-mail:
G. Wallner
Institute of Computer Graphics, Johannes Kepler University Linz, Altenbergerstraße 69, 4040 Linz, Austria
E-mail:
M. Burch et al.
(von Landesberger et al. 2011). Finding shortest paths in a road network (Greilich et al. 2009), detecting
connected components in a social network (Bedi and Sharma 2016), or identifying call hierarchies in a
software system (Burch et al. 2017) are different applications.
Typically, a graph algorithm is running for a certain amount of time until it provides a solution to a given
graph-theoretic problem. For many purposes a visual outcome is sufficient. However, it might be insufficient
if the result is not understandable, wrong, or even misleading, and someone wants to understand the
intermediate steps to identify the problem. Moreover, exploring the graph algorithm under different circumstances such as adding or deleting vertices, edges, or even changing weights might lead to different
outcomes that are worth investigating and comparing. Existing algorithm visualizations have been mostly
used for educational purposes (Baecker 1998) and typically only small examples are involved. In this paper,
we focus on larger graphs and provide a way for exploring the graph algorithm dynamics in a visual way.
For this reason, we have developed a visual analysis tool that accepts graph data (Eades and Klein 2018)
as input and provides solutions to an (extendable) repertoire of graph algorithms. The tool does not only
provide a solution in a visual form but also offers the possibility to show the intermediate steps, either as a
static time-to-space mapping of a dynamic graph (Beck et al. 2017; Burch et al. 2017) or in an animated
fashion (Diehl and Görg 2002; Frishman and Tal 2004) as a time-to-time mapping. Together, these two
views form an overview-and-detail approach (Cockburn et al. 2008) where the time-to-space mapping
serves as an overview and the animation offers a detailed view on the operations performed in each step.
During execution, the tool permits changes to the graph to allow the user to observe the impact of them.
The user can choose one or both mappings, apply interactions (Yi et al. 2007) to both of them, and can
view performance metrics such as memory consumption and running times of the applied algorithm for
intermediate steps and time spans. With this combination, we not only provide an overview about graph
algorithms but also additional information about the intermediate steps. At the same time, the user can
navigate to relevant steps in the algorithm, for example, by playing an animation covering a (short) period of
time for illustrative purposes.
At the same time, our tool can still be used for educational purposes (Burch and Melby 2019) due to the
combination of algorithm animation and static visualizations for the dynamic aspects. In the following, after
reviewing related work, we first describe our interactive web-based visualization tool and then apply it to
graph datasets of varying sizes and several runs of Dijkstra’s shortest path algorithm (Dijkstra 1959) as well
as Prim’s algorithm for computing minimum spanning trees (Prim 1957). Hereby, we identify formerly
summarized tasks and how they can be answered by using our tool. Finally, we discuss limitations and
scalability aspects and provide a perspective on future challenges and open gaps.
This article is an extension of a paper published at VINCI 2021 (Burch et al. 2021). Compared to Burch
et al. (2021) this extended version has the following additions while at the same time increasing the number
of figures:
• We extended the related work section by reviewing more papers on algorithm animation as well as
dynamic graph visualization (Sect. 2).
• To better understand the mathematical concepts behind this line of research we included a data model
(Sect. 3.)
• We also extended the tasks and design decisions section to better illustrate the usefulness of the proposed
technique (Sect. 4.2).
• To make a clearer comparison between the two major visual concepts we added a more thorough
perspective on and description of time-to-space and time-to-time mappings (Sects. 4.3 and 4.4).
• Insights on performance measures are now included to provide an additional perspective on the graph
algorithms (Sect. 4.5).
• An additional application example (Prim’s algorithm) showcases the value of the approach further
(Sect. 5.2).
2 Related work
Showing the dynamics of a graph algorithm can be viewed as the problem of visualizing a sequence of
graphs, either as an animation or as a static representation of the graphs side-by-side (Beck et al. 2017). A
graph algorithm takes (...truncated)