Note that by nefness of $K_W$, at most one $(-1)$-curve in these $E_i$ intersects ending curves of both T-chains. So first, we assume that each $(-1)$-curve in these $E_i$s intersects a curve which is not an ending curve. Then following the proof of Theorem <ref> and using the formula in Remark <ref>, we obtain that $r_i-d_i \geq m_1+m_2-2$.

If $r_i-d_i \geq m_1+m_2$ for $i=1,2$, then we are done.

If $r_1-d_1=m_1+m_2-2$ (the case $i=2$ is analog), then the T-chain is

Then from the other T-chain we have a connecting $(-1)$-curve on the left, giving the chain of curves $(1)-[2,\ldots,2,m_2+2,2,\ldots,2,m_1+2]$
But then after contracting the chain $[2,\ldots,2]-(1)$ connected to the $(-m_2-2)$-curve, we get $(1)-[2,\ldots,2]-(1)$, and this contradicts nefness of $K_S$.

If $r_1-d_1=m_1+m_2-1$, then this T-chain is one of

* $[2,\ldots,2,m_2+2,2,\ldots,2,m_1+3]$,

* $[2,\ldots,2,3,m_2+2,2,\ldots,2,m_1+2]$, or

* $[2,\ldots,2,m_2+3,\underbrace{2,\ldots,2}_{m_2-2},m_1+2]$.

Indeed, the first of these options contradicts the fact that $K_S$ is nef, following the exact same reasoning as above. We will show that the second and third imply $r_2-d_2\ge m_1+m_2+1$, giving us the desired inequality.

For the second, observe that in order for this to be a T-chain, it must be of the form

$$[2,\ldots, 2, 3, m_2+2, m_1+2]$$

and so in particular, $m_2=3$ and this T-chain is $[2, \ldots, 2, 3, 5, m_1+2]$.  Then the second T-chain is

$$[m_2+2=5,\ldots,x\geq m_1+3,\ldots,y\ge 3,2,2,2].$$

If $x$ and $y$ correspond to the same curve, then by nefness of $K_S$ we obtain that $x\geq m_1+6$, so we have $r_2-d_2\ge m_1+4+m_2-2=m_1+m_2+2$.

If $x$ and $y$ correspond to different curves, then we immediately have $r_2-d_2 \geq m_2 +m_1+1 + 1 -2=m_1+m_2$. If $r_2-d_2=m_1+m_2$, then $x=m_1+3$ and $y=3$. But then the curve corresponding to $y$ eventually becomes a $\P^1$ with $0$ self-intersection, but this contradicts the assumption $K_S$ nef.

For the third option, the second T-chain has the form
$$[m_2+2,\ldots,x\geq m_1+2,\ldots,y,2,\ldots,2],$$

where the curve corresponding to $x$ is connected via a $(-1)$-curve to the first T-chain. If $x$ and $y$ correspond to the same curve, then as in the previous case, we obtain $x\ge m_1+6$, leading us to the desired inequality. Otherwise, using that $K_S$ is nef, we obtain that $y \geq m_2+5$. Indeed the $-(m_2+3)$-curve in the first T-chain will eventually become a $(-1)$-curve. Therefore, as $K_S$ is nef, we must have $y-1-1-(m_2-2)\geq 1$. Hence we obtain the inequality $r_2-d_2 \geq m_1+m_2+1 $.

Now suppose that one of the  $(-1)$-curves is connected to two end curves in the T-chains. Let $V_2$ be the T-chain that has $(-1)$-curves connected to both ends. By Proposition <ref>, we have that $r_2-d_2\geq m_1$ and $r_2-d_2\geq m_2$. By the formula in Remark <ref>, we have that $r_1-d_1+2\geq m_1+m_2$. Like in the previous case we can discard the possibility of $r_1-d_1=m_1+m_2-2$.

Using that $2(r_2-d_2)\geq m_1+m_2$, we obtain that $2(R-D)\geq 3(m_1+m_2)-2=3Z-2$. Therefore we have the desired inequality as a consequence of Proposition <ref>.

(T.2.1)+(T.2.2). We observe that the (T.2.2) has $m,n>0$.

