compute Newick encoding
graph; tree or arborescence
(optional) one or more options as specified below
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.
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.
Generate the Newick encoding of a tree.
T ≔ Graph⁡10,1,8,2,3,2,7,4,6,5,6,6,7,6,8,7,9,8,10
T≔Graph 1: an undirected graph with 10 vertices and 9 edge(s)
Generate the Newick encoding of an arborescence.
A ≔ Graph⁡10,2,5,3,4,3,7,4,1,5,3,5,6,9,8,10,2,10,9
A≔Graph 2: a directed graph with 10 vertices and 9 arc(s)
Generate the unweighted graph corresponding to a given Newick encoding.
Graph 3: a directed graph with 20 vertices and 19 arc(s)
Generate the weighted graph corresponding to a given Newick encoding.
Graph 4: a directed weighted graph with 10 vertices and 9 arc(s)
The GraphTheory[Newick] command was introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
Download Help Document
What kind of issue would you like to report? (Optional)