electronic Journal of Computer Science and Information Technology (eJCSIT), Vol. 5, No. 1, 2015

Exhaustive Search of Piece Combinations Based on Total Shannon Value

Shazril bin Azman1 Azlan Iqbal2 1, 2College of Information Technology, Universiti Tenaga Nasional, Putrajaya Campus, Jalan IKRAM-UNITEN, 43000 Kajang, Selangor e-mail: [email protected], [email protected]

Abstract— In games, the Shannon value is one way to In this paper, we demonstrate a method to produce all the represent the relative values of chess pieces. We propose a piece combinations based on a particular TSV specified. The method to perform an exhaustive search of piece combinations piece consist of different possible combinations based on any given total Shannon value. Nested loops are used of queens, rooks, knights, bishops and pawns that are equal to along with certain sentinel controls that comply with the basic any given TSV and they are technically ‘legal’ in the game. . For example, there are 9 loops assigned for the In Section II, we review some related works ranging from , as the maximum legal number of queens on the board is 9, including the promoted pawns. Therefore, each the historical background of the concept of permutation and (queen, , , , ) has its own specific number its utilization in modern day applications. Section III of loops which correspond to its legal number and they are describes the method towards generating the piece nested in together. The experiment performed shows that if combination, and Section IV shows the results obtained. We nested loops that represent each of the pieces are arranged conclude briefly with Section V. together along with the chess-based sentinel controls, they can produce all possible and legal chess piece combinations that II. LITERATURE REVIEW match the desired Total Shannon Value (TSV). This method can be used for a variety of purposes in chess engines and other A. Permutation games or areas with similar constructs and constraints. The concept of permutations was first reported in ancient Index terms— Shannon value, nested loops, piece India [3]. Old Indian scriptures, such as the Brihat Samhita combination, exhaustive search deals with the treatise of permutations such as making perfume by mixing various ingredients in various I. INTRODUCTION combinative ways. In the writings of Brahmagupta, there are The Shannon value is a representation of the relative passages that deal with inquisitive permutations to be made, values of the chess pieces. It originates from C. Shannon’s such as how many different ways that 8 doors could be approximate evaluation function for programming a opened if the number of apertures in all the doors are one, computer to play chess [1]. Shannon’s evaluation function two, three, four and so on. However, further details or can be used by the computer in a chess game to decide which depictions are not available in the ancient texts. probably the best move is in order to win. Any chess player, Permutation allows different combinations of a set of be it human or computer, would typically strive to maintain symbols, numbers or alphabets, for instance, to be made. For the Total Shannon Value (TSV) or reduce the other player’s example, given the numbers 1, 2, and 3, the total permutation TSV, which is basically material in the game. Each of the five number is six, in total and as shown in Fig. 1. different chess pieces has the following Shannon values: 1, 2, 3 • Queen = 9 1, 3, 2 • Rook = 5 2, 1, 3

• Bishop = 3 2, 3, 1

• Knight = 3 3, 1, 2

• 3, 2, 1 Pawn = 1

The is usually excluded in the TSV because it is Figure 1. Permutations of 1, 2 and 3. regarded as having ‘infinite’ importance in a chess game. Losing the king means losing the game. The values assigned The above example can also be calculated as 3! (3 to each chess piece typically depend on the inherent utility of factorial) or 3x2x1=6, meaning that it has six different ways a particular piece. C. James in his ‘relative strength’ approach of permuting the numbers. Permutations also have been in [2] added more refinements by assigning values to a chess widely used to protect multimedia data across the internet [4]. piece based on its ‘mobility aspect’ such as counting the Digital multimedia elements such as pixels and video signals number of squares controlled by the chess piece so that the can be permuted in a secure way to cipher the multimedia value of the piece is more reliable. For example, the relative data before it is sent to the authorized recipient. For example, strength value for the king at the corner of the board is 3, the word ‘drinking water’ could be encoded into ‘rgnkadnei because at that position, the king controls three squares in his wit’ by using a certain permutation matrix and can be safely surroundings. The queen would have more relative strength decoded by the authorized receiver who has a prior value than the other pieces because the queen has more decryption key. Digital multimedia files such as JPEG could controlled squares.

S. Azman and A. Iqbal, Exhaustive Search of Piece Combinations Based on Total Shannon Value 7

