GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Packages : GraphTheory

GraphTheory

 

Calling Sequence

Description

List of GraphTheory Subpackages

List of GraphTheory Package Commands

Accessing the GraphTheory Package Commands

Examples

Calling Sequence

GraphTheory[command](arguments)

command(arguments)

Description

• 

The GraphTheory package is a collection of routines for creating graphs, drawing graphs, manipulating graphs, and testing graphs for properties. The graphs are sets of vertices (nodes) connected by edges. The package supports both directed and undirected graphs but not multigraphs or graphs with loops (self-incident vertices). The edges in the graphs can be weighted or unweighted.

• 

The main command for creating undirected graphs is the Graph command. The main command for creating directed graphs is the Digraph command.

• 

To draw a graph in Maple use the DrawGraph command.  The output is a Maple plot.

• 

To include a graph in a TeX or LaTeX document as a figure use the Latex command.

• 

To test if a Maple object G is a graph use the test: type(G,Graph).

• 

The ImportGraph and ExportGraph commands are for reading a graph from, and writing a graph to, a file in one of the supported data formats.

• 

The following commands are essential for working with large graphs: HasEdge, HasArc, AddEdge, AddArc, DeleteEdge, DeleteArc.

• 

The GraphTheory examples worksheet has a guided tour of the package.

• 

For details on the implementation of the GraphTheory package and its graph data structure, consult GraphTheory[Details].

List of GraphTheory Subpackages

• 

The SpecialGraphs package contains a library of predefined graphs.

• 

The RandomGraphs package has routines for randomly generating graphs.

List of GraphTheory Package Commands

• 

The following is a list of the commands in the main GraphTheory package.

  

Constructing Graphs

CanonicalGraph

CartesianProduct

CompleteGraph

CopyGraph

CycleGraph

Digraph

DisjointUnion

FundamentalCycle

Graph

GraphComplement

GraphIntersection

GraphJoin

GraphNormal

GraphPower

GraphUnion

InducedSubgraph

IntervalGraph

IsomorphicCopy

LineGraph

MakeDirected

MakeWeighted

Mycielski

NonIsomorphicGraphs

PathGraph

PermuteVertices

PlaneDual

RelabelVertices

ReverseGraph

SeidelSwitch

SequenceGraph

Subgraph

TensorProduct

Trail

TransitiveClosure

TransitiveReduction

UnderlyingGraph

  

Modifying Graphs

AddArc

AddEdge

AddVertex

Contract

DeleteArc

DeleteEdge

DeleteVertex

DiscardEdgeAttribute

DiscardGraphAttribute

DiscardVertexAttribute

GetEdgeAttribute

GetGraphAttribute

GetVertexAttribute

ListEdgeAttributes

ListGraphAttributes

ListVertexAttributes

SeidelSwitch

SetEdgeAttribute

SetEdgeWeight

SetGraphAttribute

SetVertexAttribute

Subdivide

 

 

  

Properties of Graphs

AcyclicPolynomial

AdjacencyMatrix

AllPairsDistance

Arrivals

ArticulationPoints

AutomorphismGroup

BiconnectedComponents

BipartiteMatching

Blocks

CharacteristicPolynomial

chromatic_number

ChromaticIndex

ChromaticPolynomial

CircularChromaticIndex

CircularChromaticNumber

CircularEdgeChromaticNumber

CliqueCover

CliqueCoverNumber

CliqueNumber

CliquePolynomial

CliquePolynomial

ConnectedComponents

CycleBasis

Degree

DegreeSequence

Departures

Diameter

Distance

DistancePolynomial

DrawAutomorphism

Eccentricity

EdgeChromaticNumber

EdgeConnectivity

Edges

FindClique

FindHamiltonianPath

FindVertexCover

FlowPolynomial

GetEdgeWeight

Girth

GlobalClusteringCoefficient

GraphEqual

GraphPolynomial

GraphRank

GraphSpectrum

HasArc

HasEdge

HighlightedEdges

HighlightedVertices

IncidenceMatrix

IncidentEdges

InDegree

IndependenceNumber

IndependencePolynomial

IsAcyclic

IsAntiArborescence

IsArborescence

IsBiconnected

IsBipartite

IsClique

IsConnected

IsCutSet

IsDirected

IsEdgeColorable

IsEulerian

IsForest

IsGraphicSequence

IsHamiltonian

IsIntegerGraph

IsIsomorphic

IsNetwork

IsPlanar

IsRegular

IsStronglyConnected

IsStronglyRegular

IsTournament

IsTree

IsTriangleFree

IsTwoEdgeConnected

IsVertexColorable

IsWeighted

LaplacianMatrix

LocalClusteringCoefficient

MaxFlow

MaximumClique

MaximumDegree

MaximumIndependentSet

MaximumMatching

MinimumDegree

MinimumVertexCover

Neighborhood

Neighbors

NumberOfEdges

NumberOfSpanningTrees

NumberOfVertices

OddGirth

OutDegree

Radius

RankPolynomial

Reachable

ReliabilityPolynomial

SeidelSpectrum

SpanningPolynomial

StronglyConnectedComponents

TopologicSort

TreeHeight

TuttePolynomial

TwoEdgeConnectedComponents

VertexConnectivity

VertexCoverNumber

Vertices

WeightMatrix

  

Importing and Exporting Graphs

ConvertGraph

ExportGraph

ImportGraph

Latex

  

Traversing Graphs

BellmanFordAlgorithm

DijkstrasAlgorithm

IsReachable

KruskalsAlgorithm

MinimalSpanningTree

PrimsAlgorithm

ShortestPath

SpanningTree

TravelingSalesman

 

 

 

  

Visualizing Graphs

DrawAutomorphism

DrawGraph

DrawNetwork

DrawPlanar

GetVertexPositions

GraphDrawingOptions

HighlightEdges

HighlightSubgraph

HighlightTrail

HighlightVertex

SetVertexPositions

 

  

Other Commands

DelaunayTriangulation

GreedyClique

GreedyColor

GreedyIndependentSet

Accessing the GraphTheory Package Commands

• 

Each command in the GraphTheory package can be accessed by using either the long form or the short form of the command name in the command calling sequence.  For example, if G is a graph you can use either GraphTheory[IsPlanar](G) or with(GraphTheory); then IsPlanar(G).

• 

Because the underlying implementation of the GraphTheory package is a module, it is possible to use the form GraphTheory:-command to access a command from the package. For more information, see Module Members.

Examples

withGraphTheory:

An undirected graph on 5 vertices labeled 1 to 5.

GGraph1,2,2,3,3,1,4,5

GGraph 1: an undirected unweighted graph with 5 vertices and 4 edge(s)

(1)

DrawGraphG

A directed graph on 4 vertices a, b, c, and d.

HDigrapha,b,c,d,a,b,b,c,c,d,d,a

HGraph 2: a directed unweighted graph with 4 vertices and 4 arc(s)

(2)

DrawGraphH

A weighted directed graph (a network) on 4 vertices 1, 2, 3, and 4.

NDigraph1,2,3,1,3,3,2,4,4,3,4,4

NGraph 3: a directed weighted graph with 4 vertices and 4 arc(s)

(3)

WeightMatrixN

0330000400040000

(4)

A example of a special graph, a dodecahedron, on 20 vertices.

withSpecialGraphs:

GDodecahedronGraph

GGraph 4: an undirected unweighted graph with 20 vertices and 30 edge(s)

(5)

DrawGraphG

See Also

GraphTheory examples

RandomGraphs

SpecialGraphs