I would like to ask for some help on a deriving a command for a problem I’m trying to tackle.

So, I have a large n by n square matrix, whose elements are all either 0 or 1. I want to see by how much the single largest eigenvalue of the matrix (which Mathematica gives as the first element in the list from Eigenvalues()) changes when I change each element of the matrix individually, so that I can produce a list of this eigenvalue difference for each element. A 10 by 10 matrix would thus give a list of 100 eigenvalue differences. By “changing each element”, I mean switching the element to 1 if it’s a 0 already or to 0 if it’s a 1 already.

i.e. if the matrix is {{0,1,0},{1,0,1},{1,0,0}}, finding the largest eigenvalue of {{1,1,0},{1,0,1},{1,0,0}}, then that of {{0,0,0},{1,0,1},{1,0,0}},then that of {{0,1,1},{1,0,1},{1,0,0}} etc…

I experimented with Loops but since i and j need to increase independently I couldn’t resolve that issue. I also thought of combining ReplacePart and If but can’t find a ‘neat’ way of doing this for very large matrices.

I’d appreciate any help for the Mathematica newbie.