Congklak, a traditional game solution approach with breadth first search

Congklak is a favorite populist game played at least 2 (two) players or in this article were human user and computer (AI). An essential point of playing congklak is to collect as many congklak seeds as possible to win the game, to win form from congklak it need a technique and it’s different for each players. Breadth First Search algorithm is a search algorithm which process to visit each node and the neighbors node to generate optimal graph that gives the best solution to computer (AI) and in this case were to complete the congklak game. Breadth First Search algorithm could be uses an alternative solution for optimal solution to win congklak with the help of mathematical computation.


Introduction
Congklak is a traditional game and it's known in Indonesia, congklak has a different name in every region but the way it is played the same [1,2]. Congklak played at least by 2 (two) players, when playing congklak there is no optimal movement if played by the user (human) because the user will choose a lot of seeds and it's different when applied specific algorithm to computer (AI) it will choose the fastest way to finish the game.
Many AI methods or artificial intelligence can be applied to solve the problem for choosing the best congklak seeds for game finish quickly and best movement, one of which is by using the tracking tree that is found in search algorithms such as Boyer-Moore [3], Knuth-Morris-Pratt [4], Hashing Search [5,6], Depth First Search (DFS) [7], Raita [8] and Breadth First Search (BFS) [9]. The search is performed by determining the initial state and Goal State, after determining initial state and goal state then the artificial intelligence that applied in the algorithm allows to find the optimal solution from the game.
The BFS algorithm [10,11] describes the problemsolving process which must take every best decision at each step by visiting each node of the tree that is likely to be the optimal solution for completion of congklak games.

Methodology
The searching procedure with BFS algorithm is a searching perform by visiting each node systematically at each level until the goal state is found [9,10,12,13]. Alternatively, in other words, a search is done by visiting nodes per level until a goal state is detected. If there is a solution, BFS search ensures the discovery of the solution with the shortest path. The process of BFS algorithm on the congklak game can see in the following example. b) Granary-2: 7. 1 congklak seeds already in the granary 3 c) Granary-3: 9 D. Initial State IV: a) Granary-1: 6, 2 congklak seeds are already in granaries 2, and the granaries 3 and 1 of the granary 3 are in this section b) Granary-2: 8, 1 seed granary 3 is in this section c) Granary-3: 7 Game congklak will be an order X x Y so that users can determine their own desired order. In the order X x Y, 2 boxes will be used by the starting point and point of destination, the rest to produce a path to look the path that will ultimately determine the shortest path to the destination point.
It has been explained in the analysis of the problem that the order can be adjusted to the range X x Y, one example of calculation in this congklak game will be explained by a minimum order of 3x3 because the calculation on any order will be the same [9,13,14]. In the determination of the weight of each node, it will give the value under the closest distance to the destination, for example, the node is farthest away from the destination then given a small weight while the closest node with the goal given higher weight. Example calculation as in figure 1 which given the smallest weight value is 1 and the weight is plus 1. The above process is a step that must be done to complete the game congklak, so the process will do until all the congklak seed into the big barn, figure 2 is the visualization of congklak with the accomplishment of BFS algorithm that is created, this game was created using Visual C# and this game implemented multimedia [15,16] system to make game visualization more exciting and easy to use After the initial state of the congklak where n = 7 and p = 7, the following values are taken from any value position to be transferred to the congklak granary, the value in the small granary is taken randomly, figure 3 until 8 are the few of result of congklak seeds movement.        Figure 9 is a flowchart process of congklak seed movement until all congklak seeds run out and the player won, in this case, is a computer that implements the concept of artificial intelligence with breadth-first search algorithm.

Results and Discussion
Implementation of BFS algorithm on congklak games designed using Visual C # programming language can be seen in some of the following test results: This gameplay two users, the first one is human, and the other one is a computer with breadth-first search solution to handle the game, figure 11 until 14 are the image when game congklak are being played. Fig.11. Computer Turn and Human Score. Figure 11 shown that the computer turn will pick up the best seeds congklak to move from each granary to other granary and take many seeds to win the game.   Figure 13 shows the number of scores on the computer is 49 and the computer controls the dominant game, Figure 13 shows an active yellow block indicating the game on the user side (human), after logically selecting a movement that allows winning the game results obtained as shown 14. Score user (human) has reached 25 and computer 50 with playing conditions on the computer side, and this game will continue until each one of players empties the seeds in his side.

Conclusion
Implementation of BFS algorithm as an algorithm for artificial intelligence in congklak can help to finishing the game more faster using computer AI, but in experiment not all game won by computer AI, this is because human intelligence are taking various scenario better than computer. The processing of intelligence artificial requires high computation and need addition of other algorithms such as heuristics and machine learning algorithms for better implementation.