Ignoring pawns there are 1,375,968,129,062,134,174,771 possible ways to place 0 to 20 walls on the Quoridor board, as answered here.
Ignoring walls there are 81 * 81 = 6410 ways to place the two pawns on the board.
Multiplying these numbers gives us all possible legal and illegal board states. How do I separate out the legal from the illegal board states?
A board state is illegal if either pawn does not have at least one path to its goal.