Let $V_1$ be the vertex with only black dots when one considers the (T.2.1) maximal $E_i$. Then the ending $(-2)$-curves in the corresponding T-chain are part of the (T.2.2) maximal $E_i$ which contains the ending $(-2)$-curves, and this T-chain is  connected to the other T-chain via a black dot. A discrepancy computation shows that this connection is not an ending curve. Via the same proof as Proposition <ref>, and using that we have an additional condition on some black dot in this T-chain, one can show that $r_1-d_1 \geq m+n+1$, where $m,n$ are the parameters associated to the (T.2.2).

Therefore, from $r_1-d_1 \geq m+n+1$ and $r_2-d_2 \geq m+n$, we obtain $r_1-d_1 + 3(r_2-d_2) \geq 4(m+n)+1=4(Z-p)+1,$ where $p$ is the parameter for the (T.2.1). Therefore $3(R-D) \geq 4Z+1 + 2(r_1-d_1-2p)$, but we will show that $r_1-d_1\geq 2p$.

Let $m'$ be the number of ending $(-2)$-curves of $V_1$.
We have that $p\leq m'$ by using that these are T-chains and that $K_S$ is nef.
We now observe that $r_1-d_1+2 \geq p + m'\ge 2p$ directly from our situation.  Therefore $r_1-d_1 \geq 2p-2$. By considering the curve attached to the $(-1)$-curve in the T.2.1 maximal $E_i$, we can use an analysis similar to that of case (T.2.1)+(T.2.1) above to show that $r_1-d_1=2p-2$ and $r_1-d_1=2p-1$ are impossible.

(T.2.1)+(C.1). Let $V_1$ be the vertex with no loop. Let $m$ be the weight of the edge connecting $V_1$ and $V_2$ and let $n$ be the weight for the loop.

Assume first that the $(-1)$-curve connecting $V_1$ and $V_2$ is connected to two ending curves.
Using formula <ref>, that $K_S$ is nef, and an analysis of the curves in the second T-chain that are adjacent to the maximal $E_i$s, we obtain that $r_2-d_2 +2 \geq (n+2-2) + (m+2-2) + (n+2-2) + (3-2)$, and so $r_2-d_2 \geq 2n+m-1$. On the other hand, we know that $r_1-d_1 \geq m$, and so $R-D \geq 2n+2m-2=2Z-1$. Then the inequality is a direct consequence of Proposition <ref>.

Suppose now that the $(-1)$-curve in the T.2.1 is connected to two ending curves. By formula <ref> and $K_S$ being nef, we obtain that $r_2-d_2+2\geq (m+2-2)+(n+2-2)+(3-2)$, again by an analysis of the curves in the second T-chain that are adjacent to the maximal $E_i$s. We also have that $r_2-d_2\geq 2n$ by Proposition <ref>. Therefore $2(R-D)\geq 2(m)+(m+n-1)+(2n) =3m+3n-1=3Z-1$. Therefore the inequality is a consequence of Proposition <ref>.

(T.2.2)+(C.1). This is a direct application of Theorem <ref>.

(T.2.1)+(C.2). Let $V_1$ be the vertex with no loop. The edge connecting $V_1$ and $V_2$ has weight $m$, i.e. assume the first T-chains has $m$ ending $(-2)$-curves. Let $n$ be the number of ending $(-2)$-curves in the second T-chain. We have $r_1-d_1 \geq m$ by Proposition <ref>. Then one shows that $r_2-d_2 \geq m+2n-1$ via the same analysis as in previous cases.
Therefore, as $Z=m+1$, we obtain $2Z \leq R-D +1$, and so by Proposition <ref> we get the claimed inequality.

(T.2.2)+(C.2). This is a direct application of Theorem <ref>.

Almost all the inequalities in Theorem <ref> are sharp. Below we give examples for some of them.

It is easy to find optimal examples for (1) in Theorem <ref>. See e.g. <cit.> (which also has no obstructions to deformations), and

