chip-firing game and data structures prof. sin-min lee department of computer science san jose state...
TRANSCRIPT
Chip-firing Game and Data Structures
Prof. Sin-Min Lee
Department of Computer Science
San Jose State University
Chip firing games
• Chip firing games are mathematical games in which a set of points each has some number of chips on the point. If at any point in time a point has more chips on it than the degree of the point, the chip is ''fired''. Firing a chip sends an equal portion of the chips on a cell to each of its neighbors. Any leftover chips remain on the point. The game continues until no vertex can be fired.
Parallel Chip Firing Games
• Originally, the ``game'' was played by selecting a single point at each time step until a stable configuration was reached (that is until no point has more chips than its degree) or until it can be determined that the game can never terminate. Later research concluded the termination of the game did not relay on firing individual points sequentially, but all points meeting the criteria for firing could be fired simulatneously. These are called parallel chip firing games.
When a vertex is fired, it sends one chip to each neighbour.
A configuration is stable if no vertex in V(G) can be fired.
1
1
2
1
1
The total number of chips never changes.
• a famous discrete dynamical system
• the Chip Firing Game, used as a model in physics, economics and computer science
• avanlache model in statistical mechanic.
Example 1.
1
3
4
1
3
11
2
1
1
2 1 3
21
2
2 1
2
1
2 3
2
1
4
1st 2nd
4th
3rd
5th 6th
Example 2
2
1
2
1
4
6th 7th
3
1
4
1
1st 2nd
4th
3rd
5th 6th
2
2
1
2
2
4
2
1
3
11
1
1
21
3
31
3
1
Example 3.
Example 4.
1 st 2 nd
2 nd 3 rd
3
2
3
1
2
Example 5.
1
2 4
1
3
3
2
3
1
2
A cycle
Arrays are essentially a way to store many values under the same name. You can make an array out of any data-type including structures and classes.
Arrays
Think about arrays like this:
[][][][][][]
Each of the bracket pairs is a slot(element) in the array, and you can put information into each one of them. It is almost like having a group of variables side by side.Lets look at the syntax for declaring an array.
int examplearray[100]; //This declares an array
This would make an integer array with 100 slots, or places to store values(also called elements). To access a specific part element of the array, you merely put the array name and, in brackets, an index number. This corresponds to a specific element of the array. The one trick is that the first index number, and thus the first element, is zero, and the last is the number of elements minus one.
Firing of chips occurs when the number of chips inside a vertex is either GREATER than or EQUAL to the number of ADJACENT edges.
Each vertex represents an Array element. Another Array is to keep track of adjacent edges of vertex.
Example
V1 V2 V3
2 chips in V2 initially.To fire the chips: 2 chips in V2, and 2 adjacent edges which satisfy the condition of chips firing.
Array representation: 0 2 0
V1 V2 V3
1 chip of V2 goes to V1 and 1 chip of V2 goes to V3 becauseONLY 1 chip can be fired onto an adjacent Vertex
1 0 1Array Representation:
The chips can be fired again because there is 1 chip in V1 and 1 adjacent edge to V2 and 1 chip in V3 and 1 adjacent edge to V2. But after firing, the process must stop because it has Completed a cycle and returned to its original state.
Chip-firing game on paths were considered by Joel Spencer in 1983.
4
The number 4 means four chipsIn V4.
Firing the chips is okay because There are 4adjacent vertices
V1
V2
V3
V4
V5
V6
V7
V1
V2
V3
V4
V5
V6
V7
After the chips has been fired, it stops because the number of chips in each Vertex is less than the number of adjacent edges.
2
1 20
31
1V1
V2
V3
V4
V5
V6
V7
2011123Example 6.
0
3 11
21
2V1
V2
V3
V4
V5
V6
V7
0113212
0
5 31
01
0V1
V2
V3
V4
V5
V6
V7
0115030
1
1 11
22
2V1
V2
V3
V4
V5
V6
V7
1121212
1
4 32
00
0V1
V2
V3
V4
V5
V6
V7
1204030
3
0 10
22
2V1
V2
V3
V4
V5
V6
V7
3020212
1
4 32
00
0V1
V2
V3
V4
V5
V6
V7
1204030
It repeats the step 5
1
1
1
1
4
1
1
2
2
2
Dan Garbinics146 3pm
Example 7.
1
2 23
2
1
1
1
3
1
1
1
1
4
The End: Loop is formed. Compare to initial structureand sequence will continue.
"Be an explorer, not a problem solver" ------G. C. Rota
J.W. von Goethe, Faust Mephistopheles: Use well your time, so rapidly it flies;Method will teach you time to win;Hence, my young friend, I would advise,With college logic to begin!