number of active s-boxes in a block cipher?
There many methods to find the number of active sboxes such as:

search algorithm , you input different scenarios , it is time-expensive process.

Matsui algorithm. code

Mixed integer linear programming.
I recommend you to try MIxed integer linear programming


References:
Differential and Linear Cryptanalysis using Mixed-Integer Linear Programming
Automatic Security Evaluation of Block Ciphers with S-bP Structures against Related-key Differential Attacks
New Impossible Differential Search Tool from Design and Cryptanalysis Aspects