====== Assignment 2: SQF ====== **Deadline for submission to BRUTE is 28.11.2023** /*Your task will be to solve two-player zero-sum extensive form games as a sequence-form LP.*/ Implement [[https://cw.fel.cvut.cz/b221/_media/courses/cgt/cgt_l05_solvingefgs_2021.pdf|the Sequence Form Linear Program]] (the program is also {{ :courses:cgt:sqf_2023_formulation.pdf | extracted here }}) to compute the value of any two-player zero-sum extensive form game. ==== Template and Libraries ==== You can use {{ :courses:cgt:sqf_2023_template.zip | this template }} and {{ :courses:cgt:sqf_2023_examples.zip | examples }} to get started. We recommend you use Gurobi to solve this task, you can find its [[https://www.gurobi.com/documentation/9.5/quickstart_windows/cs_python.html|documentation here]]. You can also follow the instruction from the [[ https://cw.fel.cvut.cz/wiki/_media/courses/ko/gurobi_installation_guide_2023.pdf| Combinatorial Optimization course ]] on how to setup Gurobi locally. The libraries: ''%%numpy%%'', ''%%scipy%%'', ''%%pygambit%%'', [[https://cvxopt.org/examples/tutorial/lp.html|cvxopt]], and the ''%%cgt_bandits%%'' package from the previous part will also be available on BRUTE. ==== Requirements ==== Your program must accept the game definition in an ''efg'' format from standard input, and must write its value to standard output, i.e. the expected usage is ''%%python main.py < game.efg > out.txt%%''. You must not open, read or write to any files, and your standard output must contain only the value of the game without any debugging information. ==== Notes ==== * Use the EFGs that you have created in Assignment 1 for testing. * Gurobi can not handle variable names longer than 255 characters. * Assign identifiers to actions, such that they are unique across infosets (Folding a royal flush is not equivalent to folding a high card, they must not both be named "fold"). * You can use the ''%%pygambit%%'' library to query features of EFGs such as the infosets of each player. * The expected length of your solution is around 100 lines of code. * We use Python 3.9 and Gambit 16.0.2 for evaluation (Gambit 16.1.0 contains breaking changes!)