The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
1answer
103 views

Forcing optimal solution for FindShortestTour

I use FindShortestTour as explained here and it works nicely for a small number of cities. However when I try this with as little as 16 cities, the given tour isn't ...
6
votes
1answer
129 views

Position with Except returns first item {0} and last item {}. Why?

Here is a simple list: l={1, 0, 2, 1, 0, 1, 0, 1, 2, 0, 2, 0, 1, 0, 1, 0, 0} To get the position of non-zero elements I use ...
12
votes
5answers
680 views

How to perform a depth-first preorder traversal of an expression?

Due to confusion of terminology on my part I asked the wrong question before. Since it has already received other answers I shall not edit it, but instead ask the question I meant to in the first ...
16
votes
6answers
647 views

How to perform a breadth-first traversal of an expression?

Mathematica provides functions that perform a depth-first traversal on an expression, including: Map, MapAll, and ...
13
votes
3answers
450 views

Determining all possible traversals of a tree

I have a list: B={423, {{53, {39, 65, 423}}, {66, {67, 81, 423}}, {424, {25, 40, 423}}}}; This list can be visualized as a tree using ...