electronic Journal of Computer Science and Information Technology (eJCSIT), Vol. 5, No. 1, 2015 also be encoded into blurry and randomized pixels that an Hackers are more likely to be individuals who try to gain unauthorized recipient would not understand. unauthorized access on documents, software, or computer. Permutations are also useful to reduce storage Crackers, on the other hand, are the individuals who try to requirements and disk transfer rates in video-on-demand find security loopholes to bypass certain firewalls via the (VOD) systems. In video broadcasting, the management of network [10]. video storage in the set-top box (see Fig. 2) is An example of a computer program that utilizes brute important. A set-top box is another name for the video force is Chinook. Chinook is a checker program that uses a decoder [5]. In Malaysia, for example, the video decoder deep brute force search algorithm with its own evaluation device provided by AstroTM to the users is a set-top box per se function to play against human player. Chinook was played [6]. against human player in an actual checker tournament in 1992 (World Checkers Champion) but lost at the hands of Dr. Marion Tinsley, the defending champion. J. Schaeffer pointed out that there comes a point where deep brute force search is not cost effective. Certain factors such as high processing and hardware consumption should also be considered in brute force approach [11, 12]. Otherwise known as diminishing returns. C. Shannon also argued that game strategies should not rely too much on brute force. Instead, logical analyses of the piece’s position should be focused upon. Brute force is also used in password recovery tools that

permute all possible combinations of digits, alphabets and Figure 2. Astro Video Decoder. symbols to recover the forgotten password. However, since the recovery task is arduous, and could take millions of years, While buffering, part of the video block is initially stored the tools provide settings to narrow down the exhaustive in the device before being displayed, just like a YoutubeTM search, such as recovering a password that might contain a video’s buffering grey bar at the bottom of the flash video possible word or character that the user can remember, or is player that is progressively increasing throughout the contained in a dictionary [13]. playback, indicating that the video block is stored in the computer progressively [7]. C. Recursion

A method called recursion was studied. Recursion can be roughly translated as ‘call back’ [14]. It enables the computer to call back a previous instruction or code line. For example, the computer is reading code line number four, and then at the next code line, it is instructed to go back to code line number two, so the computer goes back to read code line number two. This can be done repetitively until it fulfills certain conditions. Recursion in programming can perhaps better be described as a function that calls itself in order to solve a simpler version of the problem before ‘scaling up’ to the final answer.

Figure 3. YoutubeTM buffering bar, as shown by the red arrow. D. Programming Language Used

We used the Python Programming Language to generate High bandwidth video transmission will give smooth the piece combinations. Python was developed by Guido von streaming, but it increases the storage requirement and this Rossum in 1990 [15]. It is known for its short, clear and easy could cause latency in the transmission traffic. If there are syntax, high level dynamic data types and portability. Its thousands of users being given high bandwidth video outputs can be easily copied and pasted into a spreadsheet transmission simultaneously, it would bottleneck the program such as Microsoft Excel for further analysis. transmission traffic. This will cause latency. Charu et al. in [8] introduced a permutation-based pyramid broadcasting scheme, which transmits video blocks in a pre-specified III. METHODOLOGY cyclic permutation and it substantially reduces the latency, We coin the term ‘piece combination’ as a reference to the storage and disk transfer rate. combination of chess pieces that matches the desired TSV when each of their Shannon values is summed up together. B. Brute Force The piece combination concept is inspired by the concepts of permutation, brute force and recursion, even though it does The other common name for exhaustive search is ‘brute not follow those concepts exactly. However, piece force search’. In programming, brute force generally refers to combination has some resemblance to the three concepts, as continuous loops of all probable values or conditions until the it deals with the continuity of different incremental piece solution or answer is found [9]. Hackers usually use brute combinations, repetitive loops, and brute force search. force to crack password or decode encrypted data. It is Piece combinations that are based on Shannon values interesting to note that the term ‘hackers’ and ‘crackers’ refer must be legal and abide by the rules of chess [16]. For to two different groups of people with different expertise. example, there promoted pieces cannot be more than 8. The

S. Azman and A. Iqbal, Exhaustive Search of Piece Combinations Based on Total Shannon Value 8

