$Z$, $C$\
**Step 1:** Set $A_G(i,j)= (\varepsilon/3)((n-1)!)^{-1}$ if $A_G(i,j)=0$ for all $i$, $j$, goto Step 2;\
**Step 2:** Using matrix scaling to find diagonal matrix $X$, $Y$ such that the row and column sums of $B=XA_GY$ in ($1-(.1)n^{-2},1+(.1)n^{-2})$, goto Step 3;\
**Step 3:** Let $Z$ be a diagonal matrix with $Z(i,i)=\min_jB(i,j)^{-1}$ for $i=1,\cdots n$, goto Step 4;\
**Step 4:** $C=ZB$.\
After matrix scaling, matrix $C$ satisfies the requirement of generalized Bregman’s bound. Sequential acceptance/rejection method can be used to estimate $\operatorname{ham}(C)$. Note that the matrix $C$ is corresponding to a weighted digraph denoted by $G_C$.\
\
**Sub Algorithm II. Approximating Hamilton via Acceptance/Rejection**\
$Input:$ $X$, $Y$, $Z$, $C$, $\varepsilon$, $\delta$ $N$.\
$Output:$ $\mathcal {H}_1,\cdots,\mathcal {H}_s$; $\widetilde{\operatorname{ham}}(A_G)$ the estimator of $\operatorname{ham}(A_G)$.\
**Step 5:** Set $t=4N(\varepsilon/2)^{-2}\log(\delta^{-1})$, $l=\prod\limits_{i=1}^n(X(i,i)Y(i,i)Z(i,i))$, $D=C$, $k=0$ and $s=0$, goto Step 6;\
**Step 6:** Set $r=$ order of $D$;

       **If** $r=1$;

         Set $p(1)= D/Br(D)$ and $p(0)=1-p(1)$;

         Choose $I$ from $\{0,1\}$ according to $P(I=i)=p(i)$, $i=0, 1$;

                **If** $I>0$; Set $\pi(n)=1$, $s=s+1$, $k=k+1$ and $\mathcal{H}_s=HR(\pi)$;

                      **If** $k<t$; Set $D=C$, goto Step 6; Otherwise goto Step 7;

                 **Else** $I=0$; Set $k=k+1$;

                      **If** $k<t$; Set $D=C$, goto Step 6; Otherwise goto Step 7;

        **Else** $r>1$;

           Set $p(i)= D(i,1)Br(D^{'}_{i1})/Br(D)$ for $i=2,\cdots,r$ and $p(0)=1-\sum\limits_{i=2}^{r}p(i)$;

           Choose $I$ 