The following is an optimal example for (2) in Theorem <ref> part (C.1). Start with an elliptic K3 surface that has one $I_2$ fiber and $22$ $I_1$ fibers, and sections. This can be done via base change on a general  rational elliptic surface with sections. Consider the configuration given by one section, one $I_2$ and one $I_1$. Blow-up at the two nodes of the $I_2$, and three times over the node of the $I_1$. We obtain two chains:  $[4,2,6,2,2]$ and $[4]$. Their contraction $W$ has ample $K_W$. We have $\frac{r_1-d_1}{2}=2$, $r_2-d_2=0$, $K_S^2=0$, $K_S \cdot \pi(C)=0$, and $K_W^2=1$. Note that by <cit.>, we have that $H^2(W,T_W)=\C$.

This is an optimal example for (2) in Theorem <ref> part (C.2).  Consider a K3 surface with an elliptic fibration with sections and singular fibers $I_4+20I_1$. This is easy to construct via base change over a rational elliptic fibration with an $I_2$ and ten $I_1$ singular fibers. Assume it has two sections intersecting opposite curves $A,C$ in the $I_4$ fiber. Consider also another component $B$ of the $I_4$. The initial configuration is then $A,B,C$, one $I_1$, and two sections. We blow-up the node of the $I_1$ twice, the intersection of $A$ with $B$, and the intersection of the other section with the $I_1$. Then we obtain two T-chains $[2,6,2,3]$ and $[3,2,3]$. The $[2,6,2,3]$ is part of a (C.2). Contract them both to get $W$ with $K_W$ ample and $K_W^2=1$. By <cit.> we have no obstructions to deform $W$.

Next, we give an optimal example for (3) in Theorem <ref> part (T.2.4). Consider a rational elliptic fibration with sections, and singular fibers: $II$ (rational cuspidal curve) and ten $I_1$. We do the base change of degree two over two nonsingular fibers. This is an elliptic K3 surface. We consider a section, one $II$, and one $I_1$. We blow-up the node of the $I_1$, and blow-up four times over the cusp of $II$, so that we have   $[4,2,6,2,2]$ and $[4]$ in a (T.2.4). If $W$ is the contraction of these two T-chains, then $K_W$ is ample and $K_W^2=1$.

This is an optimal example for (3) in Theorem <ref> case (T.2.1)+(T.2.1). Let us consider a rational elliptic fibration with sections, and singular fibers: $I_2$ plus ten $I_1$. Consider two disjoint sections intersecting both components of the $I_2$ fiber. Take a base change of degree $3$ at two nonsingular fibers. Then we have an elliptic fibration with sections of self-intersection $(-3)$. We obtain an elliptic fibration with three $I_2$ and $30$ $I_1$ as singular fibers. Consider the pre-image of the two sections and one of the $I_2$. Blow-up at the two nodes of the $I_2$ twice. We obtain two T-chains $[2,5,3]$. Their contraction is $W$. It has $K_W$ ample and $K_W^2=2$. One checks that equality holds in this example.

This is an optimal example for (3) in Theorem <ref> part (T.2.1)+(T.2.2), similar to the previous example. Start with an elliptic rational surface with sections and 12 $I_1$ fibers. Take base change of degree $3$ over an $I_1$ and over a nonsingular fiber. Then we have an elliptic fibration with sections of self-intersection $(-3)$ and an $I_3$ fiber. We blow-up twice over two of their nodes, and consider one section. We obtain T-chains $[2,5,3]$ and $[2,3,4]$. Their contraction defines a $W$ with $K_W$ ample and $K_W^2=1$. One checks that equality holds. This example appears in <cit.>.

[1]
V. Alexeev,
Boundedness and $K^2$ for log surfaces,
Internat. J. Math. 5(1994), no. 6, 779–810.

[2]
S. Coughlan, M. Franciosi, R. Pardini, J. Rana, S. Rollenske,
On T-divisors and intersections in the moduli space of stable surfaces $\overline{\text{M}}_{1,3}$,
J. Lond. Math. Soc. (2)107(2023), no.2, 750–776.

[5]
J. Evans, I. Smith,
Bounds on Wahl singularities from symplectic topology,
Algebr. Geom.7(2020), no.1, 59–85.

[6]
M. Franciosi, R. Pardini, J. Rana, S. Rollenske,
I-surfaces with one T-singularity,
Boll. Unione Mat. Ital.15(2022), no.1–2, 173–190.

