Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
GraphTheory
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. The edges in the graphs may 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 use the DrawGraph command. The output is a Maple plot.
To test if a Maple object G is a graph use the test: type(G,GRAPHLN).
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 SpecialGraphs package contains a library of pre-defined graphs and the RandomGraphs package has routines for randomly generating graphs.
The GraphTheory examples worksheet has a guided tour of the package.
The Internal Data Structure used for Representing a Graph.
The data structure for representing a graph is a Maple function of the form GRAPHLN( D, W, V::list, A::Array, T::table, M::{0,Matrix} ) where
D = undirected implies the graph is undirected
D = directed implies the graph is directed
W = unweighted implies the graph is unweighted and M is the integer 0
W = weighted implies the graph is weighted and M is of type Matrix
V is a list of integers, symbols or strings (the vertex labels).
A is an Array of sets of integers (the edges of the graph)
T has information about the graph, each vertex and each edge (see below)
M is either 0 or a Matrix of integer or floating point edge weights
The following commands give the user direct access to these fields.
IsDirected(G) returns true if D=directed and false if D=undirected.
IsWeighted(G) returns true if W=weighted and false if W=unweighted.
Vertices(G) returns V
WeightMatrix(G) returns M if G is weighted and an error otherwise.
The edges in the graph are implicitly defined by A. If and are two vertices in the graph, the edge (or arc ) is in the graph if and only if the integer j is in the set of integers . The Edges, Neighbors, Arrivals, Departures, and AdjacencyMatrix commands all return this edge information in different formats.
You may attach arbitrary information to the vertices of the graph, the edges of the graph, or the graph as a whole. This is done using attributes and the information is stored in the table T. See the GraphAttributes help page, as well as the GetVertexPosition and SetVertexPosition commands.
List of GraphTheory Package Commands
The following is a list of the commands in the main GraphTheory package.
AcyclicPolynomial
AddArc
AddEdge
AddVertex
AdjacencyMatrix
AllPairsDistance
Arrivals
ArticulationPoints
BellmanFordAlgorithm
BiconnectedComponents
BipartiteMatching
Blocks
CartesianProduct
CharacteristicPolynomial
ChromaticIndex
ChromaticNumber
ChromaticPolynomial
CircularChromaticIndex
CircularChromaticNumber
CircularEdgeChromaticNumber
CliqueNumber
CompleteGraph
ConnectedComponents
Contract
ConvertGraph
CopyGraph
CycleBasis
CycleGraph
Degree
DegreeSequence
DelaunayTriangulation
DeleteArc
DeleteEdge
DeleteVertex
Departures
Diameter
Digraph
DijkstrasAlgorithm
DiscardEdgeAttribute
DiscardGraphAttribute
DiscardVertexAttribute
DisjointUnion
Distance
DrawGraph
DrawNetwork
DrawPlanar
EdgeChromaticNumber
EdgeConnectivity
Edges
ExportGraph
FlowPolynomial
FundamentalCycle
GetEdgeAttribute
GetEdgeWeight
GetGraphAttribute
GetVertexAttribute
GetVertexPositions
Girth
Graph
GraphAttributes
GraphComplement
GraphEqual
GraphJoin
GraphNormal
GraphPolynomial
GraphPower
GraphRank
GraphSpectrum
GraphUnion
GreedyColor
HasArc
HasEdge
HighlightedEdges
HighlightEdges
HighlightedVertices
HighlightSubgraph
HighlightTrail
HighlightVertex
ImportGraph
IncidenceMatrix
IncidentEdges
InDegree
IndependenceNumber
InducedSubgraph
IsAcyclic
IsBiconnected
IsBipartite
IsClique
IsConnected
IsCutSet
IsDirected
IsEdgeColorable
IsEulerian
IsForest
IsGraphicSequence
IsHamiltonian
IsIntegerGraph
IsIsomorphic
IsNetwork
IsomorphicCopy
IsPlanar
IsRegular
IsStronglyConnected
IsTournament
IsTree
IsTwoEdgeConnected
IsVertexColorable
IsWeighted
KruskalsAlgorithm
LineGraph
ListEdgeAttributes
ListGraphAttributes
ListVertexAttributes
MakeDirected
MakeWeighted
MaxFlow
MaximumClique
MaximumDegree
MaximumIndependentSet
MinimalSpanningTree
MinimumDegree
Mycielski
Neighborhood
Neighbors
NonIsomorphicGraphs
NumberOfEdges
NumberOfSpanningTrees
NumberOfVertices
OddGirth
OutDegree
PathGraph
PermuteVertices
PlaneDual
PrimsAlgorithm
RandomGraphs
RankPolynomial
RelabelVertices
SeidelSpectrum
SeidelSwitch
SequenceGraph
SetEdgeAttribute
SetEdgeWeight
SetGraphAttribute
SetVertexAttribute
SetVertexPositions
ShortestPath
SpanningPolynomial
SpanningTree
SpecialGraphs
StronglyConnectedComponents
Subdivide
Subgraph
TensorProduct
TopologicSort
Trail
TravelingSalesman
TreeHeight
TuttePolynomial
TwoEdgeConnectedComponents
UnderlyingGraph
VertexConnectivity
Vertices
WeightMatrix
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 may 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
An undirected graph on 5 vertices labeled 1 to 5.
A directed graph on 4 vertices a, b, c, and d.
A weighted directed graph (a network) on 4 vertices 1, 2, 3, and 4.
A example of a special graph, a dodecahedron, on 20 vertices.
See Also
GraphTheory examples, RandomGraphs, SpecialGraphs
Download Help Document