Game-green Hackenbush (No to map delete edge) __ Learning Notes

Source: Internet
Author: User

Turn from: http://blog.sina.com.cn/s/blog_8f06da990101252l.html

Green Hackenbush

The Hackenbush game is by removing some edges of a root graph until there is no connected edge to the floor. The floor is indicated by a dotted line in which all the edges attached above the edge are removed when a side is removed, as in the case of a branch, where the branches are removed.

In this section, we discuss the fair version of the game, where each player can delete any side in his turn. This version is called the Green Hackenbush, each side is the greens, below we are referred to GH game. There is also an unfair version, called Blue-red Hackenbush, some side is blue, some side is red, while the player can only delete the blue edge, player two can only delete the red edge. In general, Hackenbush games, there may be only a player to delete the Blue side, only for players to delete the red side, there are two players can operate on the green side.

1 Bamboo stalks

As an introduction to GH games, we first study the following figure 6.1. N-line Bamboo stalks game is a linear graph with n edges. One-step legal operation is to remove any one side, the player takes turns to operate, the last player to operate wins. N-segment Bamboo stalks game can be moved to any number of smaller segments (0 to n-1) bamboo stalks game situation. So the n-line bamboo stalks game is equivalent to a bunch of n pebbles in the Nim game. Playing a group of bamboo stalks games is equivalent to playing a NIM game.


For example, the "forest" of three bamboo poles on the left is equivalent to a NIM game with stones number 3, 4, and 53 stones. As far as we know, 3^4^5=2, this is an n situation that can move to P, by taking the second segment of a bamboo pole with three segments and leaving a root. The results turned to the right side of the bamboo distribution, and at this time the SG value is 0, is P situation.

2 Green Hackenbush on trees

Through the bamboo stalks game, we know that GH game is a different form of Nim game. But if we allow more structure than the bamboo stalks game. Let's look at a forest of three root trees in Figure 6.2. The root tree is a graph with one of the highest nodes, called roots, where the path to any other node is unique. In essence, the figure does not contain a circle.


One legal operation is to remove any segment that is not connected to the ground, at which point the subtree above the secondary segment will be removed. Since this game is fair, and according to the Nim game we have learned, such trees are equivalent to some of the Nim game heaps, or bamboo stalks games (where it is understood that bamboo stalks games are equivalent to a single heap of Nim games). The problem is finding the SG value of each tree.

Here we're going to use a principle called Colon principle: When a branch is on a vertex, it is replaced with the length of a pole that is not a branch, equal to their n or its sum.

Let's see how this principle is to look for a bamboo pole equivalent to Zo Shu in Figure 6.2. Here are two nodes that have branches. The higher node has two branches and two nodes on each branch. 1^1=0, so the two branches can be replaced with a 0-node branch, which means the two branches can be removed. Then there is a Y-shaped tree, for the same reason that the two branches of the Y-shaped tree will be removed. At this point, there is a bamboo game model with a segment number of 1.

Look at Figure 6.3, is Figure 6.2 in the second tree processing method, and finally can get the number of segments 8 bamboo game. The third tree can also be processed as a result of a bamboo game with a line number of 4. (Note that the bamboo game referred to here is essentially a single stone in the Nim game.)


Now we can calculate the SG value of FIG. 6.2 Three trees, that is, 1^8^4=13. Since this SG value is not 0, then it is a n situation, the tempo will prevail. The question is how to find a way to win. It's obvious there's a winning move, by manipulating the second tree to make it a SG value of 5. But which side are we looking for?

The last tree length of Figure 6.3 is 8, because the length of the three branches of the former tree is 3,2,6, the difference or the value is 3^2^6=7, and the length of a 7 bamboo pole replaces three branches, and the length of the tree is the root plus the length of the bamboo pole, that is, the 1+7=8. For the final SG to reach 5, even if the length of the tree is 5, we need to replace the three branches with a 4-length bamboo pole. Because 2^6=4, so we just remove the left branch on the line, of course, we can also change the branches into 3^1^6=4.

The method of pruning the tree is given with a colon, and all the trees are reduced to a single bamboo pole. One starts with the tallest branch and then sums it down to the root. We now show that this principle is true for graphs with loops and multiple root edges.

Colon principle Proof: Suppose an arbitrarily fixed graph G, an arbitrary node x, let H1 and H2 be any tree, and have the same SG value. Consider such two graphs g1=gx:h1 and g2=gx:h2,gx:hi that the graph is the x node of the tree Hi Connection graph. Colon principle the two figure G1, G2 has the same SG value. Take a look at Figure 6.4 's two games.

G1, G2 have the same SG value means that the total SG value of both games is 0,G1+G2 and is a p situation, which is a must-lose


Once you take any one of the edges in one of the pictures, the next one takes the same edge in the other picture. Take turns, the end must be a win. So when a branch is on a vertex, the length of a pole that is not a branch is substituted, and the result is equivalent.

3 Green Hackenbush on General rooted graphs

Now let's consider the irregular graph. These graphs may have circles and will have several roots. See figure 6.5.


Again, each of the three graphs above is equivalent to a heap of Nim games, and three diagrams form a Nim game. Next we are going to find these graphs equivalent to the Nim heap to help us solve the problem. This uses the principle of convergence. We can synthesize two adjacent nodes into one node and bend the edges between them to form a circle. A circle is a side that takes itself as the other end of the edge. For example, the figure at the far right of the 6.5 is a circle of the head of the puppet performer. In GH game, a circle can be replaced by a leaf (a side that has no branch attached to it), see the transformation of the third picture in Figure 6.6 to the fourth picture.

The Fusion principle: The nodes in any ring can be fused into a bit without changing the SG value of the graph. (We call it the Fusion principle below)

The fusion principle allows us to simplify any root graph to an equivalent tree that can be simplified as a bamboo pole by the colon principle (i.e. colon principle).

As shown in the left part of the diagram below, the two nodes on the floor are the same nodes (remember that the floor is equivalent to a single node), so it is actually a triangle with a node connected to the floor, that is, the second picture. The fusion principle tells us that this is equivalent to a single node with three loops connected to it. So to create the third to the fourth, the process is to shrink any two points into a circle, 3 points 22 contraction can get three laps. Each circle is equivalent to a bamboo pole of 1 length, and their differences or the bamboo poles with a length of 1.


We will find that a ring with an odd number of edges can be reduced to a single edge, and a ring of even several edges can be reduced to a single node. For example, in the second picture in Figure 6.5, the four-side ring in the Christmas tree will shrink to a node, so the Christmas tree will eventually be reduced to a bamboo pole of 1 length. Similarly, the chimney on the house becomes a separate node, the window on the right becomes a point and continues, and the SG value of the house can be seen to be 3.

The proof of the fusion principle is longer than that of the colon principle, so there is no explanation here.


Note:

This article is translated from "Game theory", because this text is a translation, the language may be a bit inappropriate, make some supplementary note below.

GH game: That is, Green hackenbush, This article explores the game game.

Bamboo game: That is, Bamboo stalks, is the literal translation over.

Colon principle: namely Colon principle, Although this is literal translation, but not very good, has the reservation.

Integration principle: Fusion principle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.