Application Center - Maplesoft

App Preview:

Graph Analysis Maplet

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Graph Analysis Maplet

by Patti Bodkin and Whitney Sherman, Saint Michaels College, Colchester VT, USA, wsherman@smcvt.edu, pbodkin@smcvt.edu, 2004

This work supported by the Vermont Genetics Network through the NIH Grant Nmber 1 P20 RR16462 from the BRIN program of the NCRR.

Initialization

> restart;

Maplet Definition

> with(Maplets[Elements]):
with(networks):#The networks package is accessed so that we may use Maple tools to examine graphs and their properties.

> maplet := Maplet( Window( 'title'="Graph Analysis Maplet" ,
        BoxColumn('vscroll'='always',

        BoxRow(Button("Clear Fields", Action(SetOption('TF1' = ""), SetOption('TB1'=""),

                 Evaluate( 'PL1'= ""), SetOption( 'ML1'=""))),

               Button("Help", onclick=RunWindow('Help')),

               Button("About", onclick=RunWindow('About')),

               Button("Close", Shutdown(['TF1']))),

       BoxColumn(["Enter a graph ", TextField['TF1'](75,                                                value="graph({1,2,3,4,5},{{1,2},{3,4},{2,3},{2,4}, {1,5}, {4,5}})")],

        

        BoxColumn(["Basic Attributes: ", Button("Diameter", Evaluate('TB1'='diameter(TF1)')),

                   Button("Girth", Evaluate('TB1'='girth(TF1)')),

                   Button("Degree Sequence", Evaluate('TB1'='degreeseq(TF1)')),

                   TextField['TB1'](45)]),

        

        BoxColumn(["Graph Polynomials:  ","Enter x value: ", TextField['TFx'](10,value="x"),         "Enter y value (Tutte & Rank poly only): ", TextField['TFy'](10, value = "y")]),

        BoxColumn([Button("Charpoly", Evaluate('TB2'='charpoly(TF1,TFx)')),

                   Button("Chromatic", Evaluate('TB2'='chrompoly(TF1,TFx)')),

                   Button("Flow", Evaluate('TB2'='flowpoly(TF1,TFx)')),

                   Button("Spanning", Evaluate('TB2'='spanpoly(TF1,TFx)')),

                   Button("Acyclicity", Evaluate('TB2'='acycpoly(TF1,TFx)')),

                   Button("Tutte", Evaluate('TB2'='tuttepoly(TF1,TFx,TFy)')),

                   Button("Rank poly", Evaluate('TB2'='rankpoly(TF1,TFx,TFy)'))]),

        TextBox['TB2']()),  

        BoxColumn([Button("Draw Graph", Evaluate('PL1'='draw(TF1)')),

                   Button("Spanning Tree", Evaluate('PL1'='draw(spantree(TF1))')),

                   Button("Adjacency Matrix", Evaluate('ML1'='adjacency(TF1)'))]),      

       BoxRow( Plotter['PL1'](height=300, width=300), MathMLViewer['ML1']('value' = MathML[Export](" "), height=300, width=300))

                        

                                                                  

)),


        Window['About']('title'='About', 'layout'='AboutLayout', height=400, width=400),

        BoxLayout['AboutLayout'](

                BoxRow(Label(

                ################### Text For About Window ##############

                "




       Created by Patti Bodkin and Whitney Sherman

        with the assistance of Jo Ellis-Monaghan.


Saint Michael's College, Colchester, VT 05439


pbodkin@smcvt.edu, wsherman@smcvt.edu, jellis-monaghan@smcvt.edu.


This work supported by the Vermont Genetics Network through the NIH Grant Nmber 1 P20 RR16462 from the BRIN program of the NCRR.


This Maplet was based on a Graph Tutor Maplet created by Laurie Lacey."

                ###################End of Text#########################

        ))),

    

        Window['Help']('title'='Help', 'layout'='HelpLayout', height=450, width=450),

        BoxLayout['HelpLayout'](

                BoxRow(Label(

                ############### Text for Help Window ################

"This maplet allows the user to compute a variety of graph polynomials as well as simple features such as the diameter, girth and degree sequence.  It will also plot the graph, the spanning tree and display the adjacency matrix.


Enter a graph in the top text field using Maple format, such as:  graph({1,2,3,4,5},{{1,2},{3,4},{2,3},{2,4}, {1,5}, {4,5}}), or one of Maple's built-in graphs, such as petersen(), cube(3), etc.  The Adjacency Matrix Maplet may be used to generate the Maple code for a graph, and the output from the Adjacency Matrix Maplet can then simply be pasted into the top text field.

  "

                ################## End of Text ####################

                )))):

Display Maplet

> Maplets[Display](maplet);

>