[7]
Y. Kawamata,
Moderate degenerations of algebraic surfaces,
Complex algebraic varieties, Bayreuth, 1990, Lecture Notes in Math. 1507, Springer, Berlin, 1992, 113–132.

[8]
J. Kollár, N. I. Shepherd-Barron,
Threefolds and deformations of surface singularities,
Invent. Math. 91(1988), 299–338.

[10]
Y. Lee, J. Park,
A simply connected surface of general type with  $p_g=0$  and  $K^2=2$,
Invent. Math. 170 (2007), no. 3, 483–505.

[11]
H. Park, J. Park, D. Shin,
A simply connected surface of general type with  $p_g=0$  and  $K^2=3$,
Geom. Topol. 13 (2009), no. 2, 743–767.

[12]
H. Park, J. Park, D. Shin,
A simply connected surface of general type with  $p_g=0$  and  $K^2=4$,
Geom. Topol. 13 (2009), no. 3, 1483–1494.

[13]
J. Rana,
A boundary divisor in the moduli space of stable quintic surfaces,
Internat. J. Math. 28(2017), no. 4, 1750021.

[14]
J. Rana, G. Urzúa,
Optimal bounds for T-singularities in stable surfaces,
Adv. Math. 345 (2019), 814–844.

[15]
J. Reyes, G. Urzúa,
Rational configurations in K3 surfaces and simply-connected
$p_g=1$ surfaces with $K^2=1,2,3,4,5,6,7,8,9$,
Math. Z. 302 (2022), 2435–2467.

[16]
J. Stevens,
On the versal deformation of cyclic quotient singularities,
Singularity theory and its applications, Part I(Coventry, 1988/1989), Lecture Notes in Math. 1462, Springer, Berlin (1991), 302–319.

[17]
A. Stern, G. Urzúa,
KSBA surfaces with elliptic quotient singularities, $\pi_1=1$, $p_g=0$, and $K^2=1,2$, Israel J. Math.214(2016), no.2, 651–673.

[18]
S. Tsunoda, De-Qi Zhang,
Noether's inequality for noncomplete algebraic surfaces of general type, Publ. Res. Inst. Math. Sci. 28(1992), No1, 21–38.

[19]
J. Wahl,
Smoothings of normal surface singularities,
Topology 20 (1981), No3, 219–246.

If $K_S$ is nef and in a connected component of the directed graph there is no cycle, where we include a vertex connected to itself as a cycle, then $(l'-1)(R'-D')\geq l'Z'$, where $l'$ is the number of T-chains associated to the vertices in the component, $R'$, $D'$ are the sums of the $r_i$, $d_i$ of these T-chains, and $Z'$ is the sum of the values in the edges of the component of the directed graph.

There can only be maximal $E_i$ as in Figure <ref> or <ref>. So, using the Propositions <ref> to <ref>, we have that $r_V-d_V \geq z_{L_{VV'}}$, where $r_V,d_V$ are the values in the T-chain corresponding to vertex $V$ in the directed graph, and $z_{L_{VV'}}$ is the value in an edge connected to $V$. So it is enough to use Corollary <ref> with $a_V=r_V-d_V$ and $b_{VV'}=z_{L_{VV'}}$.

