Close
Close window
IsDirected - 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

IsDirected

test if graph is directed

IsWeighted

test if graph is weighted

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 arcs

(1)
>

IsDirectedG

true

(2)
>

IsWeightedG

false

(3)
>

DrawGraphG

>

K3CompleteGraph3

K3Graph 2: an undirected graph with 3 vertices and 3 edges

(4)
>

IsDirectedK3

false

(5)
>

HGraph1,2,2,2,3,3

HGraph 3: an undirected weighted graph with 3 vertices and 2 edges

(6)
>

IsWeightedH

true

(7)
>

WeightMatrixH

020203030

(8)
>

K3CompleteGraph3

K3Graph 4: an undirected graph with 3 vertices and 3 edges

(9)
>

IsWeightedK3

false

(10)
>

K3MakeWeightedK3

K3Graph 5: an undirected weighted graph with 3 vertices and 3 edges

(11)
>

IsWeightedK3

true

(12)
>

WeightMatrixK3

011101110

(13)


Download Help Document

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