Working with set theory of ZFC, would it be possible to construct a graph (as in graph theory) with the class of all sets as its nodes? With "is it possible" I mean, would it lead to a contradiction or not?
In particular, I would like to use the graph $(\mathcal{S}, E)$ with S being the class of all sets and $(x,y) \in E \Leftrightarrow x \in y$. Then I would use the property of the graph that there exists a path from one set to another if the first is a "deep" element of the latter.
If this graph is not a legal object, I would also be grateful for possible alternatives for this idea.
If you allow proper classes as graphs, which is not a horrible thing to do since we already allow proper classes as ordered structures, fields, and so on; then you can consider $V$ the class of all sets and $\in$ as $E$ itself (remember that $\in$ is really just a binary relation on $V$).
This is not a graph in the sense that $(V,\in)$ exists, but rather that we have a class that is the class of the vertices, and a class of edges. Do note, however, that this is a directed graph.
But there's a much simpler way to find "deep elements", it's called a transitive closure. If $X$ is a set, we define $\operatorname{TC}(x)$ as the union of $X\cup\bigcup X\cup\bigcup\bigcup X\cup\bigcup\bigcup\bigcup X\cup\ldots$ and this set is exactly those elements which are "deep" elements of $X$.
Moreover, if you are interested in the set $X$, then you can really just talk about the graph defined by $X$ (or rather, it's transitive closure), which is then really a graph that exists since if $X$ is a set, its transitive closure is a set, and $\in$ (restricted to a set) is a set as well.