Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Chip-firing Game and Data Structures Prof. Sin-Min Lee Department of Computer Science San Jose State University."— Presentation transcript:

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

2

3

4 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.

5 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.

6

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

8

9

10 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.

11 a famous discrete dynamical system the Chip Firing Game, used as a model in physics, economics and computer science avanlache model in statistical mechanic.

12 Example 1.

13 1 3 4 1 3 1 1 2 1 1 213 2 1 2 21 2 1 23 2 1 4 1 st 2 nd 4 th 3 rd 5 th 6 th Example 2

14 2 1 2 1 4 6 th 7 th 3 1

15 4 1 1 st 2 nd 4 th 3 rd 5 th 6 th 2 2 1 2 2 4 2 1 3 11 1 1 21 3 31 3 1 Example 3.

16 Example 4. 1 st 2 nd

17 3 rd

18 3 2 3 1 2 Example 5.

19 1 24 1 3

20 3 2 3 1 2 A cycle

21 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

22 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.

23 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.

24 Example V1 V2V3 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

25 V1 V2V3 1 chip of V2 goes to V1 and 1 chip of V2 goes to V3 because ONLY 1 chip can be fired onto an adjacent Vertex 1 0 1 Array 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.

26 4 The number 4 means four chips In V4. Firing the chips is okay because There are 4 adjacent vertices V1 V2 V3 V4 V5 V6 V7

27 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.

28 2 12 0 3 1 1 V1 V2 V3 V4 V5 V6 V7 2011123 Example 6.

29 0 31 1 2 1 2 V1 V2 V3 V4 V5 V6 V7 0113212

30 0 53 1 0 1 0 V1 V2 V3 V4 V5 V6 V7 0115030

31 1 11 1 2 2 2 V1 V2 V3 V4 V5 V6 V7 1121212

32 1 43 2 0 0 0 V1 V2 V3 V4 V5 V6 V7 1204030

33 3 01 0 2 2 2 V1 V2 V3 V4 V5 V6 V7 3020212

34 1 43 2 0 0 0 V1 V2 V3 V4 V5 V6 V7 1204030 It repeats the step 5

35 1 1 1 1 4 1 1 2 2 2 Dan Garbini cs146 3pm Example 7.

36 1 223 2 1 1 1 3

37 1 1 1 1 4 The End: Loop is formed. Compare to initial structure and sequence will continue.

38

39

40

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

42 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!


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

Similar presentations


Ads by Google