I am not a mathematician, I am a programmer. Sorry, if formulation of the problem is inexact.

I want to calculate the probability of winning for a selected tic-tac-toe player. I have a directed graph of the game, where the vertices of the graph are game positions, directed edges are a moves from one player to another. And I have information associated with each vertex of the graph, we could call it statistic. That is data about how many numbers of moves are required for players to win or draw.

By example, we have 'A' vertex and player '#1' decides what move is better for him/her - transition to 'B' vertex or to 'C' vertex. And 'B' vertex has next statistic:

In 3 moves: player '#2' has 51 winning positions.

In 4 moves (**condition*): player '#1' has 538 winning positions.

In 5 moves (**condition*): player '#2' has 443 winning positions.

In 6 moves (**condition*): player '#1' has 584 winning positions and 453 draw positions.

**condition - if the game is not finished.*

'C' vertex contains different data, but it is required to calculate *the best* variant for player '#1'.

I am not sure that it is the task of the theory of probability, perhaps it is the task of optimization. In any case, I will be glad to any advice or tips on how to solve this problem.