<｜begin▁of▁sentence｜>### Instruction:
Given graph formula 'X--Y, A--B--C, D>E, F-E, G', which includes undirected edges (A--B), directed edges (D>E), and isolated vertices (G), how can you construct the graph in igraph, retrieve vertex names, and print the graph?
### Response:
from igraph import Graph

g = Graph.Formula('X--Y, A--B--C, D>E, F-E, G')

# Get the names of the vertices
vertex_names = g.vs['name']

# Print the constructed graph
print(g)

# Print the names of the vertices
print(vertex_names)
<|EOT|>
