# How can I label vertices of a graph with non-empty sets using Tikz Package?

I need to assign non-empty sets (instead of numbers) to the vertices of a graph. This may be called set-labeling of graphs. A graph with vertices having set-labels may be called set-labeled graphs (see the given figure). How can I draw set-labeled graphs using Tikz Package in LaTeX?

• Welcome to TeX.SX! Please post a minimal compilable code example (MWE) to help us help you. – TeXnician May 20 '17 at 7:19
• I don't think there is anything special about numbers in the context of TikZ nodes, so if you can make a graph with numbers at the vertices, then you can make a graph with something else at the vertices. – Torbjørn T. May 20 '17 at 7:51
• I cannot label the vertices by sets. – Sudev Naduvath May 20 '17 at 10:09
• Why not? What have you tried? – Torbjørn T. May 20 '17 at 10:10
• \vertex (u1) at (45:2) [label=right: $\{x_1,x_2\}$]{}; It shows error. – Sudev Naduvath May 20 '17 at 10:19

I don't know where you got \vertex from, but for a normal TikZ node you need to enclose the entire label in { .. }, because the parser is confused by the comma in the label. So use label={right:$\{x_1,x_2\}$} instead of label=right:$\{x_1,x_2\}$
\documentclass[border=5mm]{standalone}
\node [circle,fill] (u1) at (45:2) [label={right:$\{x_1,x_2\}$}]{};