electronic Journal of Computer Science and Information Technology (eJCSIT), Vol. 5, No. 1, 2015 total maximum number of bishops on the board cannot board. The loop 0 to 10 is due to the fact that there are two exceed 10 (assuming all pawns have become bishops). The rooks plus 8 potentially promoted pawns and the queen is 0 to number of pawns left on the board should also reflect the 9 because there is one queen and potentially 8 promoted number that may have already been promoted etc. pawns, and the same goes with the knight and bishop. In Basically, in a chess game the TSV ranges from 0 to 103 other words, these nested loops represent all the possible for either black or white pieces. At the maximum TSV value number of pieces on the board. A simple tryout that consisted of 103, there is only one combination of chess pieces, which of three loops that contained numbers 1 to 3 was initially is 9 queens, 2 rooks, 2 bishops, 2 knights, and 0 pawns tested to test how these three loops worked together in a (9x9+5x2+3x2+3x2+1x0), where all the 8 pawns have been ‘nested’ way. Each of those numbers ranged from 1 to 3. promoted to become queens. Even though this occurrence is The a, b and c were the variables that hold the values of 1 to 3 very rare, it is still legal and it is a possible occurrence in a for each of the numbers. Therefore, each number should have chess game. It is interesting to note that there was an actual 3 loops. The result was as follows: tournament that had as many as 6 queens [17] as shown: for a in 1 to 3 for b in 1 to 3 for c in 1 to 3 print a b c

1 1 1, 1 1 2, 1 1 3, 1 2 1, 1 2 2, 1 2 3, 1 3 1, 1 3 2, 1 3 3, 2 1 1, 2 1 2, 2 1 3, 2 2 1, 2 2 2, 2 2 3, 2 3 1, 2 3 2, 2 3 3, 3 1 1, 3 1 2, 3 1 3, 3 2 1, 3 2 2, 3 2 3, 3 3 1, 3 3 2, 3 3 3.

Szalanczy vs Nguyen, Figure 5. Result for 3x3x3 combinations. First Saturday Series Hungary, Budapest 2009 The result displays all combinations ranging from 1 1 1 to Figure 4. Most queens recorded in an actual tournament game. 3 3 3 incrementally. A sentinel control could also be applied at the end of the loops. For example, printing outputs that If we take the TSV to be 3, the possible combinations have equal summation to 7 or 5: could be three pawns (1x3), or one bishop (3x1), or one If a+b+c equals to 7 then print output knight (1x3). If the TSV is 5, the possible combinations are 5 >>1 3 3 2 2 3 2 3 2 3 1 3 3 2 2 3 3 1 pawns (1x5), one bishop and 2 pawns (3x1+1x2), one knight If a+b+c equals to 5 then print output and 2 pawns (3x1+1x2), or one rook (5x1). Therefore, >>1 1 3 1 2 2 1 3 1 2 1 2 2 2 1 3 1 1 different TSVs give different combinations, and some TSVs could have more than one hundred possible combinations. This nested loop approach could also be applied in finding For example, a TSV of 44 has 201 possible combinations. all possible chess piece combinations that equal the desired A nested loop approach was tested and the result was TSV. At the sentinel control as shown in the pseudocode (IF satisfactory. A loop within a loop is commonly known as a TSV = desired TSV), the values from rook, knight, bishop, nested loop. It is a programming structure that holds queen, and pawn at the current loop will be multiplied with repetitive statements or operations in a nested form. A loop their Shannon value (queen=9, rook=5, bishop=3, knight=3, can handle incremental data such as a number 1 to 10 and do pawn=1). For example, let say there are 0 queens, 0 rooks, 1 calculations for each number without repetitively reading the bishop, 4 knights and 3 pawns at a certain loop. Therefore, same statements. Each loop could also be nested with each of the pieces will be multiplied by its own Shannon multiple sub-loops. Nested loops enable all piece value as the following: combinations to be made exhaustively. The algorithm works as the following pseudocode: • 0 x 9 = 0 • 0 x 5 = 0

FOR rook in 0 to 10 • 1 x 3 = 3 FOR knight in 0 to 10 • 4 x 3 = 12 FOR bishop in 0 to 10 • 3 x 1 = 9 FOR queen in 0 to 9 • TSV = 0 + 0 +3 +12 + 9 = 24 FOR pawn in 0 to 8 IF TSV = desired TSV Print queen, rook, bishop, knight, pawn The sentinel control will determine whether if 24 is equal End FOR to the predefined TSV that we are looking for. If it is equal to End FOR the TSV, then the output will be printed (0 queens, 0 rooks, 1 End FOR bishop, 4 knights, 3 pawns) and the loop will continue for End FOR other piece number. Otherwise, no output will be printed and End FOR the loop will go on until it meets other piece combinations

