Skip to main content

Enhancing Hex Strategy: AI Based Two-Distance Pruning Approach with Pattern-Enhanced Alpha-Beta Search

  • Conference paper
  • First Online:
Advanced Computing (IACC 2023)

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 2053))

Included in the following conference series:

  • 214 Accesses

Abstract

This paper introduces an effective algorithm designed for creating AI systems for the Hex board strategy game. The core algorithm, developed, employs the two-distance method for both board evaluation and for sorting of the moves. For empty board positions, the sum of two-distances from both ends is calculated to indicate the position’s weight and is used for sorting. Additionally, the Pattern Search algorithm enhances efficiency by prioritizing moves in crucial regions. The algorithm demonstrated consistent performance across various board sizes, including 7 × 7, 9 × 9, and 11 × 11. When implemented as an Android game, this algorithm maintained excellent performance in the given board sizes.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    All figures in this manuscript are from the “Simple Hex Board game with AI”. Link: https://play.google.com/store/apps/details?id=com.SamgoGames.SimpleHex. The game can be installed and played on android based mobile devices with OS 7.0 and above.

References

  1. Hayward, R.B., Toft, B.: HEX the full story. CRC Recreational Mathematics Series (2019)

    Google Scholar 

  2. Pierce, J.R.: Symbols, Signals and Noise. Harper and Brothers, pp. 10–13 (1961)

    Google Scholar 

  3. Chao, G., Hayward, R., Müller, M.: Move prediction using deep convolutional neural networks in Hex. IEEE Trans. Games 10(4), 336–343 (2017)

    Google Scholar 

  4. Rijswijck, J.V.: Set colouring games. PhD Thesis, Department of Computing Science, University of Alberta, Canada (2006)

    Google Scholar 

  5. Beck, A., Bleicher, M.N., Crowe, D.W.: Excursions into Mathematics, pp. 317–387. Chapter Games, New York (1969)

    Google Scholar 

  6. Yang, J., Liao, S., Pawlak, M.: New winning and losing positions for 7×7 Hex. In: Schaeffer, J., Müller, M., Björnsson, Y. (eds.) Computers and Games (CG 2002). LNCS, vol. 2883, pp. 230–248. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-40031-8_16

  7. Rijswijck, J.V.: Computer Hex: are bees better than fruitflies? Thesis of Master of Science, p. 37, Department of Computing Science, University of Alberta, Canada (2000)

    Google Scholar 

  8. Young, K., Hayward, R.B.: A reverse Hex solver. In: Plaat, A., Kosters, W., van den Herik, J. (eds.) Computers and Games (CG 2016), LNCS, vol. 10068, pp. 137–148. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-50935-8_13

  9. Fabiano, N., Hayward, R.: New Hex patterns for fill and prune. In: Cazenave, T., van den Herik, J., Saffidine, A., Wu, I.C. (eds.) Advances in Computer Games (ACG 2019). LNCS, vol. 12516, pp. 79–90. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-65883-0_7

  10. Broderick, A., Hayward, R.B., Philip, H.: Monte Carlo tree search in Hex. IEEE Trans. Comput. Intel. AI Games 2(4), 251–258 (2010)

    Article  Google Scholar 

  11. Huang, S.C., Arneson, B., Hayward, R.B., Müller, M., Pawlewicz, J.: MOHEX 2.0: a pattern-based MCTS Hex player. In: International Conference on Computers and Games, Computers and Games (CG 2013), pp. 60–71 (2013)

    Google Scholar 

  12. Young, K., Vasan, G., Hayward, R.: NeuroHex: a deep q-learning Hex agent. In: Workshop on Computer Games, International Workshop on General Intelligence in Game Playing Agents (CGW 2016, GIGA 2016), Computer Games (2016)

    Google Scholar 

  13. Anshelevich, V.V.: A hierarchical approach to computer Hex. Artif. Intell. 134(1–2), 101–120 (2002). https://doi.org/10.1016/S0004-3702(01)00154-0

    Article  Google Scholar 

  14. Chao, G., Siqi, Y., Hayward, R., Müller, M.: A transferable neural network for Hex. ICGA J. 40(3), 224–233 (2018)

    Google Scholar 

  15. Woodcok, M., Uscategui, F., Corrales, D.: Basic analysis of Hex game. Econógrafos, Escuela de Economía 13417, Universidad Nacional de Colombia, FCE, CID (2015)

    Google Scholar 

  16. Liu, H., Du, X.: Strategy and implementation of Hex. In: Proceedings of the 2020 4th International Conference on Electronic Information Technology and Computer Engineering (EITCE 2020), pp. 800–805 (2020)

    Google Scholar 

  17. Yang, J., Simon, L., Mirek, P.: A new solution for a 7×7 Hex game (2002)

    Google Scholar 

  18. Rasmussen, R.: Algorithmic approaches for playing and solving Shannon games. PhD Dissertation, Faculty of Information Technology, Queensland University of Technology, pp. 24–26, 49–52, 108–111 (2007)

    Google Scholar 

  19. David, S., et al.: A general reinforcement learning algorithm that masters chess, shogi, and Go through self-play. Science 362, 1140–1144 (2018). https://doi.org/10.1126/science.aar6404

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgments

This work has been carried out as part of Summer Internship under the guidance of Mr. Naga Srinivas Vemuri, Google IT Services India Pvt Ltd, Hyderabad in his personal capacity. The author is deeply indebted to Dr. Naga Srinivas Vemuri, who is the primary developer of the code, for mentoring at every stage during the development of algorithm for building AI for the Hex board strategy game and for support during testing and performance evaluation.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Saatvik Saradhi Inampudi .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Inampudi, S.S. (2024). Enhancing Hex Strategy: AI Based Two-Distance Pruning Approach with Pattern-Enhanced Alpha-Beta Search. In: Garg, D., Rodrigues, J.J.P.C., Gupta, S.K., Cheng, X., Sarao, P., Patel, G.S. (eds) Advanced Computing. IACC 2023. Communications in Computer and Information Science, vol 2053. Springer, Cham. https://doi.org/10.1007/978-3-031-56700-1_36

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-56700-1_36

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-56699-8

  • Online ISBN: 978-3-031-56700-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics