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

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

> 

with⁡GraphTheory:

> 

G≔Graph⁡1,2,2,3,3,1

G≔Graph 1: a directed graph with 3 vertices and 3 arcs

(1)
> 

IsDirected⁡G

true

(2)
> 

IsWeighted⁡G

false

(3)
> 

DrawGraph⁡G

> 

K3≔CompleteGraph⁡3

K3≔Graph 2: an undirected graph with 3 vertices and 3 edges

(4)
> 

IsDirected⁡K3

false

(5)
> 

H≔Graph⁡1,2,2,2,3,3

H≔Graph 3: an undirected weighted graph with 3 vertices and 2 edges

(6)
> 

IsWeighted⁡H

true

(7)
> 

WeightMatrix⁡H

020203030

(8)
> 

K3≔CompleteGraph⁡3

K3≔Graph 4: an undirected graph with 3 vertices and 3 edges

(9)
> 

IsWeighted⁡K3

false

(10)
> 

K3≔MakeWeighted⁡K3

K3≔Graph 5: an undirected weighted graph with 3 vertices and 3 edges

(11)
> 

IsWeighted⁡K3

true

(12)
> 

WeightMatrix⁡K3

011101110

(13)

See Also

MakeDirected

MakeWeighted

UnderlyingGraph

WeightMatrix