IsDirected - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


GraphTheory

  

IsDirected

  

test if graph is directed

  

IsWeighted

  

test if graph is weighted

 

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 graph with 3 vertices and 3 arc(s)

(1)

IsDirectedG

true

(2)

IsWeightedG

false

(3)

DrawGraphG

K3CompleteGraph3

K3Graph 2: an undirected 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 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