MakeDirected - Maple Help

Online Help

All Products    Maple    MapleSim


GraphTheory

  

MakeDirected

  

make graph directed

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

MakeDirected(G, M)

MakeDirected(G, opts)

Parameters

G

-

undirected graph

M

-

(optional) Matrix

opts

-

(optional) one or more options as specified below

Options

• 

root = vertex of G

  

In the case when G is a tree, specifies a root vertex for an arborescence with all undirected edges in G converted to directed edges heading away from root.

• 

totalorder = list of vertices

  

Specifies a total ordering for the vertices. When this option is provided, an undirected edge between vertices a and b is transformed to a single directed edge based on the total order.

Description

• 

The MakeDirected command returns a directed graph with vertices from G.

• 

By default, for each edge in G, the arcs in both directions are in the new graph.

• 

If G is a weighted graph, then a matrix M may be included as part of the input; in such a case the arc weights are taken from the entries of M.

Examples

withGraphTheory:

GMakeDirectedCycleGraph4:

EdgesG

1,2,1,4,2,1,2,3,3,2,3,4,4,1,4,3

(1)

GMakeWeightedCycleGraph4:

MMatrix0,0,0,1,2,0,1,3,0,1,0,4,5,0,4,0:

GMakeDirectedG,M:

EdgesG,weights

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

(2)

Compatibility

• 

The GraphTheory[MakeDirected] command was updated in Maple 2021.

See Also

IsDirected

MakeWeighted

UnderlyingGraph