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

Online Help

All Products    Maple    MapleSim


GraphTheory

  

Newick

  

compute Newick encoding

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

Newick(G, opts)

Newick(s)

Parameters

G

-

graph; tree or arborescence

s

-

string

opts

-

(optional) one or more options as specified below

Options

• 

directed = truefalse

  

Specifies whether the output graph should be directed or undirected when the input is a Newick string. The default is true. When the input is not a string, this option is ignored.

• 

root = string, name, or integer

  

Specifies a root vertex when the input is an undirected graph. The default value is the first vertex in the list returned by Vertices. When the input is not an undirected graph, this option is ignored.

Description

• 

Newick(G), where G is a graph, returns a string comprising the Newick encoding of G.

  

If G is undirected, it must be a tree.

  

If G is directed, it must be an arborescence or anti-arborescence.

• 

Newick(s), where s a string, returns a graph whose Newick encoding is s.

Examples

Generate the Newick encoding of a tree.

withGraphTheory:

TGraph10,1,8,2,3,2,7,4,6,5,6,6,7,6,8,7,9,8,10

TGraph 1: an undirected graph with 10 vertices and 9 edge(s)

(1)

NewickT

(((4,5,((3)2,9)7)6,10)8)1;

(2)

Generate the Newick encoding of an arborescence.

AGraph10,2,5,3,4,3,7,4,1,5,3,5,6,9,8,10,2,10,9

AGraph 2: a directed graph with 10 vertices and 9 arc(s)

(3)

NewickA

(((((1)4,7)3,6)5)2,(8)9)10;

(4)

Generate the unweighted graph corresponding to a given Newick encoding.

Newick(((((6,(((9)16)4)15)8,(11,(19)20)10)2,(17)12,13)3,(7)5)14,18)1;

Graph 3: a directed graph with 20 vertices and 19 arc(s)

(5)

Generate the weighted graph corresponding to a given Newick encoding.

Newick(((((((4:2.990)10:6.574)9:5.323)6:2.994,(5:1.025)8:6.644)7:2.876)3:8.254)2:6.146)1;

Graph 4: a directed weighted graph with 10 vertices and 9 arc(s)

(6)

Compatibility

• 

The GraphTheory[Newick] command was introduced in Maple 2021.

• 

For more information on Maple 2021 changes, see Updates in Maple 2021.

See Also

IsArborescence

IsTree

PrueferCode