Is it possible to extend the approach of the question:
Highlight a group of nodes in a tikz tree
to a generic tikz graph? In particular I don't have a graph in form of a tree, so I can't specify the relations.
In my example, I would like to specify the nodes that form a partition of a graph, something like the following image:
