Here are two "helpful files" for doing some computations on graphs.

This file contains the commands (Right Click and choose "Save Link As").

This file contains a demonstration of their use (Right click and choose "Save Link As").

Download and save both files in a directory you can locate. Note that hitting "Open" on your browser whenever you click those files, if prompted, is a GREAT way to lose the files and have no idea where they are stored. Instead, choose "Save to disk" and select a location.

Open the file named "VigreDemo.mws" in Maple. You must edit the first line to show the complete path to where your file is saved (if someone knows a better way, please let me know!). The best way I know to find the complete path is to go to a web browser and go to "File->Open File" and find and open the file here. The browser should display the file (though you may ignore its contents). From the address line, you can copy and paste the address given. Remove the "file:///" and replace any %20 crazy characters it inserts with spaces.

Now you may execute the commands in the file and they should work. There should be a message at the top which says "Added Commands:..." if everything loaded correctly. If you do not see this, something probably went wrong with your path.

All the commands below take as input objects which are of type "graph" in Maple's networks packages. The file above loads the package networks and so you needn't do anything more to use it. If you want to do anything besides the basic things which are listed here and demonstrated in the file, you may need to make some graphs by hand. In this case, I highly recommend that you read the help files for the graph command as well as a few others. If you want to define a "whole class of graphs" as I have done with NPath, you will soon note that in order to do this, you must use proc's in Maple. If you do not know what this is, then you probably won't be successful alone and should ask me or someone else for help. You can see some examples of this inside the file I wrote, but you may find it confusing considering I didn't properly comment on my commands there.

Useful commands to read more about in the Maple Help Files: graph, cycle, complete, draw, adjacency, charpoly. Type ?networks for a list of all commands in the networks package in Maple.

Here are the commands which are in the file currently. Since I wrote these commands, there is no help file for them. This is it! If something doesn't work, let me know and send me your maple file if possible and I'll try to see how to fix it. As far as I know, these commands do work, however. All of these graphs assume the input graph has vertices named by 1,2,...,n since that's easier to program. If there comes a time when more flexibility is needed, I can probably do better.

**LapG(graph)** This returns the Laplacian Matrix of the graph

**DegG(graph) **This returns the Degree Matrix of the graph

**SNF(graph)** This returns the diagonal of the Smith Formal Form of the Laplacian of the graph

**fSNF(graph)** This returns the SNF(graph) with each integer factored

**oSNF(graph)** This returns only the nonzero and non-one elements of SNF (it returns a 0 if there are no non-zero, non-one elements!)

**ofSNF(garph)** This factors the oSNF output

**gdunion(list_of_graphs)** This returns a graph which is the (relabeled) disjoint unionof the graphs in the list. You must input these as a list. In Maple, a list is enclosed in square brackets with a comma between each entry.

**NPath(integer)** This returns a path with integer number of EDGES!

**ModPath(A,M,N) **This returns a path with N vertices which connects all vertices which are congruent to A mod M.

**ParPath(integer)** This returns a "parallel path." on integer vertices i.e. a path which connects the odd vertices 1,3..., and the even vertices 2,4,...

**SkipN(M,N)** This returns a graph with N vertices such that every vertex is connected to its neighbor M vertices away.

**DisPaths(list_of_sizes) **This returns a graph which is a disjoint union of paths of the lengths [n_1,... n_m] specified in the list. (Note it will contain sum(n_i+1,i=1..m) vertices)

**LineGraph(graph)** This returns a line graph of the input graph.

**KRho(integer, subgraph)** This returns a graph which is the complement of the subgraph in a complete graph of integer size.