Do there exist linear relations between exceptional divisors Let $X$ be an isolated, Gorenstein singularity of dimension at least $2$ and $\pi: \widetilde{X} \to X$ be a resolution of singularities. Let $E$ be the exceptional divisor and $E_1,...,E_r$ be the irreducible components of $E$. Can there exist integers $a_1,...,a_r$ not all zero such that $\mathcal{O}_{\widetilde{X}}(\sum_i a_iE_i) \cong \mathcal{O}_{\widetilde{X}}$?
 A: I am just posting my comment as an answer.  For a quasi-compact, separated, irreducible, smooth $2$-dimensional algebraic space $\widetilde{Y}$ over an algebraically closed field $k$, for a connected, effective Cartier divisor $D$ that is a proper scheme and with irreducible components $(D_i)_{i=1,\dots,r}$, there exists a contraction $$f:\widetilde{Y}\to Y,$$ that maps $D$ to a $k$-point $p$ and that is an isomorphism from $\widetilde{Y}\setminus D$ to $Y\setminus\{p\}$ if and only if the following $r\times r$ intersection matrix is negative definite, $$(n_{i,j})_{1\leq i,j\leq r}, \ \ n_{i,j} = (D_i\cdot D_j)_{\widetilde{Y}}.$$
If $k=\mathbb{C}$ this is originally due to Hans Grauert.
MR0137127 
Grauert, Hans 
Über Modifikationen und exzeptionelle analytische Mengen. 
Math. Ann. 146 (1962), 331–368.
In arbitrary characteristic, this is due to Michael Artin.
MR0146182 
Artin, Michael 
Some numerical criteria for contractability of curves on algebraic surfaces. 
Amer. J. Math. 84 (1962), 485–496.
For $\widetilde{X}$ a quasi-projective, smooth, irreducible $k$-scheme of dimension $n\geq 
 2$, for a connected, effective Cartier divisor $E$ that is a proper scheme and with irreducible components $(E_i)_{i=1,\dots,r}$, for a surface $\widetilde{Y}$ in $X$ that is a complete intersection surface of $n-2$ sufficiently general and sufficiently ample divisors, the surface $\widetilde{Y}$ is a quasi-projective, smooth, irreducible $k$-scheme, the divisor $D=\widetilde{Y}\cap E$ in $\widetilde{Y}$ is a connected, effective Cartier divisor, and every divisor $D_i = \widetilde{Y}\cap E_i$ in $\widetilde{Y}_i$ is an irreducible divisor.
If there exists a contraction of $\widetilde{X}$ to an algebraic space that contracts $E$ to a point $p$ and that is an isomorphism outside of $E$, resp. outside of this point, then the restriction of the contraction to $\widetilde{Y}$ is such a contraction.  Then the intersection matrix is negative definite.  In particular, since the rows (or equivalently, the columns) are linearly independent, it follows that the Cartier divisor classes $[D_1],\dots,[D_r]$ in the Néron-Severi group of $\widetilde{Y}$ are linearly independent.  Since these are the pullbacks of the Cartier divisor classes $[E_1],\dots,[E_r]$ in the Néron-Severi group of $\widetilde{X}$, these classes are also $\mathbb{Z}$-linearly independent.
Finally, even when $\widetilde{X}$ is only quasi-compact, separated, and finitely presented, by Chow's Lemma, there exists a projective morphism,
$$ \rho:\widehat{X}\to \widetilde{X},$$ such that $\widehat{X}$ is quasi-projective.  A general complete intersection surface in $\widehat{X}$ need not be smooth.  However, we have resolution of singularities for $2$-dimensional schemes over an algebraically closed field, thus we can find a morphism $\widehat{Y}\to \widehat{X}$ playing the same role as the smooth surface above, where $\widehat{Y}$ is a connected, quasi-projective, smooth surface.  If there is a nontrivial linear relation among the Cartier divisor classes $[E_i]$ in $\widetilde{X}$, then this pulls back to a nontrivial linear relation among the pullback Cartier divisor classes on $\widehat{Y}$.  By the argument above, the irreducible components of the exceptional locus on $\widehat{Y}$ are $\mathbb{Z}$-linearly independent.  So, as above, the Cartier divisor classes $[E_i]$ in the Néron-Severi group of $\widetilde{X}$ are also $\mathbb{Z}$-linearly independent.
