 matrix P on a graph E that minimizes the mixing rate r, where</span>
<span class="comment">% r = max{ lambda_2, -lambda_n } with lambda_1&gt;=...&gt;=lambda_n being the</span>
<span class="comment">% eigenvalues of P.</span>

<span class="comment">% Generate input data</span>
n = 5;
E = [0 1 0 1 1; <span class="keyword">...</span>
     1 0 1 0 1; <span class="keyword">...</span>
     0 1 0 1 1; <span class="keyword">...</span>
     1 0 1 0 1; <span class="keyword">...</span>
     1 1 1 1 0];

<span class="