
Given a graph \( G(V, E) \) that is triangle-free, but adding any edges to the graph will form a triangle, and with \( |V| = 2019 \) and \( |E| > 2018 \), we need to find the minimum number of edges \( |E| \).

We claim that the minimum number of edges is \( 2n - 5 \) where \( n = 2019 \). This bound is attained for a graph constructed as follows: take a 5-cycle \( C_5 \), and replace one of the vertices with an independent set of \( n - 4 \) vertices, each of which is adjacent to the two neighbors of the original vertex.

To prove this, consider the following:

1. **Diameter Condition**: The graph \( G \) has diameter 2 because any two vertices with distance greater than 2 could have an edge added between them without forming a triangle. A diameter 1 graph is complete, which is not our case.

2. **Minimum Degree Analysis**:
   - If \( d \geq 4 \), then \( G \) has at least \( \frac{4n}{2} > 2n - 5 \) edges.
   - If \( d = 1 \), let \( v \) be a vertex connected only to \( w \). Then every other vertex must be connected to \( w \), making \( G \) a star graph, which contradicts \( |E| > n - 1 \).
   - If \( d = 2 \), let \( v \) be connected to \( w \) and \( x \). By the diameter 2 condition, every other vertex is connected to \( w \), \( x \), or both. Let \( A \) be the set of vertices adjacent to \( w \) but not \( x \), \( B \) be the set adjacent to both \( w \) and \( x \), and \( C \) be the set adjacent to \( x \) but not \( w \). Then \( |A| + |B| + |C| = n - 2 \). The only edges we can add are between \( A \) and \( C \), ensuring \( |E| \geq 2n - 5 \).
   - If \( d = 3 \), let \( v \) be adjacent to \( w \), \( x \), and \( y \). Each vertex in \( S = V \setminus \{v, w, x, y\} \) is adjacent to one of \( w \), \( x \), or \( y \). The degree sum gives \( \deg(w) + \deg(x) + \deg(y) \geq n - 1 \), leading to \( |E| \geq 2n - 5 \).

Thus, the minimum number of edges \( |E| \) in such a graph is:
\[
|E| = 2 \cdot 2019 - 5 = 4033.
\]
The answer is: \boxed{4033}.
A graph $G(V,E)$ is triangle-free, but adding any edges to the graph will form a triangle. It's given that $|V|=2019$, $|E|>2018$, find the minimum of $|E|$ .