that is equal to the desired TSV. As an example, if desired

TSV is 10, the result is as the following: Each piece has its own number of loops ranging from 0 to

10, 0 to 9 and 0 to 8 as shown above. The number of loops is similar to the maximum number of pieces allowed on the

S. Azman and A. Iqbal, Exhaustive Search of Piece Combinations Based on Total Shannon Value 9

electronic Journal of Computer Science and Information Technology (eJCSIT), Vol. 5, No. 1, 2015

Table 1. Result for TSV=10. Both results from 3x3x2 and 3x2x3 nested loops vary due to the different arrangement of the loops and this gives doubt Queen Rook Bishop Knight Pawn on whether the produced piece combinations are all reached (S=9) (S=5) (S=3) (S=3) (S=1) and have nothing left out. In order to verify this, we permute 1 0 0 0 1 the arrangement of the loops. There are five chess pieces, and 0 0 1 0 7 each is dedicated to one specific loop. So 5!=120, means that 0 0 2 0 4 there are 150 ways of arranging the loops for the pieces, as 0 0 3 0 1 shown: 0 0 0 1 7 0 0 1 1 4 0 0 2 1 1 FOR queen in 0 to 9 0 0 0 2 4 FOR knight in 0 to 10 0 0 1 2 1 FOR bishop in 0 to 10 FOR rook in 0 to 10 0 0 0 3 1 FOR pawn in 0 to 8 0 1 0 0 5 0 1 1 0 2 FOR pawn in 0 to 8 0 1 0 1 2 FOR knight in 0 to 10 0 2 0 0 0 FOR bishop in 0 to 10 FOR queen in 0 to 9 FOR rook in 0 to 10 In order for the program to search the TSV values ranging from 0 to 103, each piece must have a certain number of FOR rook in 0 to 10 loops which corresponds with the legal number of pieces in FOR knight in 0 to 10 chess game. For example, if you have 9 queens on the board, FOR queen in 0 to 9 it means you have one ‘original’ queen with another 8 pawns FOR bishop in 0 to 10 that have been promoted to queens. So, you have 0 pawns FOR pawn in 0 to 8 left. Therefore, the chess game could have: FOR rook in 0 to 10 • 0 to 9 queens FOR queen in 0 to 9 • 0 to 10 rooks FOR bishop in 0 to 10 • 0 to 10 bishops FOR knight in 0 to 10 • 0 to 10 knights FOR pawn in 0 to 8

• 0 to 8 pawns ..the list continues

Nested loops enable the list of all possible combinations to be made. In order to do that, the queen must have 9 loops, The permuted arrangements of the nested loops were rook 10 loops, bishop 10 loops, knight 10 loops and pawns 8 tested and it turns out that the arrangement does not matter. loops and they are all nested together. However, different This is because different arrangements of nested loops simply orders of nested loops were tested and they gave different give different ‘positionings’ of the pieces, and the piece results. The following is the result from 3x3x2 nested loops: combination still retains the exact numberings. For example, the results from the aforementioned 3x2x3 nested loops and for a in 1 to 3 3x3x2 are equal in number (18 in total) and the ending for b in 1 to 3 combinations for both are ‘3 3 2’ and ‘3 2 3’. The result for for c in 1 to 2 print a b c both is actually similar but is merely different positioning of numbers 2 and 3. So it does not affect the piece combination and the TSV calculation. 1 1 1, 1 1 2, 1 2 1, 1 2 2, 1 3 1, 1 3 2, 2 1 1, 2 1 2, 2 2 1, 2 2 2, IV. RESULTS 2 3 1, 2 3 2, 3 1 1, 3 1 2, 3 2 1, 3 2 2, 3 3 1, 3 3 2. The total number of all possible combinations from 0 to 103 TSV is 8694. This means that there are 8694 different Figure 6. Result for 3x3x2 nested loops. piece combinations altogether from 0 to 103 TSV. Certain TSV values such as 45 and 63 could have hundreds of piece The following is the result from 3x2x3 nested loops: combinations. There are certain numbers at the peak of TSV values, which are 101 and 102, that do not have any possible for a in 1 to 3 combinations because at that point, any legal combination of for b in 1 to 2 chess pieces is impossible. for c in 1 to 3 print a b c The following tables show various results obtained from different values of TSV. Due to the lengthy list of piece combinations that could occupy thousands of lines, we could 1 1 1, 1 1 2, 1 1 3, 1 2 1, 1 2 2 not show all of them in this paper. Therefore, we picked only 1 2 3, 2 1 1, 2 1 2, 2 1 3, 2 2 1 the results for six random TSV values of 99, 103, 12, 8, 56, 2 2 2, 2 2 3, 3 1 1, 3 1 2, 3 1 3 and 20 as examples. The ‘..’ at the bottom of the tables means 3 2 1, 3 2 2, 3 2 3 the list of piece combinations is too lengthy and therefore Figure 7. Result for 3x2x3 nested loops. truncated:

