当前位置: 动力学知识库 > 问答 > 编程问答 >

Game trees and data structures to implement them in java?

问题描述:

I am getting really confused with this concept:

If I want to implement a game in java, say tic tac toe using a game tree, does this mean that I have to use a tree data structure? I finished listening to one of the lectures of UCBerkley and the professor there stated that "a game tree does not mean a tree data structure implementation", but I am not sure if I am getting it right.

网友答案:

In game theory, a game tree is a directed graph whose nodes are positions in a game and whose edges are moves. The complete game tree for a game is the game tree starting at the initial position and containing all possible moves from each position; the complete tree is the same tree as that obtained from the extensive-form game representation.

emphasis mine, From wikipedia

So they are really getting into details here, a graph is not necessarily a tree, but could be.

To put it another way

a tree is an undirected graph in which any two vertices are connected by exactly one simple path. In other words, any connected graph without cycles is a tree.

again from Wikipedia.

At least that is what I am getting from your question.

分享给朋友:
您可能感兴趣的文章:
随机阅读: