Giter VIP home page Giter VIP logo

catan_board_optimization's Introduction

Catan Board Optimization using graphs in python

Using a graph theory generalization of Catan board game to create the most balanced board setup

The outcome of this project was actually pretty surprising and I found a great board setup algorithm despite setting out to just practice my graph skills. I used a scipi package cause I have built graphs out by scratch in java for data structures and wasn't really feeling like doing it again. On to the algorithm tho, you can achieve an optimally balanced board equal to one with a desert in the middle (mathematically optimal but not really common as people seem to dislike it) with a desert on the outside if you follow a specific pattern.

Setup algorithm:

Start with the desert in outer ring, but in the middle of an edge (i.e. not in a corner). Start with the A tile on the opposite corner and start going from there but when you skip the desert, go around rather than skip over the desert. This preserves all the correct adjacency of the numbers. If you look at the graphic I made in the article/jupyter notebook file it is more detailed and outlines proof for everything.

Pretty interesting stuff and it was good to practice my graph theory stuff. If you're curious check out the .ipynb file on this repo, it'll render in HTML with no dependancies, and if you have jupyterlab and pandas you can play with it, set up a unique board of your own and see all the settlement locations and relative balance scores!

catan_board_optimization's People

Contributors

maxhw98 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.