<｜begin▁of▁sentence｜>### Instruction:
Given an undirected graph, how can you calculate the coreness (shell index) for each vertex, which indicates the respective k-core to which each vertex belongs?
### Response:
import igraph as ig

# Example graph with vertex degrees
edges = [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 0), (2, 5), (2, 4)]
g = ig.Graph(edges=edges)

# Compute the coreness for each vertex
coreness_values = g.coreness()

print(coreness_values)
<|EOT|>