If $K_S$ is nef, and in a connected component of the directed graph there is a maximal $E_i$ as in Figure <ref> to <ref> or Figure <ref>, then $(l'-1)(R'-D')\geq l'Z' -l'$, where $l'$ is the number of T-chains associated to the vertices in the component, $R'$, $D'$ are the sums of the $r_i$, $d_i$ of these T-chains, and $Z'$ is the sum of the values in the edges of the component of the directed graph.

By Propositions <ref> to <ref> we have  $r_V-d_V\geq z_{L_{VV'}}$,  where $r_V,d_V$ are the values in the T-chain corresponding to vertex $V$ in the directed graph, and $z_{L_{VV'}}$ is the value in an edge connected to $V$. So we can use Corollary <ref> on the graph after removing the cycle, with $a_V=r_V-d_V$ and $b_{VV'}=z_{L_{VV'}}$. So it is enough to notice that $\sum b_{VV'}=Z'-1$, because we are missing the cycle.

If $K_S$ is nef, and in a connected component of the directed graph there is a maximal $E_i$ as in Figure <ref>, then $(l'-1)(R'-D')\geq l'Z' -3l'+1$, where $l'$ is the number of T-chains associated to the vertices in the component, $R'$, $D'$ are the sums of the $r_i$, $d_i$ of these T-chains, and $Z'$ is the sum of the values in the edges of the component of the directed graph.

Let $V_1$ be the vertex corresponding to the vertex with a cycle.
We have  $r_V-d_V\geq z_{L_{VV'}}$,  where $r_V,d_V$ are the values in the T-chain corresponding to vertex $V\neq V_1$ in the directed graph, and $z_{L_{VV'}}$ is the value in an edge connected to $V$. For $V_1$ we have $r_{V_1}-d_{V_1}=2\geq z_{L_{VV_1}}-1$ So we can use Corollary <ref> with $a_V=r_V-d_V$ for $V \neq V_1$ and $a_{V_1}=r_{V_1}-d_{V_1}+1$ and $b_{VV'}=z_{L_{VV'}}$. Noticing that $\sum b_{VV'}=Z'-2$, because we are missing the cycle, we obtain
$$(l'-1)(R'-D'+1)\geq l'Z' -2l'.$$

If $K_S$ is nef  and in a connected component of the directed graph there is a cycle in the directed graph, only having maximal $E_i$s as in Figures <ref>, <ref> or <ref>, then there is a special vertex $V_i$ and an edge $L_j$ that is part of the cycle connected to it, such that $r_{V_i}-d_{V_i} \geq 2z_{L_j}- 1$, where $r_{V_i},d_{V_i}$ are the values in the T-chain associated to the vertex $V_i$ and $z_j$ is the value of the edge $L_j$. The inequality is strict if there is a maximal $E_i$ as in Figure <ref>.

If there is a maximal $E_i$ as in Figure <ref>, then by Proposition <ref> the vertex connected to itself has the desired property.
So, we are left only with the case where every maximal $E_i$ is as in Figure <ref> or <ref>. We look at the cycle in this context, it must be a directed cycle, since no two edges can point away from the same vertex. To every vertex assign the length of the chain of $(-2)$-curves that the T-chain has at one of its ends.

If there are vertices with different numbers in the cycle, then we name as $V$ a vertex with the smallest number, such that the vertex ($V'$) which is connected to $V$ with an edge pointing at $V'$ has a bigger number. Then the maximal $E_i$ which gives the edge connecting $V$ and $V'$ has to be as in Figure <ref>, since in Figure <ref> both T-chains have chains of $(-2)$-curves of the same length.  Also the $(-1)$-curve connecting the T-chains corresponding to $V$ and $V'$, must intersect the T-chain corresponding to $V'$ at a curve that is not an end-curve. So, $r_{V'}-d_{V'}+2 \geq y_{V'}+y_V+1\geq 2y_V+2$, where $y_V$ is the length of the chain of $(-2)$-curves in the T-chain corresponding to vertex $V$. So, it is enough to notice that $y_V$ is also the number assigned to the edge joining $V$ and $V'$.

If each vertex in the cycle has the same number, then call $V$ the vertex in the cycle such that the discrepancy at the $(-2)$-end curve is the biggest possible, such that the vertex ($V'$) which is connected to $V$ with an edge coming out of $V$, has lower discrepancy at the $(-2)$-end curve. Then, in the maximal $E_i$, which gives the edge connecting $V$ and $V'$, the $(-1)$-curve connecting the T-chains corresponding to $V$ and $V'$, must intersect the T-chain corresponding to $V'$ at a curve that is not an end-curve. Otherwise the discrepancies in the curves intersecting the $(-1)$-curve would not add up to less than $(-1)$. So it must be as in Figure <ref>. Thus $r_{V'}-d_{V'}+2 \geq y_{V'}+y_{V}+1= 2y_V+1$, where $y_x$ is the length of the chain of $(-2)$-curves in the T-chain corresponding to vertex $x$.It is enough to notice that we have that $y_V$ is also the number assigned to the edge joining $V$ and $V'$.

If $K_S$ is nef, then for any connected component of the directed graph we have $(2l'-1)(R'-D') \geq 2l'Z'-l'$, where $l'$ is the number of T-chains associated to the vertices in the component, $R'$, $D'$ are the sums of the $r_i$, $d_i$ of these T-chains, and $Z'$ is the sum of the values in the edges of the component of the directed graph. The inequality is strict if in the component there are maximal $E_i$s other than those from Figures <ref> and <ref>.

For the case when there are no cycles we have a better bound, so we only have to take care of the case when the number of edges is the same as the number of vertices.

If there is a maximal $E_i$ as in Figure <ref> to <ref> or Figure <ref>, then by Propositions <ref> and <ref> we have a better bound, so we can discard these cases.

Let $V_1$ and $L_1$ be the vertex and edge from Proposition <ref>. Using the Propositions <ref> to <ref>, we have that $r_{V_1}-d_{V_1}\geq 2z_{L_1}-1$  and $r_V-d_V \geq z_{L_VV'}$, for all vertices, where $r_V,d_V$ are the values in the T-chain corresponding to vertex $V$ in the directed graph, $L_{VV'}$ is an edge connected to $V$, and $z_{L}$ is the value in the edge $L$. So we can use Corollary <ref> removing $L_1$ from the component with fixed vertex $V_1$, $a_V=r_V-d_V$ and $b_{VV'}=z_{L_{VV'}}$. So, it is enough to add $l'(r_{V_1}-d_{V_1})\geq 2l'z_1-l'$ to the inequality. If we had a maximal $E_i$ as in Figure <ref>, then we would have to add $l'(r_{V_1}-d_{V_1})\geq 2l'z_1$ instead, to get $(2l'-1)(R-D) \geq 2l'Z'$.

If $ \alpha(R-D) \geq \beta Z -\gamma$, then
$$R-D \leq 2\frac{\beta}{\beta-\alpha}(K_W^2-K_S^2)+\frac{1}{\beta-\alpha}\gamma-\frac{\beta}{\beta-\alpha}\lambda.$$

This is a direct consequence of Proposition <ref>.

If $K_S$ is nef, then
$$R-D \leq 4L(K_{W}^2-K_{S}^2)+l-2LK_S\cdot \pi(C) ,$$
where $L$ is the maximum number of vertices in a connected component of the directed graph, in particular $L\leq l$.

For any connected component of the directed graph with $l'$ vertices, by Theorem <ref> we have $(2l'-1)(R'-D') \geq 2l'Z'-l'$. Since $Z'$ is at least the number of edges we obtain that $(2l'-1)(R'-D')\geq (2l'-1))Z'$, adding this inequality with the right coefficient to the inequality from Theorem <ref>, we obtain $(2L-1)(R'-D')\geq 2LZ'-l'$. If we do this for every connected component and add all the inequalities, then we obtain

$$(2L-1)(R-D)\geq 2LZ-l.$$

Finally we put together this inequality with  Proposition <ref>.

For fixed $l$ and any $\varepsilon \in \mathbb{R}_{>0}$, there exists a combinatorial configuration of $l$ T-chains such that

a) $(2l-1)(R-D)<(2l+\varepsilon)Z$.

b) $R-D > 4(L-\varepsilon)(K_{W}^2-K_{S}^2)-2(L-\varepsilon)K_S\cdot \pi(C).$