S. Azman and A. Iqbal, Exhaustive Search of Piece Combinations Based on Total Shannon Value 10

electronic Journal of Computer Science and Information Technology (eJCSIT), Vol. 5, No. 1, 2015

Table 2. Result for TSV=99 Table 7. Result for TSV=20.

Queen Rook Bishop Knight Pawn Queen Rook Bishop Knight Pawn 8 3 2 2 0 2 0 0 0 2 1 0 1 0 8 1 0 2 0 5 Table 3. Result for TSV=103. 1 0 3 0 2 0 0 5 0 5 Queen Rook Bishop Knight Pawn 0 0 6 0 2 9 2 2 2 0 1 0 0 1 8 1 0 1 1 5 1 0 2 1 2 Table 4. Result for TSV=12. 0 0 4 1 5 0 0 5 1 2 Queen Rook Bishop Knight Pawn 1 0 0 2 5 1 0 0 0 3 1 0 1 2 2 1 0 1 0 0 0 0 2 2 8 0 0 2 0 6 0 0 3 2 5 0 0 3 0 3 ...... 0 0 4 0 0 1 0 0 1 0 A test on the time taken for producing the piece 0 0 1 1 6 combinations was also been made in order to ensure that the 0 0 2 1 3 undertaking process is fast. So far, the piece combinations 0 0 3 1 0 were produced were less than one second, and they were 0 0 0 2 6 tested on an old laptop running Windows XP. The following 0 0 1 2 3 is the pseudocode we used for measuring the time taken and 0 0 2 2 0 the results in the Table 8. 0 0 0 3 3 ...... Start Time FOR rook in 0 to 10 Table 5. Result for TSV=8. FOR knight in 0 to 10 FOR bishop in 0 to 10 Queen Rook Bishop Knight Pawn FOR queen in 0 to 9 0 0 0 0 8 FOR pawn in 0 to 8 0 0 1 0 5 IF TSV = desired TSV Print queen, rook, bishop, knight, pawn 0 0 2 0 2 End FOR 0 0 0 1 5 End FOR 0 0 1 1 2 End FOR 0 0 0 2 2 End FOR 0 1 0 0 3 End FOR 0 1 1 0 0 Stop Time Print Time 0 1 0 1 0

Table 6. Result for TSV=56. Table 8. Time taken for random TSVs.

Queen Rook Bishop Knight Pawn TSV Number of combinations Time taken 6 0 0 0 2 (sec.) 5 0 3 0 2 45 208 0.83 5 0 2 1 2 32 146 0.89 4 0 5 1 2 11 17 0.23 5 0 1 2 2 90 8 0.23 4 0 4 2 2 63 135 0.81 5 0 0 3 2 22 73 0.25 4 0 3 3 2 60 137 0.83 4 0 2 4 2 34 159 0.81 4 0 1 5 2 20 59 0.23 5 1 1 0 3 41 199 0.23 5 1 2 0 0 56 159 0.23 4 1 4 0 3 78 40 0.23 ...... 99 1 0.25 69 96 0.23 ......

S. Azman and A. Iqbal, Exhaustive Search of Piece Combinations Based on Total Shannon Value 11

electronic Journal of Computer Science and Information Technology (eJCSIT), Vol. 5, No. 1, 2015

