42
Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

Embed Size (px)

Citation preview

Page 1: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

Chip-firing Game and Data Structures

Prof. Sin-Min Lee

Department of Computer Science

San Jose State University

Page 2: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University
Page 3: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University
Page 4: 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.

Page 5: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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.

Page 6: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University
Page 7: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

When a vertex is fired, it sends one chip to each neighbour.

Page 8: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University
Page 9: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University
Page 10: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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.

Page 11: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

• a famous discrete dynamical system

• the Chip Firing Game, used as a model in physics, economics and computer science

• avanlache model in statistical mechanic.

Page 12: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

Example 1.

Page 13: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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

Page 14: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

2

1

2

1

4

6th 7th

3

1

Page 15: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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.

Page 16: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

Example 4.

1 st 2 nd

Page 17: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

2 nd 3 rd

Page 18: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

3

2

3

1

2

Example 5.

Page 19: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

1

2 4

1

3

Page 20: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

3

2

3

1

2

A cycle

Page 21: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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

Page 22: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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.

Page 23: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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.

Page 24: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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

Page 25: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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.

Page 26: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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

Page 27: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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.

Page 28: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

2

1 20

31

1V1

V2

V3

V4

V5

V6

V7

2011123Example 6.

Page 29: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

0

3 11

21

2V1

V2

V3

V4

V5

V6

V7

0113212

Page 30: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

0

5 31

01

0V1

V2

V3

V4

V5

V6

V7

0115030

Page 31: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

1

1 11

22

2V1

V2

V3

V4

V5

V6

V7

1121212

Page 32: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

1

4 32

00

0V1

V2

V3

V4

V5

V6

V7

1204030

Page 33: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

3

0 10

22

2V1

V2

V3

V4

V5

V6

V7

3020212

Page 34: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

1

4 32

00

0V1

V2

V3

V4

V5

V6

V7

1204030

It repeats the step 5

Page 35: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

1

1

1

1

4

1

1

2

2

2

Dan Garbinics146 3pm

Example 7.

Page 36: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

1

2 23

2

1

1

1

3

Page 37: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

1

1

1

1

4

The End: Loop is formed. Compare to initial structureand sequence will continue.

Page 38: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University
Page 39: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University
Page 40: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University
Page 41: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

"Be an explorer, not a problem solver" ------G. C. Rota

Page 42: Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University

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!