c) $R-D > 2(L-\varepsilon)(K_{W}^2-K_{S}^2).$

Proposition <ref>a) and <ref>b), with Theorems <ref>  and <ref> give us optimality in an asymptotic sense, but we do not have a counterpart for Proposition <ref>c) that bounds $R-D$ only in terms of $K_W^2-K_S^2$ optimally.

What we can do now is to find some properties of the families of combinatorial T-chains that give the optimums in our bounds.

If $K_S$ is nef and the T-chain corresponding to vertex $V$ is contained only in maximal $E_i$s as in Figures <ref>, <ref> or <ref>, then in the directed graph we have that $2(r_V-d_V)\geq z_V$, where $z_V$ is the sum of the values in all the edges connected to $V$ and $r_V,d_V$ are the values in the T-chain corresponding to $V$.

This is just combining Propositions <ref>, <ref> and <ref>, using the fact that the maximal $E_i$s are pairwise disjoint and for two maximal $E_i$s as in Figure $\ref{nC.3}$ the $[w_1,\ldots,w_{m_1}]$ and $[y_1',\ldots,y_{m_2'}']$ from Proposition <ref> in the same T-chain from different $E_i$s are also disjoint, because the center divisors separate them.

If $K_S$ is nef and in a connected component of the directed graph there is no cycle, where we include a vertex connected to itself as a cycle, then $(Y+1)(R'-D')\geq (Y+2)Z'$, where $Y$ is the number of vertices which are not leaves in the connected component of the directed graph, $R'$, $D'$ are the sums of the $r_i$, $d_i$ of the T-chains in the component, and $Z'$ is the sum of the values in the edges of the component of the directed graph.

