C# Algorithmic Game Theory API

2.3k Views Asked by At

I recently came accross Gambit - http://www.gambit-project.org/doc/index.html - a C++ algorithmic game theory API.

Is anyone aware of a .NET Game Theory Library?

2

There are 2 best solutions below

1
On

I don't know of any existing library.

The minimax algorithm is pretty easy to implement if you are doing a 2 player game. The following pseudocode is plagiarised from the wiki page:

function integer minimax(node, depth)
    if node is a terminal node or depth <= 0:
        return the heuristic value of node
    α = -∞
    for child in node:   # evaluation is identical for both players 
        α = max(α, -minimax(child, depth-1))
    return α

If you are doing more than 2 players, then there is Sturtevant and Korf's MaxN algorithm.

I've implemented these before, and they are pretty easy. It should be very straightforward in .Net.

0
On

I know this would take a small bit of time, but you could download the source for the C++ project you cited and compile it into a DLL that you could reference in your C# project. This link contains information about doing so.