Questions tagged [search-tree]

A tree shaped data structure which allows for storing orderable data so it may be efficiently searched later.

A tree shaped data structure which allows for storing orderable data so it may be efficiently searched later.

49 questions
106
votes
19 answers

Knight's Shortest Path on Chessboard

I've been practicing for an upcoming programming competition and I have stumbled across a question that I am just completely bewildered at. However, I feel as though it's a concept I should learn now rather than cross my fingers that it never comes…
Kyle Hughes
  • 1,369
  • 3
  • 14
  • 13
24
votes
2 answers

Completeness of depth-first search

I quote from Artificial Intelligence: A Modern Approach: The properties of depth-first search depend strongly on whether the graph-search or tree-search version is used. The graph-search version, which avoids repeated states and redundant paths, is…
11
votes
4 answers

Is there a program that can draw a search tree of Prolog queries?

I was wondering if there exists a tool that can draw a step-by-step search tree of a Prolog program? Thanks.
IDDQD
  • 3,543
  • 8
  • 29
  • 40
9
votes
3 answers

How to Find the Branching Factor of a Tree

A particular search tree has 6 nodes at level 3. At the next level, there are 24 nodes. What is the branching factor at level 3? The answer is 4, but can someone tell me why, I thought that it was 2.
blazing
  • 557
  • 2
  • 4
  • 20
9
votes
2 answers

How to functionally generate a tree breadth-first. (With Haskell)

Say I have the following Haskell tree type, where "State" is a simple wrapper: data Tree a = Branch (State a) [Tree a] | Leaf (State a) deriving (Eq, Show) I also have a function "expand :: Tree a -> Tree a" which takes a…
wen
  • 3,782
  • 9
  • 34
  • 54
4
votes
1 answer

Some doubts about Prolog implementation of 2-3 Dictionary

I am learning Prolog using SWI Prolog and I have some doubts about how work this implementation of the 2-3 dictionary in Prolog. I know the theory of the 2-3 dictionary that are trees whose internal nodes can generate 2 or 3 subtrees having the…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
2
votes
0 answers

Improving Stockfish computation to generate best possible move

I use the stockfish engine to generate the optimal moves in an simulated chess game. I use python-chess to integrate the Stockfish engine in my simulation. At the moment I set the depth of the search operation for the optimal move with…
sebko_iic
  • 340
  • 2
  • 16
2
votes
3 answers

Tree Search - given two nodes in a tree, check if they are connected - python

Given a search tree, e.g. "1" └ "2" ├ "2.1" ┊ └ "3" ┊ └ "2.2" └ "2.2.1" └ "3" As well as two nodes, a and b, that belong on that tree, e.g. "2.1" and "3". How can we check whether a and b are parent-child (or…
Sergey Ronin
  • 756
  • 7
  • 23
2
votes
3 answers

Path planning for multiple robots simultaneously

Image1 represents the problem perfectly and shows the freedom of motion the robot is capable of. Square-> Origin, Circle-> Destination. These are two robots that will be working simultaneously. How to guide these robots without deadlocking each…
Perseus784
  • 104
  • 2
  • 9
2
votes
1 answer

Tree with exponential split factor

What do you call a search tree with a split factor of 2^k, where k is the dimensionality of the data points stored within the tree? (The data points are vectors x_1, ... x_k) For k=1 we would get a normal binary search tree. For k=2 we would split…
Tim Kuipers
  • 1,705
  • 2
  • 16
  • 26
1
vote
1 answer

adding immutability to the avl search tree class

I wrote a dictionary class of an avl search tree with values in leaves, but it is necessary to add immutability to it, that is, when deleting and adding anything (whether it is changing an element with an existing key or adding a new element), a new…
1
vote
0 answers

can the algorithm cost be negative?

I was reading an article and I've found the graph below that represents the algorithm cost, and I was wondering if the values are representing the algorithm cost why they are negative? and what are they referring to ? I also would like to know the…
aya_kh
  • 49
  • 6
1
vote
1 answer

Why is there logarithm (and the square root) in the UCB formula of Monte Carlo Tree Search?

I studied Monte Carlo Tree Search (UCT) from several sources, like this: http://www.incompleteideas.net/609%20dropbox/other%20readings%20and%20resources/MCTS-survey.pdf However, I didn't understand why there is logarithm (and the square root) in the…
1
vote
0 answers

Can a child node be assigned back to its parent node in tree structure?

As title, I'm currently trying to build a tree structure to take my topics/definitions and their related topics/definition into a tree for traversal and further analysis. The data look like this: VR(root) |____electric vehicle |____electric car …
1
vote
0 answers

Finding two trees with the same post- and preorder

I am looking for two different search trees with at least 4 nodes. The trees don't have to have the general search tree attributes. The postorder and preorder from tree A has to be the same as the post- and preorder of tree B. I don't really…
Johnnb
  • 47
  • 6
1
2 3 4