Let $R_1,D_1$ and $R_2,D_2$ be the sums of $r_i,d_i$ in the vertices corresponding to leaves and the rest of them, respectively. Let $Z_1$ and $Z_2$ be the sums of the values in the edges connected to leaves and the rest of them, respectively.
There can only be maximal $E_i$s as in Figure <ref> or <ref>. So, using Propositions <ref> and <ref>, we have that $r_V-d_V \geq z_{L_{VV'}}$, where $r_V,d_V$ are the values in the T-chain corresponding to vertex $V$ in the directed graph, and $z_{L_{VV'}}$ is the value in an edge connected to $V$. We use Corollary <ref> with $a_V=r_V-d_V$ and $b_{VV'}=z_{L_{VV'}}$ on the tree that is obtained by removing all the leaves, and obtain
$$(Y-1)(R_2-D_2)\geq (Y)(Z_2).$$
By adding the inequalities $r_V-d_V\geq z_L$ for every leaf $Y$ times, we obtain
$$Y(R_1-D_1)\geq YZ_1.$$
By adding the inequality obtained from Proposition <ref> at each non-leaf vertex, we obtain
$$2(R_2-D_2)\geq Z_1 +2Z_2.$$

By adding this three inequalities, and noticing that $R-D=R_1-D_1+R_2-D_2$ and $Z=Z_1+Z_2$, we obtain the desired inequality.

This is generally better than Proposition <ref>, since $Y\leq l'-2$, where $Y$ is the number of non-leaf vertices and $l'$ is the number of vertices in the connected component of the directed graph. Using Proposition <ref>, we can change $l'$ to $Y+2$ in Propositions <ref> and <ref>, where $Y$ is the number of non-leaf vertices in the connected component after removing the loop.

If $K_S$ is nef  and in a connected component of the directed graph there is a cycle in the directed graph, only having maximal $E_i$s as in Figures <ref>, <ref> or <ref>, then we have $(2Y+3)(R'-D') \geq (2Y+4)Z'-Y-2$, where $Y$ is the number of non-leaf vertices in the connected component after removing the edge $L_j$ from Proposition <ref>, $R'$, $D'$ are the sums of the $r_i$, $d_i$ of the T-chains in the connected component, and $Z'$ is the sum of the values in the edges of the component of the directed graph.

