GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/IsDirected

GraphTheory

  

IsDirected

  

IsWeighted

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

IsDirected(G)

IsWeighted(G)

Parameters

G

-

graph

Description

• 

The IsDirected(G) function returns true or false depending on whether the input graph is a directed or undirected graph.

• 

The IsWeighted(G) function returns true if G is a weighted graph, and false otherwise.

• 

To make a graph directed or weighted, use the MakeDirected or MakeWeighted commands.

• 

To remove directions and weights from a graph, use the UnderlyingGraph command.

Examples

withGraphTheory:

GGraph1,2,2,3,3,1

GGraph 1: a directed unweighted graph with 3 vertices and 3 arc(s)

(1)

IsDirectedG

true

(2)

IsWeightedG

false

(3)

DrawGraphG

K3CompleteGraph3

K3Graph 2: an undirected unweighted graph with 3 vertices and 3 edge(s)

(4)

IsDirectedK3

false

(5)

HGraph1,2,2,2,3,3

HGraph 3: an undirected weighted graph with 3 vertices and 2 edge(s)

(6)

IsWeightedH

true

(7)

WeightMatrixH

020203030

(8)

K3CompleteGraph3

K3Graph 4: an undirected unweighted graph with 3 vertices and 3 edge(s)

(9)

IsWeightedK3

false

(10)

K3MakeWeightedK3

K3Graph 5: an undirected weighted graph with 3 vertices and 3 edge(s)

(11)

IsWeightedK3

true

(12)

WeightMatrixK3

011101110

(13)

See Also

MakeDirected

MakeWeighted

UnderlyingGraph

WeightMatrix