Start ACKNOWLEDGMENT This research was supported, in part, by the eScienceFund grant (01-02-03-SF0240). Identify elements (pawn, queen, etc.) REFERENCES [1] C. E. Shannon, “Programming a Computer for Playing Chess,” Identify min/max loop number for Philosophical Magazine, vol. 41(314), pp. 256-275, 1950. each element (pawn=8, queen=9, etc.) [2] C. James, "Statistical Analysis of the Relative Strength of and assign them into a variable to hold Chess Positions", Pattern Recognition and Image Analysis, vol. the loop value (queen = 0 to 9, 17(4), pp. 651-662, 2004. rook = 0 to 10, etc). [3] N. L. Biggs, “The Roots of Combinatorics,” Historia Mathematica 6, pp. 109-136, 1979.

[4] S. Li, C. Li, G. Chen, N. G. Bourbakis and K. T. Lo, “A General Quantitative Cryptanalysis of Permutation-only

Nest in all elements into loops Multimedia Ciphers against Plaintext Attacks,” Signal Processing: Image Communication, vol. 23(3), pp. 212-223, 2008. [5] “ASTRO selects Pace's set-top box technology for Malaysia's Provide TSV and sentinel control first HD service,” Internet: based on chess rules www.pace.com/universal/news-events/press-releases/2010/ast ro-selects-paces-set-top-box-technology-for-malaysias-first-h d-service/, Date of extraction: Apr. 7, 2014. [6] “Astro NJOI,” Internet: Perform TSV calculation at the junaidix.com/2011/12/astro-njoi-a-new-free-satellite-service- sentinel control. Each element that with-tv1-tv2-tv3-and-others-free-channel-no-monthly-fees/, represents the piece will be multiplied Date of Extraction: Apr. 29, 2014. by its Shannon value. Then, sum all [7] “The Cool Notes – Spend the Night,” Internet: the values and compare it with the www.youtube.com/watch?v=6Bo8EQf5DF0, Date of desired TSV. extraction: Apr. 27, 2014. [8] C. C. Aggarwal, J. L. Wolf and P. S. Yu, “A Permutation-Based Pyramid Broadcasting Scheme for Video-on-Demand Systems,” Proceedings of the Third IEEE International Conference on Multimedia Computing and Output all piece combinations Systems, pp. 118-126, 1996. in the loops that equal to the [9] E. Cole, “Hackers Beware,” New Jersey: New Riders desired TSV. Abandon the Publishing (Pearson Imprint), 2002. permutations that are not [10] Syngress, “Hack Proofing XML,” Rockland: Syngress Publishing, 2002. equal to the desired TSV. [11] J. Schaeffer, P. Lu, D. Szafron, R. Lake, “A re-examination of brute-force search,” AAAI Fall Symposium on Games: Planning and Learning, pp. 51-58. 1993. [12] “What are the advantages and disadvantages of brute force End password cracking?,” Internet: malaysia.answers.yahoo.com/question/index?qid=200909220 85332AA32E7p, Date of Extraction: Apr. 29, 2014. Figure 8. Flowchart overview of algorithm used. [13] Jack Wallen, “Five Trustworthy Password Recovery Tools,” Internet: www.techrepublic.com/blog/five-apps/five-trustworthy-passw V. CONCLUSION ord-recovery-tools/1411/, Date of extraction: Apr. 7, 2014. We chose a nested loops approach to obtain all [14] R. Lorentz, “Recursive Algorithm,” Norwood: Ablex combinations of pieces that equal to a user-specified TSV Publishing Corporation, 1994. because it is fast, reliable and it utilizes exhaustive search. [15] M. Lultz. “Learning Python,” Sebastopol: O'Reilly Media, The data obtained can be further used for other purposes, 2013. such as in chess aesthetics [18]. Our method could also be [16] N. Sfetcu “The Game of Chess,” Google eBook, 2014. applicable to any other board games with different piece [17] T. Krabbé, “Chess Records,” Internet: timkr.home.xs4all.nl/records/records.htm, Date of extraction: types or even in other games such as cards (poker, hearts, Dec. 27, 2014. etc.) as well. However, this method may still need further [18] A. Iqbal, “Computing Aesthetics in Chess,” Technical Report optimizations for improved efficiency in certain cases. of the AAAI '06 Workshop on Computational Aesthetics, pp. 16-32, 2006.

S. Azman and A. Iqbal, Exhaustive Search of Piece Combinations Based on Total Shannon Value 12