15

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?

Josh Reuben
  • 577
  • 3
  • 20

2 Answers2

2

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.

FreeAsInBeer
  • 12,937
  • 5
  • 50
  • 82
0

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.

sheikhjabootie
  • 7,308
  • 2
  • 35
  • 41
  • 1
    sure these algorithms are straightforward, but does anyone know a framework that encapsulates some of the aspects of Game Theory: payoff tables, nash equilibriums, game types, competioition vs cooperation, reciprocity, utility, insurance, domination, randomization, perfect / imperfect info, subgame perfection, evolutionary dynamics, conventions, repeated games etc ? – Josh Reuben Feb 15 '11 at 08:00