I started with brute force indeed, then I tried to define some heuristics, but in fact the rules change pretty much every time you buy a perk, an upgrade, a piece or a new square, so the best solution can be pretty much anything for any position. So I gave up the idea of defining heuristics and focused on optimizing the brute force instead..