How to find the largest possible value when moving values between N nodes I stumbled upon an interesting combinatorial question while playing Magic: the Gathering.
Take N nodes on a complete graph, each node with an assigned value. Each node's value begins at 1, and may increase as the game progresses. Each move of the game consists of a node adding its value to the value of one other node that it's connected to. (The source node does not reduce its value after this operation; values can never decrease.) After one move in each direction along a graph edge (two moves in total), that edge is deleted and no more moves can be made along that edge.  The goal is to end up with the greatest possible total value among all nodes after all moves have been made. The total number of moves in the game will be (N choose 2) * 2. (The number of edges times 2, since each edge allows one move in each direction.)
For example, consider N=2. The starting configuration is A=1, B=1. To begin the game, Node A adds its value to node B, resulting in A=1, B=2. Then node B adds its value to node A, resulting in A=3, B=2. The game is now over, and the final score is 5. The only other possibility is to have node B move first, which simply results in A=2, B=3 and the same final score.
However the problem becomes greatly more complex when more nodes are added. The complexity of the game increases extremely quickly, making brute-force approaches infeasible. So far, the maxima I have achieved for various N through experimentation are:

N=1: 1
N=2: 5
N=3: 29
N=4: 249
N=5: 3866

But I am by no means convinced these are the best answers (at least for N>2). There are a number of simple instruction sets that can do well, such as "always move away from the node with the highest value to the node with the highest value among its legal choices". This isn't necessarily optimal though, and I'm curious if there is a simple algorithm to maximize the final value that works on all N.
 A: The sequence of largest possible values appears to begin
$$
    1, 5, 29, 260, 4106, 122762, \dots
$$
Only the first four values are certain, but I have considerable numerical evidence for the last two.

Two patterns emerge when we look at high-scoring solutions to small cases:
Conjecture 1. The best solution follows an Eulerian tour of the directed complete graph $\overrightarrow{K_n}$. As we follow the tour, every time we take a step $v \to w$, we add the value at $v$ to the value at $w$.
If true, this reduces the number of cases we need to check: instead of $(N^2-N)!$ orders, we only need to try every possible Eulerian tour, and there's many fewer of those.
Conjecture 2. There is a best solution which does all operations involving $N-1$ of the nodes (in some order) before doing all operations involving the last node (in some order).
Regarding Conjecture 2, it can be shown that if the best solution has this form, then (after permuting the nodes) it ends with the steps $$1 \to N \to 2 \to N \to 3 \to N \to \dots \to (N-1) \to N \to 1.$$ This also leaves us fewer cases to check: essentially, all the ways we can deal with the first $N-1$ nodes.

Here are the best solutions I've found:

*

*When $N=1$, doing nothing scores $1$ point at the end.

*When $N=2$, the Eulerian tour $1 \to 2 \to 1$ scores $5$ points.

*When $N=3$, the Eulerian tour $1 \to 2 \to 3 \to 2 \to 1 \to 3 \to 1$ scores $29$ points.

*When $N=4$, the Eulerian tour $1 \to 3 \to 2 \to 3 \to 1 \to 2 \to 1 \to 4 \to 2 \to 4 \to 3 \to 4 \to 1$ scores $260$ points.

So far, these have all been verified with brute force.

*

*When $N=5$, the Eulerian tour $1 \to 4 \to 2 \to 4 \to 3 \to 4 \to 1 \to 3 \to 2 \to 3 \to 1 \to 2 \to 1 \to 5 \to 2 \to 5 \to 3 \to 5 \to 4 \to 5 \to 1$ scores $4106$ points.

I have found a variant of this solution three ways: using simulated annealing to get a high-scoring solution without brute force; using brute force over all Eulerian tours, assuming only Conjecture 1; using brute force over all $12!$ orders of the operations on nodes $1,2,3,4$, assuming only Conjecture 2. That suggests that it is in fact optimal, and that both conjectures are true.

*

*When $N=6$, the Eulerian tour $1 \to 5 \to 2 \to 4 \to 2 \to 3 \to 2 \to 5 \to 3 \to 5 \to 4 \to 3 \to 4 \to 5 \to 1 \to 4 \to 1 \to 3 \to 1 \to 2 \to 1 \to 6 \to 2 \to 6 \to 3 \to 6 \to 4 \to 6 \to 5 \to 6 \to 1$ scores $122762$ points.

This last one was only feasible to find by assuming both conjectures, and doing a brute force over all Eulerian tours of nodes $1,2,3,4,5$ followed by the sequence $1 \to 6 \to 2 \to 6 \to 3 \to 6 \to 4 \to 6 \to 5 \to 6 \to 1$.
