Directed vs Undirected RootedTrees
by Laurie L. Lacey, Ph.D., Schenectady County Community College, Schenectady NY, USA, laceyll@gw.sunysccc.edu, 2004 Laurie L. Lacey
NOTE: This worksheet constructs a maplet that can be used by the student in a Discrete math class to investigate trees.
Introduction
When this maplet is run, it allows the student to examine various aspects of rooted trees. The results from Dijkstra's algorithm for shortest path spanning tree, Floyd's allpairs shortest path algorithm, and Prim's Algorithm may be examined. The maplet opens with a window asking the student to input either a directed or undirected graph. A different Maplet appears depending on the student's response. The maplet was constructed using Maple 9.5
This is a simple maplet that is designed to introduce some basic graph theory concepts regarding trees. The reader is encouraged to add basic error routines and to modify the maplet to include other features. Sample graphs have been entered so that the student can see the syntax. The graphs are assumed to be connected. The student should note that, sometimes, in a directed graph, a spanning tree or shortpathtree cannot be found from an arbitrary vertex; the result will not be a tree. If a tree is entered, then the shortpathtree and spantree commands return the given tree. Depending on the graph and the chosen root of the tree, the shortpathtree and the spantree could be the same. If the graph is a transport network then the vertex chosen as the root of the desired tree should be the source of the network, otherwise the algorithm might not result in a tree. It is important to clear the fields and restart the Maplet before entering new graphs. The notation and format were adapted from the Maplet Tutorial available with Maple 9.5 [1]. My thanks to Sylvain Muise [2] for the inspiration on how to make the tables of the daughter, ancestors, and allpairs commands to appear in the MathMLViewer.
[1] Examples, Maplet Tutorial , Maple 9.5, Maplesoft Corporation 2004.
[2] Sylvain Muise, Artificial Neural Network Maplet, Maplesoft Applications CenterWebsite, 2002.
Disclaimer: While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.