Maximize $\operatorname{tr}(A^k)$ over binary symmetric $n$ by $n$ matrices subject to $$a_{ii}=0, \sum_{j=1}^n a_{ij}=d, \sum_{i=1}^na_{ij}=d,$$ where $d,k$ are fixed positive integers.
I am having trouble even for the case where $k=5$ and $d=4,$ so even some help here would be greatly appreciated.