Close
Close window
Overview - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.
Maplesoft logo
Maplesoft logo

Online Help

All Products Maple MapleSim


[フレーム] [フレーム]

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 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 GeometricGraphs package has routines for generating graphs from geometric data.

The RandomGraphs package has routines for randomly generating graphs.

The SpecialGraphs package contains a library of predefined graphs.

List of GraphTheory Package Commands

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

Constructing Graphs

Modifying Graphs

Properties of Graphs

Importing and Exporting Graphs

Traversing Graphs

Visualizing Graphs

Other Commands

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.

The long form, GraphTheory:-command, is always available. The short form can be used after loading the package. For example, if G is a graph you can use either GraphTheory:-IsPlanar(G) or with(GraphTheory); then IsPlanar(G).

Examples

>

withGraphTheory:

An undirected graph on 5 vertices labeled 1 to 5.

>

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

GGraph 1: an undirected graph with 5 vertices and 4 edges

(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 graph with 4 vertices and 4 arcs

(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 arcs

(3)
>

WeightMatrixN

0330000400040000

(4)

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

>

withSpecialGraphs:

>

GDodecahedronGraph

GGraph 4: an undirected graph with 20 vertices and 30 edges

(5)
>

DrawGraphG


Download Help Document

AltStyle によって変換されたページ (->オリジナル) /