The computation of a minimum spanning tree (MST) is a fundamental topic in any algorithms course. In this paper, we outline a series of projects based on a thorough exploration of the performances of two well-known MST algorithms: Prim’s and Kruskal’s. For a graph of n nodes and e edges, both run in O (e lgn) time but these results are based on picking the right data structures. Prim’s relies on a priority queue that supports priority modification in O (lgn) time while Kruskal’s relies on a disjoint-set that supports find/union operations in O (lgn) time. The performance ramifications of using simpler data structures allow students to thoroughly understand the operations of these two algorithms, get a deeper comprehension of asymptotic complexity analysis, negotiate empirical results with analytical predictions, and illustrate the value of “programming to the interface”. Our study also includes the performance consequences of the qualities of the graphs on which MSTs are computed: structure (random vs scale-free), density (sparse vs dense), and edge cost distribution. Finally, as an additional inquiry to engage students in a somewhat unexplored direction, we focus on the average pairwise-distance of the MSTs produced by Prim’s vs Kruskal’s.
[1]
Walter L. Bateman.
Open to Question: The Art of Teaching and Learning by Inquiry
,
1990
.
[2]
Tony Clear,et al.
Developing a Holistic Understanding of Systems and Algorithms through Research Papers
,
2017,
ITiCSE.
[3]
John R. Staver,et al.
Analysis of the project synthesis goal cluster orientation and inquiry emphasis of elementary science textbooks
,
1987
.
[4]
Grant Braught,et al.
Empirical investigation throughout the CS curriculum
,
2000,
SIGCSE '00.
[5]
Michael J. Prince,et al.
Inductive Teaching and Learning Methods: Definitions, Comparisons, and Research Bases
,
2006
.
[6]
ReedDavid,et al.
Empirical investigation throughout the CS curriculum
,
2000
.
[7]
Éva Tardos,et al.
Algorithm design
,
2005
.
[8]
J. Ángel Velázquez-Iturbide,et al.
Active learning of greedy algorithms by means of interactive experimentation
,
2009,
ITiCSE.