For questions about the data structures known as trees.

learn more… | top users | synonyms

13
votes
1answer
420 views

Transform an expression into a graph that can be plotted with TreeGraph (not TreeForm)

I would like to plot an expression (like TreeForm does), but using the new TreeGraph functionality. ...
39
votes
1answer
1k views

How to construct a treemap using non-rectangles?

I've written the standard version of a tree map (a graphic that shows nested data) and I'm looking to improve on this layout by switching to different types of polygons or perhaps circles. Can anyone ...
25
votes
4answers
3k views

How to generate a random tree?

Is it possible to generate a random tree without explicitly constructing a random adjacency matrix that satisfies tree properties? How about a random directed tree? Edit: incredible answer by ...
11
votes
3answers
449 views

Visualizing directories

How do I plot the content of a directory and all its subdirectories into infinity using TreeForm? I've tried using a mix of ...
8
votes
1answer
134 views

CSS Selectors for Symbolic XML

Symbolic XML is a convenient way of managing XML in Mathematica, at least for casual use or small tasks. Here and elsewhere you can find examples of XML handling in Mathematica, including XSLT/XPath ...
4
votes
1answer
389 views

Extracting text from nested HTML lists <ul> <li>

We wish to analyze the tree structure of HTML documents that consist of nested lists, ie, using the HTML tags <ul> and ...
9
votes
4answers
225 views

Leave expression tree formatting the same when a replacement rule is applied

If I type e1 := 3 x + 2 (1 + y) z // TreeForm, I get an expression tree. If I then type e1 /. x -> 3, I get another ...
6
votes
2answers
252 views

Truncate TreeForm to show only the top

For some expressions, TreeForm may grow very long. I'm only interested in the top levels of the expression. How can I get the tree form of only the first levels an ...
4
votes
2answers
262 views

Access pairs of vectors, rather than the matrices, in partitioned data structure at a levelspec

I have some old code to analyze correlation between 2 time series by looking at windows of different lengths shifting across the time series data. The code: gets 2 sets of time series data (in ...
3
votes
3answers
192 views

Graph showing valid English words obtained by insertion of single characters

I'd like the most efficient Mathematica code for making a formal tree graph whose nodes are valid English word strings (in DictionaryLookup[ ]) and directed links represent the relation 'insertion of ...
3
votes
1answer
86 views

Some _atomic elements' TreeForm looks confusing with Level in appearance

In[1]:= Level[1/2,{-1}] Out[1]= {1/2} TreeForm[1/2] ...
1
vote
1answer
465 views

How to make Huffman coding by using tree representation

I want to make Huffman coding with Mathematica. I saw a demonstration, but it is not the thing I want to make. I want to show the tree for given string. Here is an example picture: You can see the ...
0
votes
1answer
91 views

Is it possible to mark a Tree node and path to it?

I have the Tree : ...