By Proposition <ref> on the component without the edge $L_j$, we have
$$(Y+1)(R'-D')\geq (Y+2)(Z'-Z_{L_j}).$$
By Proposition <ref>, we have
And  by the bijection from Lemma <ref>, removing $L_j$ and fixing $V_i$, we obtain
$$(Y+2)(R'-D'-(r_{V_i}-d_{V_i}))\geq (Y+2)(Z'-Z_{L_j}).$$
By adding this 3 inequalities, we obtain the result.

We call cycle a connected graph where every vertex has two edges and line a tree where no vertex has more than two edges.

For any connected component of the directed graph that is not a cycle or a line with a loop at one end, we have
$$(2l'-2)R'-D'\geq (2l'-1) Z'-l'.$$

By Remark <ref> and Propositions <ref> and <ref>, we only need to look at components which are the result of adding an extra edge (or loop) to a tree with exactly two leaves. So, we only need to look at the cases of a cycle with two lines connected to neighbouring vertices of the cycle, and the case of a line with a loop at a vertex in the middle.

For the case of the cycle. Let us call $L$ the edge from Proposition <ref>. Let us label the vertices $V_1$ to $V_{l'}$, so that after removing the edge $L$ the neighbouring vertices  have consecutive indices and label $L_i$ the edge between $V_i$ and $V_{i+1}$. We call $V_{A},V_{B}$, $A<B$ the vertices connected to $L$. Without loss of generality suppose $V_A$ is the vertex in Proposition <ref>.
For each vertex with $i<A$, add up
$$(2l'-2)(r_{V_i}-d_{V_i})\geq (i-1)z_{L_{i-1}}+(2l'-i-1)z_{L_{i}}.$$

For each vertex with $i>B$, add up
$$(2l'-2)(r_{V_i}-d_{V_i})\geq (l'+i-2)z_{L_{i-1}}+(l'-i)z_{L_{i}}.$$

Also add up

$$2(A-1)(r_{V_A}-d_{V_A})\geq (A-1)(z_{L_{A-1}}+z_{L_{A}}+z_L),$$

$$2(l'-B)(r_{V_B}-d_{V_B})\geq (l'-B)(z_{L_{B-1}}+z_{L_{B}}+z_L),$$

$$(B-A+1)(r_{V_A}-d_{V_A})\geq 2(B-A+1)z_L -(B-A+1).$$

If $l'>B$, we add up

$$(2l'-B-A-1)(r_{V_A}-d_{V_A}) \geq (l'-B-1)z_L+(l'-A)z_{L_A},$$

$$(2B-2)(r_{V_B}-d_{V_B})\geq (A-1)z_L+(2B-A-1)z_{L_{B_1}},$$

$$(2l'-2)(r_{V_i}-d_{V_i})\geq (l'+i-A-1)z_{L_{i-1}}+(l'-i+A-1)z_{L_i},$$

where $i$ takes all the values bigger than $A$ and less than $B$.

If $l'=B$, we must have $A>1$, in which case we add up

$$(2l'-B-A-1)(r_{V_A}-d_{V_A}) \geq (l'-B)z_L+(l'-A-1)z_{L_A},$$

$$(2B-2)(r_{V_B}-d_{V_B})\geq (A-2)z_L+(2B-A)z_{L_{B_1}},$$

$$(2l'-2)(r_{V_i}-d_{V_i})\geq (l'+i-A)z_{L_{i-1}}+(l'-i+A-2)z_{L_i},$$

where $i$ takes all the values bigger than $A$ and less than $B$.
In any case, after adding up we obtain the desired inequality.

For the case of the line, let us label the vertices $V_1$ to $V_{l'}$, where neighbouring vertices have consecutive indices and label $L_i$ the edge between $V_i$ and $V_{i+1}$. We call $V_{A}$ the vertex with a loop $L$.
For each vertex with $i<A$, add up
$$(2l'-2)(r_{V_i}-d_{V_i})\geq (i-1)z_{L_{i-1}}+(2l'-i-1)z_{L_{i}}$$

For each vertex with $i>A$, add up
$$(2l'-2)(r_{V_i}-d_{V_i})\geq (l'+i-2)z_{L_{i-1}}+(l'-i)z_{L_{i}}.$$
Without loss of generality suppose $A-1\leq l'-A$, i.e. there are more vertices to the left of $V_A$ than to its right. Add up

$$(l'-2A+1)(r_{V_A}-d_{V_A})\geq (l'-2A+1)z_{L_A},$$

$$(l'-1)(r_{V_A}-d_{V_A})\geq (2l'-2)z_{L}.$$

By Proposition <ref> we can add
$$2(A-1)(r_{V_A}-d_{V_A})\geq (A-1)(z_{L_{A-1}}+z_{L_{A}}+z_{L}).$$

Adding all these inequalities and noting that $A-1\geq 1$, we obtain the desired result.

Proposition <ref> says that the optimally in the sense of Proposition <ref>a), for fixed $l$ and $\varepsilon$ small enough can only be obtained when the directed graph is a cycle or a line with a loop at one end.